Jump to content

Python 3 gpiod module error


pochin2208

Recommended Posts

Hi, I've been trying to get the next IMU sensor to work:  Fusion_IMU_BNO055, on my OPi zero with Armbian Bionic 20.08.10 with the linux kernel 5.8.14-sunxi. I have installed everything from the official Adafruit guide but I still get the same error.

 

I have followed all the steps of this guide for beginners: OPi_r1_guide, executing all the commands successfully.  However, I still have the same error in Python that is related to the "board" module. 

 

root@orangepizero:/home/Test# python
Python 3.6.9 (default, Oct  8 2020, 12:12:24)
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import board
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/board.py", line 82, in <module>
    from adafruit_blinka.board.orangepi.orangepizero import *
  File "/usr/local/lib/python3.6/dist-packages/adafruit_blinka/board/orangepi/orangepizero.py", line 5, in <module>
    from adafruit_blinka.microcontroller.allwinner.h3 import pin
  File "/usr/local/lib/python3.6/dist-packages/adafruit_blinka/microcontroller/allwinner/h3/pin.py", line 4, in <module>
    PA0 = Pin(0)
  File "/usr/local/lib/python3.6/dist-packages/adafruit_blinka/microcontroller/generic_linux/libgpiod_pin.py", line 34, in __init__
    self._chip = gpiod.Chip("gpiochip0", gpiod.Chip.OPEN_BY_NAME)
AttributeError: module 'gpiod' has no attribute 'Chip'
>>> exit()

 

The python code that I try to execute is the following:

 

import board
import digitalio
import busio

print("Hello blinka!")

# Try to great a Digital input
pin = digitalio.DigitalInOut(board.PA6)
print("Digital IO ok!")

# Try to create an I2C device
i2c = busio.I2C(board.SCL, board.SDA)
print("I2C ok!")

# Try to create an SPI device
spi = busio.SPI(board.SCLK, board.MOSI, board.MISO)
print("SPI ok!")

print("done!")

 

If you need more details I will gladly give them to you. Thank you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines