Page 1 of 1

bno055 - i2c problem. ETIMEDOUT.

Posted: Tue Jul 28, 2020 8:45 pm
by prem111
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 ?

Re: bno055 - i2c problem. ETIMEDOUT.

Posted: Wed Jul 29, 2020 8:06 am
by prem111
I think adding a timeout in i2c to 2000 helped, but is that a good solution and will it always work?

Re: bno055 - i2c problem. ETIMEDOUT.

Posted: Wed Jul 29, 2020 7:08 pm
by pythoncoder
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.

Re: bno055 - i2c problem. ETIMEDOUT.

Posted: Wed Jul 29, 2020 7:23 pm
by prem111
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?

Re: bno055 calibration.

Posted: Thu Jul 30, 2020 4:45 am
by pythoncoder
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.

Re: bno055 - i2c problem. ETIMEDOUT.

Posted: Thu Jul 30, 2020 6:30 am
by prem111
I mean to send/save the offsets. In order not to calibrate every time it is turned on.

Re: bno055 - i2c problem. ETIMEDOUT.

Posted: Thu Jul 30, 2020 4:11 pm
by pythoncoder
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.