installing micropython library (BNO055/IMU) properly

1.1k views Asked by At

Trying to use the BNO055 IMU 9DOF sensor with my ESP32 under micropython.

For this you need to install/use a library. However when I follow the adafruit/circuitpython instructions, this is not recognized.

This is my setup:

  1. ESP32 + MU editor (alpha version, that works with ESP32)
  2. BNO hooked up correctly (and tested) to the I2C ports of the ESP32
  3. Windows 10 computer + python 3.7.4 installed (AND python 2.7) installed.
  4. to install the library I used pip3 install adafruit-circuitpython-bno055 according to this guide
  5. basic blink sketch and python REPL console seems to work fine

I tried:

  • googling
  • ensuring MU environment runs in python 3
  • running MU in admin mode
  • more things...

Code: Simple blink sketch + import bno055 below. How to debug this error eludes me and the documentation is curiously sparse (to my taste), any guidance really appreciated.

# Write your code here :-)
import machine
import time
import adafruit_bno055

p2_led = Pin(2, Pin.OUT)

while True:
    p2_led.on()
    time.sleep(1)
    p2_led.off()
    time.sleep(1)

Error:

>>> 
raw REPL; CTRL-B to exit
>OK

Traceback (most recent call last):
  File "<stdin>", line 5, in <module>
ImportError: no module named 'adafruit_bno055'
>
MicroPython v1.13 on 2020-09-02; ESP32 module with ESP32
Type "help()" for more information.
>>> 

Edit: even after recognizing the module, it doens't seem to work. There is again, extremely little debug information to go on (i.e. what file throws the error and where it is located...), otherwise will gladly provide. I'm very much puzzled by this, any advice welcome. Below MU admin console, code and errors.

enter image description here

Code:

# Write your code here :-)
import machine
import time
import Adafruit-BNO055

Error:

raw REPL; CTRL-B to exit
>OKTraceback (most recent call last):
  File "<stdin>", line 5
SyntaxError: invalid syntax
>
MicroPython v1.13 on 2020-09-02; ESP32 module with ESP32
Type "help()" for more information.
1

There are 1 answers

0
user2305193 On

the answer is simple. Put the library onto the board itself... (Source from a forum post)

enter image description here

Then simply transfer the library to the board:

enter image description here