Hi Terry, > > Try copying my test script and make the handler do nothing but > > For clarity, you are suggesting that I modify the handler in your > original script to the one you have just given?
Yes. It's aiming to execute "quickly" and return allowing you to study the deltas in seconds to see if bounce ever gets all the way through to the Python. > > http://www.ganssle.com/debouncing-pt2.htm > > Yes. I did. Good. I don't understand the electronic side enough to judge if the capacitor circuit he gives is sufficient for this purpose. Give me bits! :-) > I was trying to avoid that and my single cap and pull-down resistors > technique seemed to work until this cropped up. Perhaps it is working well enough, thus the modified event handler above to find out. You are doing these tests with the same model of switch as will be installed? > Before I embark on that, can you confirm that you are suggesting that > the debounce software appears to be the cause of this and I could > avoid it if I could remove the debounce argument and simply improve > the debouncing in hardware? The GPIO's software debounce logic is poor and removing the bouncetime argument gets it out the way. It seems there could be finer grade debouncing already happening lower down the software/hardware stack and that may be sufficient. If no bounce ever reaches the Python then the GPIO library can just call your handler on both 1 and 0 and you can keep a tally of which it must be and only act on the 1s. Ensuring no bounce makes it through might already be happening without you modifying your existing circuit. Perhaps now you know why ganssle.com suggest the change you can try and recreate that circumstance? (If I get time I'll look at the kernel to see how EPOLLET, edge triggered, affects epoll_wait(2).) Cheers, Ralph. -- Next meeting: Bournemouth, Tuesday, 2017-04-04 20:00 Meets, Mailing list, IRC, LinkedIn, ... http://dorset.lug.org.uk/ New thread: mailto:[email protected] / CHECK IF YOU'RE REPLYING Reporting bugs well: http://goo.gl/4Xue / TO THE LIST OR THE AUTHOR

