Quantcast
Viewing all articles
Browse latest Browse all 4909

Python • Re: Runtime error waiting_for_edge GPIO

im trying to work this out...
I don't want to destroy your enthusiam but I think you're on a fruitless quest with your limited experience. The issue seems to be another bug in 'rpi-lgpio' which likely won't be overcome by hacking at things at a higher level. At least until we know what we are having to hack around.

I think polling rather that waiting for an edge would side-step the issue entirely but, as we are here, it's worth figuring out why it doesn't work.

The problem code is this -

Code:

    try:        alert = _get_alert(gpio, mode, edge, bouncetime)    except KeyError:        unset = True        alert = _set_alert(gpio, mode, edge, bouncetime)
I am not yet sure why the first '_get_alert' throws a 'KeyError' exception, but when it does it seems inevitable to me that calling '_get_alert' again will throw another error, as it does, though perhaps the 'unset = True' is somehow meant to avoid that.

When it gets there for the Power button -

gpio = 3, mode = 0x10121 (65825), edge = 0x20 (32), bounceTime = None

That all seems reasonable to me, presuming 'mode' is correct, so time to dig into '_get_alert' to see why that's throwing an error.

Statistics: Posted by hippy — Mon Jul 29, 2024 10:47 am



Viewing all articles
Browse latest Browse all 4909

Trending Articles