bno055 - i2c problem. ETIMEDOUT.

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
prem111
Posts: 79
Joined: Sun Feb 23, 2020 3:18 pm

bno055 - i2c problem. ETIMEDOUT.

Post by prem111 » Tue Jul 28, 2020 8:45 pm

Hi, im use this driver:

https://github.com/micropython-IMU/micr ... 55_base.py

imu: https://www.dfrobot.com/product-1793.html

It's ok, it's getting the data, but sometimes I get an error:

Code: Select all

  File "libs/bno055_base.py", line 115, in _readn
OSError: [Errno 110] ETIMEDOUT
i2c:
i2c = machine.I2C(scl=machine.Pin(I2C_SCL_PIN), sda=machine.Pin(I2C_SDA_PIN), freq=100000)

What could be the reason ?

prem111
Posts: 79
Joined: Sun Feb 23, 2020 3:18 pm

Re: bno055 - i2c problem. ETIMEDOUT.

Post by prem111 » Wed Jul 29, 2020 8:06 am

I think adding a timeout in i2c to 2000 helped, but is that a good solution and will it always work?

User avatar
pythoncoder
Posts: 4374
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: bno055 - i2c problem. ETIMEDOUT.

Post by pythoncoder » Wed Jul 29, 2020 7:08 pm

Coincidentally I have been running that driver today without issue. What MicroPython board are you running? Are you sure there are pullups on the I2C lines? Problems with I2C are usually down to pullups or overly long wires.

I have never seen this problem and tested with hard and soft I2C with no special args. My Adafruit breakout board has pullups.

Excellent choice of IMU, by the way. The built-in sensor fusion is awesome.
Peter Hinch

prem111
Posts: 79
Joined: Sun Feb 23, 2020 3:18 pm

Re: bno055 - i2c problem. ETIMEDOUT.

Post by prem111 » Wed Jul 29, 2020 7:23 pm

Thanks for reply. I am using esp32. It also tests with the wires. As for them, I agree, IMU is awesome. But I'm having trouble calibrating after rebooting. I have mag offsets saved, after restart I send them to the device, but I don't know acc and gyro offsets so I don't give them, sometimes it's fine and accepts mag offset and sometimes heading starts from 0.0. Is there a solution for this?

User avatar
pythoncoder
Posts: 4374
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: bno055 calibration.

Post by pythoncoder » Thu Jul 30, 2020 4:45 am

I don't understand your comments about sending calibration data to the device. Please read this section of the docs and watch the linked video. Calibration is done by moving the device in a specified way at power up. The device will return relative orientation (as you're seeing) until this physical process is complete.
Peter Hinch

prem111
Posts: 79
Joined: Sun Feb 23, 2020 3:18 pm

Re: bno055 - i2c problem. ETIMEDOUT.

Post by prem111 » Thu Jul 30, 2020 6:30 am

I mean to send/save the offsets. In order not to calibrate every time it is turned on.

User avatar
pythoncoder
Posts: 4374
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: bno055 - i2c problem. ETIMEDOUT.

Post by pythoncoder » Thu Jul 30, 2020 4:11 pm

I don't think the chip allows this.

Magnetometers are very sensitive to static external magnetic fields and they need to be calibrated for every new location. So, until this has been done, the chip emits orientation relative to its starting position. It switches to absolute orientation when it considers that the magnetometer can be trusted.

If I'm wrong about the chip by all means point me to a reference and I'll correct my docs and code, but that was the conclusion I drew after reading the data sheet and watching the calibration video.
Peter Hinch

Post Reply