The EXP1_2 and EXP2_5 are aliases for PE7 and PB2 pins, which are the encoder and pushbutton on my display. What I want to get is the ability to turn on the display when the encoder or button are used and then turn it off30 seconds after.
All of that works except when there is a print running. If a print is running and I use the display, eventually Klipper crashes with a “Maximum recursion” error. My guess is that the issue will happen any time the display is used while there is other GCode being executed.
Is there anything bad with the way I’ve setup the buttons or could this be a bug in Klipper?
Some more data: I tried removing one of the gcode_button sections (“display_enc_button”) but that did not fix the issue. So, either one will cause the crash.
I’ve done some more debugging and I am starting to wonder if Python logging and greenlets can be mixed?
It seems that all of the crashes that I’ve caught are somewhere in the logging code. Greenlet documentation suggests that normal tracing does not work with greenlets because stacks get switched around. I also see that the logging code is trying to get the current frame. Wonder if that code is getting mixed up causing the recursion.
I do not know for sure but actually I would be surprised if the “special” pins from the encoder can simply be overidden with secondary functions. I would guess that was never intended and thus is leading to the issue.