-
Notifications
You must be signed in to change notification settings - Fork 615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
epdconfig.py closes device so sleep doesn't work #315
Comments
Hello, I got the same issue. Have you tried to revert the changes from PR #314? |
I agree, this is not ideal. The issue stems from the move to gpiozero from RPi.GPIO. I managed to work around this by just commenting out the calls to the close method. I believe this is fine as long as your script terminates properly because of the aforementioned automatic cleanup. |
@pgeschwill & @robweber The optional_cleanup branch adds an the argument I've implemented it for all the modules and the tests. I only have a 5in83 and 5in65f to test with at the moment, but it looks OK for those under Bookworm. On an unexpected exit (e.g caught keyboard interrupt), you can call |
In the past, sending an email has helped raise the priority of issues with the E-Paper team. I think they're really busy with many projects. I sent the following mail on 20 December:
|
@txoof - I didn't field test the PR you proposed but reviewing the code it seems sound. It's too bad implementers will have to add the error handling themselves to fix this but it's easily done. This fixes the main issue fairly easily without having to refactor a lot of other code or add additional logic to |
@pgeschwill I've tested it out on the screens that I have with some test code, but I'd love another pair of eyes. |
Thank you very much for your feedback, we will probably fix this issue in the next version; An update is expected within a week |
Looks like PR #314 changed the way the
module_init
andmodule_exit
classes behave which results in an error when utilizing the display sleep functionality.When running as part of a loop the EPD will display an image on the first run. When trying to display a new image after going to sleep an error is thrown
GPIODeviceClosed
. Comparing the old and current versions of the file it looks like the previous version would setup each pin as part of themodule_init
method and then close them withmodule_exit
. In the current version the pins are setup in theinit()
method instead. When waking up from sleep the existing object callsmodule_init
which then tries to perform an action on an already closed device.The result is that makes reusing the EPD class object impossible and makes the sleep function useless. Refactoring
epdconfig.py
to utilize the old behavior of setting up the pin in themodule_init
method would probably fix this. Log below of this happening.The text was updated successfully, but these errors were encountered: