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.im trying to work this out...
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)
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.
And, when we get there -
Code:
def _get_alert(gpio, mode, edge, bouncetime): if not mode & _LG_ALERT: raise KeyError(gpio)
So the question is why the 'mode' value is as it is, not how the code seems to expect it to be, or why the code is getting there if it in fact shouldn't.
That would seem to require an understanding of what it's all meant to be doing and how it does that and I don't have much of a clue on that at present.
Statistics: Posted by hippy — Mon Jul 29, 2024 10:47 am