Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.
0

BNO055 RuntimeError with Raspi 3
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

BNO055 RuntimeError with Raspi 3

by adelalla on Thu Jul 16, 2020 4:18 pm

Hi,

I have some troubles to run bno_simpletest.py correctly.

I updated my raspbian, activated serial port, disabled bluetooth, I'm using serial.Serial, I tried both commands in the code :
"uart = serial.Serial("/dev/serial0")"
"uart = serial.Serial("/dev/ttyAMA0")"

But I still have the same problem, it's working a few seconds and then I the following message :

"Traceback (most recent call last):
File "bno055_simpletest.py", line 23, in <module>
print("Gravity (m/s^2): {}".format(sensor.gravity))
File "/usr/local/lib/python3.7/dist-packages/adafruit_bno055.py", line 323, in gravity
return self._gravity
File "/usr/local/lib/python3.7/dist-packages/adafruit_bno055.py", line 450, in _gravity
resp = struct.unpack("<hhh", self._read_register(0x2E, 6))
File "/usr/local/lib/python3.7/dist-packages/adafruit_bno055.py", line 409, in _read_register
raise RuntimeError("UART read error: {}".format(resp[1]))
RuntimeError: UART read error: 7"

I don't know what's going on, can you help me please..

adelalla
 
Posts: 2
Joined: Mon Jun 15, 2020 10:24 am

Re: BNO055 RuntimeError with Raspi 3

by dherrada on Fri Jul 17, 2020 2:21 pm

The bno055 doesn't play very well with UART. However, I recently released 5.0.2, which did significantly increase the reliability (although I don't think I tested it on a Pi). Can you confirm that you're using at least version 5.0.2?

The quick way to get around this is to just catch RuntimeErrors since they can happen frequently in UART mode.

dherrada
 
Posts: 92
Joined: Thu Jan 04, 2018 4:59 pm

Re: BNO055 RuntimeError with Raspi 3

by adelalla on Sun Jul 19, 2020 12:07 pm

Hi dherrada,

Thank you for your answer !

There is some I'd like to discuss with you :
- You said that the bno055 doesn't play well with UART. Also, I read everywhere that it's also the case with I2C. Can you tell me how can I make it works proprely with my Raspberry PI3 ?
- I'm using the latest version of the library "adafruit-circuitpython-bno055==5.1.0" and I have the latest version of the repository, and I'm using the serial library (because the only one compatible with my raspi 3)
- Someone on another forum had the same trouble than me, he told me that there where not this problem with the previous version of the repository (https://github.com/adafruit/Adafruit_Python_BNO055). I tried and I confirm that I haven't this problem with the previous version of the repo/library => Adafruit_BNO055)
- Is your final advice is to just ignore the raise part of the code and just to catch the error with a print ? Is it ok to proceed like this ? Will I not have some missing data inside my files ? I need a robust code for an experiment...

Thank you again for your help,
AD

adelalla
 
Posts: 2
Joined: Mon Jun 15, 2020 10:24 am

Please be positive and constructive with your questions and comments.