Black Lives Matter - Action and Equality. ... Adafruit joins the Stop Hate for Profit campaign.
0

BNO055 CircuitPython Not Working
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

BNO055 CircuitPython Not Working

by PseudoSudoNym on Thu Mar 26, 2020 11:46 pm

I've purchased a BNO055 that I'm using with a Raspberry Pi for a class project. I've followed the CircuitPython tutorial on lowering the I2C clock speed and things were working for a while. Now though, when ever something like the bno055_simpletest.py gets to the line "sensor = adafruit_bno055.BNO055(i2c)", I get the following errors:

Code: Select all | TOGGLE FULL SIZE
Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.5/site-packages/adafruit_bus_device/i2c_device.py", line 184, in __probe_for_device
    self.i2c.writeto(self.device_address, b"")
  File "/home/pi/.local/lib/python3.5/site-packages/busio.py", line 87, in writeto
    return self._i2c.writeto(address, buffer, stop=stop)
  File "/home/pi/.local/lib/python3.5/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 38, in writeto
    self._i2c_bus.write_bytes(address, buffer[start:end])
  File "/home/pi/.local/lib/python3.5/site-packages/Adafruit_PureIO/smbus.py", line 256, in write_bytes
    self._device.write(buf)
OSError: [Errno 6] No such device or address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.5/site-packages/adafruit_bus_device/i2c_device.py", line 190, in __probe_for_device
    self.i2c.readfrom_into(self.device_address, result)
  File "/home/pi/.local/lib/python3.5/site-packages/busio.py", line 77, in readfrom_into
    return self._i2c.readfrom_into(address, buffer, stop=stop)
  File "/home/pi/.local/lib/python3.5/site-packages/adafruit_blinka/microcontroller/generic_linux/i2c.py", line 44, in readfrom_into
    readin = self._i2c_bus.read_bytes(address, end-start)
  File "/home/pi/.local/lib/python3.5/site-packages/Adafruit_PureIO/smbus.py", line 155, in read_bytes
    return self._device.read(number)
OSError: [Errno 6] No such device or address

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "cal_test.py", line 7, in <module>
    sensor = adafruit_bno055.BNO055(i2c)
  File "/home/pi/.local/lib/python3.5/site-packages/adafruit_bno055.py", line 142, in __init__
    self.i2c_device = I2CDevice(i2c, address)
  File "/home/pi/.local/lib/python3.5/site-packages/adafruit_bus_device/i2c_device.py", line 69, in __init__
    self.__probe_for_device()
  File "/home/pi/.local/lib/python3.5/site-packages/adafruit_bus_device/i2c_device.py", line 192, in __probe_for_device
    raise ValueError("No I2C device at address: %x" % self.device_address)
ValueError: No I2C device at address: 28


I've tried lowering the clock speed further, I've used "sudo i2cdetect -y 1" to determine that the device is connected at the correct address, and I have even been able to use the i2cget and i2cset commands to fully calibrate the device! (I got 0x3f from address 0x35 indicating all 3's for the four calibration fields)

On top of all that, I have been able to use the old Adafruit_Python_BNO055 library to use the BNO055 over UART.

I'm planning on rewiring my project to use this deprecated library but I'm still really confused why the python code stopped working all of a sudden. Is there an issue with my Pi/BNO055? An issue with the CircuitPython library?

PseudoSudoNym
 
Posts: 1
Joined: Thu Mar 26, 2020 11:26 pm

Please be positive and constructive with your questions and comments.