larsks/gpio-watch

Script not firing on first press

Opened this issue · 4 comments

Running a script based on a switch on gpio 4:
/usr/bin/gpio-watch -e switch 4

The first press results in nothing, no output from gpio-watch and the script does not run. After the initial press the scripts run without issue.

I can't reproduce that behavior. I'm running gpio-watch on a raspberry pi, and if I start it up like this:

gpio-watch -v -s /usr/local/etc/gpio-scripts -e switch 17 21 22

Then as soon as I press a switch connected to one of those pins, I see, for example:

2016-12-15 22:48:48 run_script:92 pin 22: running script /usr/local/etc/gpio-scripts/22

Note that you need the -v flag if you want to see any output from gpio-watch when it processes events.

I have the same issue "not firing on the first press".
I suppose it is because i have an external pullup resistor on de GPIO.

Is there a possibility to change it somewhere in the code that HIGH is a normal state an LOW is the push active state?

Kind regards.
Johan

I would be happy to accept a pull request that implements this behavior....maybe we want to replace switch with switch_high and switch_low.

stoey commented

I needed this too - PR is here: #10