Do you have 'adafruit_bus_device' installed?

Ref:
https://circuitpython.readthedocs.io/projects/busdevice/en/latest/api.html
https://circuitpython.readthedocs.io/projects/busdevice/en/latest/index.html#bus-device-installation

Cheers,

Jon





On Thu, Dec 10, 2020 at 12:38 PM Steve Lentz <stle...@gmail.com> wrote:

> This is probably not for this forum, but perhaps you can give me some
> direction.
>
> I have a BME680 and BNO055 connected to my BBB via i2c.  I2cdetect and
> i2cdump work as expected, so I think I’m good with wiring and low level
> stuff.
>
> I want to access these sensors from a Python program.  I have carefully
> followed all of Adafruit’s instructions regarding installation of
> libraries, copying of files, etc.
>
> From the command line, I can communicate with the sensors as follows:
>
> *debian@beaglebone:/var/lib/cloud9$ python3*
> *Python 3.7.3 (default, Jul 25 2020, 13:03:44)*
> *[GCC 8.3.0] on linux*
> *Type "help", "copyright", "credits" or "license" for more information.*
> *>>> import board*
> *>>> import busio*
> *>>> import adafruit_bno055*
> *>>> i2c = busio.I2C(board.SCL,board.SDA)*
> *>>> mybno055=adafruit_bno055.BNO055_I2C(i2c)*
> *>>> mybno055.gravity*
> *(-0.11, 0.52, -0.01)*
> *>>>*
>
> When I create the following program and try to run it, I get an error
> message.
>
> *#!/usr/bin/python3*
> *#//////////////////////////////////////*
> *#*
> *# BMO055 Test*
> *# *
> *#//////////////////////////////////////*
>
> *import time*
> *import board*
> *import busio*
> *import adafruit_bno055*
> *i2c = busio.I2C(board.SCL,board.SDA)*
> *mybno055=adafruit_bno055.BNO055_I2C(i2c)*
>
> *while True:*
> *    mybno055.gravity*
> *    time.sleep(1.5)*
>
> Here is the error:
>
> *Traceback (most recent call last):*
> *  File "/var/lib/cloud9/PocketBeagle/bno055.py", line 11, in <module>*
> *    import adafruit_bno055*
> *  File
> "/home/debian/.local/lib/python3.7/site-packages/adafruit_bno055.py", line
> 37, in <module>*
> *    from adafruit_bus_device.i2c_device import I2CDevice*
> *ModuleNotFoundError: No module named 'adafruit_bus_device.i2c_device'*
>
> *Process exited with code: 1*
>
> I have checked that all the files appear to be in the cache at
> /home/debian/.local/.  Python version is set to Python3.  The Python path
> in Cloud9 points to /usr/local/lib/python3.7/dist-packages.  The included
> Python examples (blinkLED.py) do work.
>
> Clearly everything that should be needed is installed, because it works
> from the command line.  Why does this Python program fail?
>
> Any advice appreciated.
>
> Thanks,
> -Steve
>
>
> --
> For more options, visit http://beagleboard.org/discuss
> ---
> You received this message because you are subscribed to the Google Groups
> "BeagleBoard" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to beagleboard+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/beagleboard/F6DC30FF-B89E-405E-84C0-1548AC86FEA2%40gmail.com
> <https://groups.google.com/d/msgid/beagleboard/F6DC30FF-B89E-405E-84C0-1548AC86FEA2%40gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAG99bkoqBD6T8ZVcK9JEPeJH4WqV%2B262GL8SqiPpgESSP5PDqw%40mail.gmail.com.

Reply via email to