Skip to content
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

Crash in touch.py #27

Open
p8mty opened this issue Dec 27, 2024 · 3 comments
Open

Crash in touch.py #27

p8mty opened this issue Dec 27, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@p8mty
Copy link

p8mty commented Dec 27, 2024

Occasionally (2 or 3 times a day) my program crashes with the following:

>>> %Run -c $EDITOR_CONTENT

MPY: soft reboot
malloc self
set fb pointers
m_new_class(ST7701...
launch core1
launched core1
core1 returned

[[[[ Program output ]]]]

Traceback (most recent call last):
  File "<stdin>", line 265, in <module>
  File "touch.py", line 66, in poll
  File "touch.py", line 77, in _handle_touch
OSError: [Errno 5] EIO

The call in line 265 in my program is merely a call to touch.poll().
The line 77 in _handle_touch is dealing with i2c - I have no additional i2c devices attached to the Presto

It's not reproducible in that I don't know what to do to cause it, but if I poke at the screen for long enough, it will happen!

@MichaelBell
Copy link
Collaborator

I saw a crash a couple of times when running for a long time, which I suspect was this (but I wasn't running through Thonny so didn't see the stack). We should probably just ignore the failure and wait for the next poll - I2C can be a bit unreliable at times.

@Gadgetoid Gadgetoid self-assigned this Jan 7, 2025
@Gadgetoid Gadgetoid added the bug Something isn't working label Jan 7, 2025
@Gadgetoid
Copy link
Member

Yup swallow the error and hope the next poll works 😬 with maybe a more permanent failure for multiple sequential errors?

@kmohrf
Copy link

kmohrf commented Jan 20, 2025

It seems like this problem doesn’t (always?) trigger a python exception and therefore can’t be handled in micropython. Can you confirm that? I’ve monkey-patched the presto.touch.poll function that is called in presto.update and presto.partial_update to catch the base Exception type and log all errors and I don’t see any log calls in my output. Instead, a few seconds later my watchdog kicks in and resets the presto.

In case this is true, I’d appreciate a timely fix as this is the only thing that keeps my presto from being a reliable little companion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants