Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script not firing on first press #3

Open
photinus opened this issue Dec 15, 2016 · 4 comments
Open

Script not firing on first press #3

photinus opened this issue Dec 15, 2016 · 4 comments

Comments

@photinus
Copy link

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.

@larsks
Copy link
Owner

larsks commented Dec 16, 2016

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.

@Laerix
Copy link

Laerix commented Jul 11, 2018

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

@larsks
Copy link
Owner

larsks commented Jul 11, 2018

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
Copy link

stoey commented May 3, 2019

I needed this too - PR is here: #10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants