Skip to content

Random KeyboardInterrupt and ASCII disco #15

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

Closed
turbinenreiter opened this issue Sep 5, 2018 · 2 comments
Closed

Random KeyboardInterrupt and ASCII disco #15

turbinenreiter opened this issue Sep 5, 2018 · 2 comments

Comments

@turbinenreiter
Copy link
Member

turbinenreiter commented Sep 5, 2018

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "main.py", line 43, in run
  File "/lib/uasyncio/core.py", line 155, in run_forever
  File "/lib/uasyncio/core.py", line 110, in run_forever
  File "main.py", line 33, in send_data
  File "main.py", line 24, in get_data
  File "vector3d.py", line 103, in xyz
  File "imu.py", line 395, in _accel_callback
  File "imu.py", line 312, in accel_range
KeyboardInterrupt: 
>>> KK3K3K<lKlKlKKK3K3K<lKlKlKK<3K3K3K3lK<KK<KK3K3K<lKxKlKKK3K3K<lKlKlKK<,K3K3K3KlK<KK<KK3K3K<lKKHKK3KK<lKlKlKK<,K3K3K3KlK<KK<KK3K3K<lKlKlKK3K3K<lKlK

So this is a fun little thing. I'm running on an ESP32 and have a fast loop calling all sensor values of the MPU9265 (which is yet another version of the chip). Every once in a while, execution stops with above Traceback.

Anyone ever seen anything like this?

The line in the code where this happens is:

@property
def accel_range(self):
 """
Accelerometer range
Value:              0   1   2   3
for range +/-:      2   4   8   16  g
 """
    try:
        self._read(self.buf1, 0x1C, self.mpu_addr)
        ari = self.buf1[0] // 8 # this line throws up
    except OSError:
        raise MPUException(self._I2Cerror)

    return ari

I think this is gonna be a fun one.

/edit: It actually happens at random parts in the code.

@turbinenreiter
Copy link
Member Author

Reducing the I2C frequency seems to help.

@peterhinch
Copy link
Contributor

That is bizarre. I've never seen anything like it.

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

2 participants