On Sunday, 26 March 2017 18:38:33 BST Ralph Corderoy wrote:
> > http://www.hadrian-way.co.uk/Misc/scope.GIF
>
> I interpret that as you holding the switch on for 0.328 s?
Well I didn't actually measure it, :-) but I held the switch down for just
long enough to get the rising edge and the falling edge onto the scope display
with a reasonable resolution.
> It seems to me you are trying to match the observations to your model of
> how things work, and since that's a hardware model you are assuming
> noise, etc.
Well I've revised my thoughts since I wrote that. I suspect that the Library
is actually checking for a high and not a rising edge.
> I'm doing the same, but my model is software so I think it's the library
> continually reading "switch on" from the kernel whenever it returns to
> ask it for an event for the duration of you holding the switch. The
> strace used earlier would say.
Yes. I now think that too.
> But, this would have been observable with the old hardware and the cut
> down test program that had the substitute callback that just printed the
> current time.
>
> Try copying my test script and make the handler do nothing but
>
> prev_now = 0
>
> def handle_event(gpio):
> global prev_now
> now = time.time()
> print now - prev_now
> prev_now = now
> If you never tried it, just say. It would stop me asking. :-)
>
> I never did get an answer, and stopped asking anyway. :-)
No I don't think I tried it because I asked for a clarification and I'm not
sure you answered. (My request was probably lost in the noise.) I may have
done, but forgot to report back.
> If it really was crosstalk causing the kernel to keep saying there are
> new events, would you expect a nice even stream of time differences to
> appear when you hold the button on? If the Python is running fast
> enough, then I'd expect erratic deltas?
No. The crosstalk wouldn't cause this; what it did was to cause another
channel to trigger when any switch was depressed. I haven't seen it since the
debounce circuit rounded off the edges.
> If you disconnect your bells circuit from the Pi and just put in place a
> single switch, does the Python still act the same way? Crosstalk with a
> small one-switch less-wire circuit?
This is something that I'd like to try, but the focus this week is to get the
system installed.
I ended up with just two message; 'Late Hours Enabled' and 'Late Hours
Disabled', because there would be no operator feedback otherwise. The other
functions all start or stop some music or chimes playing.
> If you haven't time to investigate, that's fine.
Soon (I hope).
I still need to develop a tool for the WMT Staff to update the content on the
Webserver, but they should be able to live without that for a while.
--
Terry Coles
--
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