Hello,
version OpenHab and GPIO:
openHAB 2.4.0 Build #1447
binding-gpio1 - 1.13.0.SNAPSHOT
i run GPIO binding on openhab2 and a have button in GPIO17 and 3,3V
my /etc/rc.local:
sudo usermod -a -G dialout openhab
echo 17 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio17/direction
echo 22 >/sys/class/gpio/export
echo out >/sys/class/gpio/gpio22/direction
when button is press (have state OPEN in openhab, in command line 1) led on gpio22 should by change state to ON in openhab, 1 in command line, sometimes its working, one time to 2-3 pressed button, where is the problem in openhab2 ?
this is OK, button press and led is on:
pi@raspberrypi:~ $ cat /sys/class/gpio/gpio17/value
1
pi@raspberrypi:~ $ cat /sys/class/gpio/gpio22/value
1
button is not press and led is off:
pi@raspberrypi:~ $ cat /sys/class/gpio/gpio17/value
0
pi@raspberrypi:~ $ cat /sys/class/gpio/gpio22/value
0
and sometimes when button is press led isnt OFF and i do not know why:
pi@raspberrypi:~ $ cat /sys/class/gpio/gpio17/value
1
pi@raspberrypi:~ $ cat /sys/class/gpio/gpio22/value
0
Button is connected to 3,3V GPIO and to GPIO17 by the 1K resistor and to GND by the 10K resistor
this is rules code but i thing isnt bed:
rule "Status door I"
when
Item DrzwiI changed from OPEN to CLOSED
or
Item DrzwiI changed from CLOSED to OPEN
then
if (DrzwiI.state == OPEN) {
LEDI.sendCommand(ON)
Alarm_DoorI.postUpdate(ON)
} else if (DrzwiI.state == CLOSED) {
LEDI.sendCommand(OFF)
Alarm_DoorI.postUpdate(OFF)
}
end