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

I2C bus failure during fast keypad presses (for example during screeshot) #198

Open
zytegalaxy opened this issue Dec 22, 2024 · 0 comments

Comments

@zytegalaxy
Copy link
Collaborator

I was trying to get a screenshot on v1.0.0 where suddenly the system crashed. I think we need to have a way to recover from this. As it can be seen in the error, the exception is thrown where the light sensor cannot initialize the I2C bus. I believe there was some sort of conflict (collision) with keypad I2C bus events.

I suggest we have a refresh keypad or reset I2C bus, to run for recovery while we investigate the root cause to hopefully eliminate it.

1734835527.875680 [ERROR] An error occurred while running the app.
Traceback (most recent call last):
  File "/opt/ubo/env/lib/python3.11/site-packages/ubo_app/main.py", line 84, in main
    app.run()
  File "/opt/ubo/env/lib/python3.11/site-packages/kivy/app.py", line 956, in run
    runTouchApp()
  File "/opt/ubo/env/lib/python3.11/site-packages/kivy/base.py", line 574, in runTouchApp
    EventLoop.mainloop()
  File "/opt/ubo/env/lib/python3.11/site-packages/kivy/base.py", line 339, in mainloop
    self.idle()
  File "/opt/ubo/env/lib/python3.11/site-packages/kivy/base.py", line 379, in idle
    Clock.tick()
  File "/opt/ubo/env/lib/python3.11/site-packages/kivy/clock.py", line 733, in tick
    self.post_idle(ts, self.idle())
  File "/opt/ubo/env/lib/python3.11/site-packages/kivy/clock.py", line 776, in post_idle
    self._process_events()
  File "kivy/_clock.pyx", line 620, in kivy._clock.CyClockBase._process_events
  File "kivy/_clock.pyx", line 653, in kivy._clock.CyClockBase._process_events
  File "kivy/_clock.pyx", line 649, in kivy._clock.CyClockBase._process_events
  File "kivy/_clock.pyx", line 218, in kivy._clock.ClockEvent.tick
  File "/opt/ubo/env/lib/python3.11/site-packages/ubo_app/services/040-sensors/setup.py", line 22, in read_sensors
    light = light_sensor.lux
            ^^^^^^^^^^^^^^^^
  File "/opt/ubo/env/lib/python3.11/site-packages/adafruit_veml7700.py", line 252, in lux
    return self.resolution() * self.light
           ^^^^^^^^^^^^^^^^^
  File "/opt/ubo/env/lib/python3.11/site-packages/adafruit_veml7700.py", line 223, in resolution
    self.gain_value() == gain_max
    ^^^^^^^^^^^^^^^^^
  File "/opt/ubo/env/lib/python3.11/site-packages/adafruit_veml7700.py", line 212, in gain_value
    gain = self.light_gain
           ^^^^^^^^^^^^^^^
  File "/opt/ubo/env/lib/python3.11/site-packages/adafruit_register/i2c_bits.py", line 66, in __get__
    i2c.write_then_readinto(self.buffer, self.buffer, out_end=1, in_start=1)
  File "/opt/ubo/env/lib/python3.11/site-packages/adafruit_bus_device/i2c_device.py", line 140, in write_then_readinto
    self.i2c.writeto_then_readfrom(
  File "/opt/ubo/env/lib/python3.11/site-packages/busio.py", line 232, in writeto_then_readfrom
    return self._i2c.writeto_then_readfrom(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/ubo/env/lib/python3.11/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 98, in writeto_then_readfrom
    readin = self._i2c_bus.read_i2c_block_data(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/ubo/env/lib/python3.11/site-packages/Adafruit_PureIO/smbus.py", line 264, in read_i2c_block_data
    ioctl(self._device.fileno(), I2C_RDWR, request)
OSError: [Errno 121] Remote I/O error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant