Read GPIO Status

Reads the state of a [GPIO] pin http://pt.wikipedia.org/wiki/General_Purpose_Input/Output specified by the gpio parameter. The HTTP method used is POST.

POST /gpio_state.fcgi

Parameters

  • gpio (int): Number of the general-purpose pin (GPIO) whose state you want to read.

For iDFit/iDAccess:

  • pin 0 - alarm zone 1
  • pin 1 - alarm zone 2
  • pin 2 - alarm zone 3
  • pin 3 - alarm zone 4
  • pin 4 - alarm zone 5
  • pin 5 - Door sensor 1
  • pin 6 - Door sensor 2
  • pin 7 - button 1
  • pin 8 - button 2
  • pin 9 - alarm output
  • pin 10 - LED of Biometry
  • pin 11 - Relay 1
  • pin 12 - Relay 2
  • pin 13 - Tamper sensor
  • pin 20 - Wiegand output 1
  • pin 21 - Wiegand output 0
  • pin 22 - Wiegand input 1
  • pin 23 - Wiegand input 0

For iDFlex/iDAccess Pro/iDAccess Nano:

  • pin 0 - Tamper sensor

For iDFace:

  • pin 0 - Tamper sensor
  • pin 1 - SIP call button

Response

  • enabled (int): Indicates whether the GPIO is enabled (1) or disabled (0). An attempt to read or write to a disabled GPIO has an indefinite effect.
  • in (int): Indicates whether the GPIO is configured as input pin (1) or output pin (0).
  • pin (string): Contains the name of the GPIO.
  • idle (int): Contains the value of the GPIO when idle.
  • pullup (int): Indicates whether GPIO pullup is enabled (1) or disabled (0).
  • value (int): Contains the current GPIO value.
  • notify (int): Indicates whether the access software will be warned (1) of changes to this GPIO or not (0).
  • notified (int) : Indicates how many times the GPIO has notified the access software of a change.

Request Example

Reading the state of GPIO 1:

$.ajax({
    url: "/gpio_state.fcgi?session=" + session,
    type: 'POST',
    contentType: 'application/json',
    data: JSON.stringify({
        gpio: 1
    })
});