Andy West Posted May 14, 2018 Posted May 14, 2018 I'm using the Orange Pi Zero Plus for a WiFi radio application and need to operate some LED's / Pots etc Ive previously used an Orange Pi Zero (Regular) and had no problem using pyA20 library or wiringpi With the Pi Zero Plus, using pyA20 gives me this error for any port: AttributeError: module 'pyA20.gpio.port' has no attribute 'PA0' or using wiringpi (gpio readall) gives me: Oops: Unable to determine board revision from /proc/cpuinfo -> No "Hardware" line -> You'd best google the error to find out why. Any suggestions appreciated, Thanks Andy
chwe Posted May 14, 2018 Posted May 14, 2018 6 minutes ago, Andy West said: Ive previously used an Orange Pi Zero (Regular) and had no problem using pyA20 library pin definition must match, otherwise errors are expected... In case you want to stick to pyA20 you can write a proper mapping for pyGPIO (pyA20 but with multiple boards supported). I never tried it with a H5 board, so I can't say if this will work. https://github.com/chwe17/pyGPIO/blob/master/pyGPIO/gpio/mapping/template24.h or you switch to ArmbianIO from @Larry Bank (https://github.com/bitbank2/ArmbianIO) but I don't know if he supports the Zero Plus, or you give @sgjavas UserSpaceIO a try https://github.com/sgjava/userspaceio. But I don't know if and how well your board is supported by them.
Andy West Posted May 14, 2018 Author Posted May 14, 2018 Thanks for the reply, I origionally stayed away from armbianIO as I was unable to switch between input and output during the running of my python program
Andy West Posted May 14, 2018 Author Posted May 14, 2018 Just managed to find this with an updated mapping for H5 https://github.com/herzig/orangepi_PC_gpio_pyH5
sgjava Posted May 14, 2018 Posted May 14, 2018 User Space IO uses libgpiod for GPIO stuff and is built from source. The mapping is a bit different than sysfs (the old way of doing GPIO), but pretty straight forward. Each GPIO chip starts at pin 0. It should work with any mainline kernel that supports user space mapping of GPIO, SPI, I2C, PWM and MMIO.
chwe Posted May 14, 2018 Posted May 14, 2018 7 hours ago, Andy West said: Just managed to find this with an updated mapping for H5 https://github.com/herzig/orangepi_PC_gpio_pyH5 I think it wouldn't be much effort to implement it into pyGPIO but since I don't have any H5 board, I did this once for a board I didn't own, and if something goes wrong it's a nightmare in case no boardowner is able and willing to debug it. That's why pyGPIO doesn't get that much attention at the moment. ArmbianIO is for sure more maintained than pyGPIO, and I might have a look into UserspaceIO soon.
Recommended Posts