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

python 3.8 cannot use sensors: OSError #101

Open
jwhendy opened this issue Oct 16, 2020 · 1 comment
Open

python 3.8 cannot use sensors: OSError #101

jwhendy opened this issue Oct 16, 2020 · 1 comment

Comments

@jwhendy
Copy link

jwhendy commented Oct 16, 2020

Trying to do something like this:

$ cat acc-example.py 

from sense_hat import SenseHat

sense = SenseHat()

while True:
    acceleration = sense.get_accelerometer_raw()
    x = acceleration['x']
    y = acceleration['y']
    z = acceleration['z']

    x=round(x, 0)
    y=round(y, 0)
    z=round(z, 0)

    print("x={0}, y={1}, z={2}".format(x, y, z))

Results in:

$ python acc-example.py 
Traceback (most recent call last):
  File "acc-example.py", line 6, in <module>
    acceleration = sense.get_accelerometer_raw()
  File "/home/jwhendy/.local/lib/python3.8/site-packages/sense_hat/sense_hat.py", line 844, in get_accelerometer_raw
    raw = self._get_raw_data('accelValid', 'accel')
  File "/home/jwhendy/.local/lib/python3.8/site-packages/sense_hat/sense_hat.py", line 703, in _get_raw_data
    if self._read_imu():
  File "/home/jwhendy/.local/lib/python3.8/site-packages/sense_hat/sense_hat.py", line 684, in _read_imu
    self._init_imu()  # Ensure imu is initialised
  File "/home/jwhendy/.local/lib/python3.8/site-packages/sense_hat/sense_hat.py", line 648, in _init_imu
    raise OSError('IMU Init Failed')
OSError: IMU Init Failed

Info

$ python --version
Python 3.8.2

$ pip freeze
sense-hat==2.2.0
RTIMULib==7.2.1

From looking at the code, seems like this is not playing nice with RTIMUlib. I installed/built it from source as described here.

Thanks.

@jwhendy jwhendy changed the title python 3.8 cannot user sensors: OSError python 3.8 cannot use sensors: OSError Oct 21, 2020
@jwhendy
Copy link
Author

jwhendy commented Oct 27, 2020

Just posted at RTIMULib2 as I think that's causing the issue here and in #79 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants