jeremie-c / orangepi.gpio Goto Github PK
View Code? Open in Web Editor NEWRPi.GPIO drop-in replacement library for Orange Pi Boards
License: MIT License
RPi.GPIO drop-in replacement library for Orange Pi Boards
License: MIT License
Hello @Jeremie-C
root@OrangepiZero:/# pip list
Package Version
------------- -------
OrangePi.GPIO 0.6.3
pip 18.0
setuptools 40.2.0
wheel 0.31.1
root@OrangepiZero:/# python
Python 2.7.15rc1 (default, Apr 15 2018, 21:51:34)
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import OPi
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named OPi
>>> import OPi.GPIO
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named OPi.GPIO
>>> import OPi.GPIO as GPIO
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named OPi.GPIO
I notice that i have only one file in the OrangePi.GPIO
folder:
root@OrangepiZero:/# ls -a /usr/local/lib/python2.7/dist-packages/OPi
. .. GPIO.so
What's wrong?
Thanks
This library does not seem to support Orange Pi 3 or Orange Pi 4 versions, which are fairly new. Does anyone know if any of the setup options works for Orange Pi 3? or if there will be support for this board any time soon?
It's a shame since both of these boards are pretty powerful and it would be nice to be able to control the GPIO pins.
After using a python module with OPi GPIO (in this case risingfalling.py) and when the program is terminated using Ctrl-C, I get the following error when I try to run it again:
user@pizero2:~/example$ sudo python risingfalling.py
Traceback (most recent call last):
File "risingfalling.py", line 14, in
GPIO.setup(23, GPIO.IN) # set GPIO25 as input (button)
ValueError: This channel is already in use by system as SEE_MANUAL.
fatal error: Python.h: No such file or directory
#include "Python.h"
^~~~~~~~~~
compilation terminated.
error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
I use Orange Pi Pc with Armbian Bionic (mainline based kernel 5.3.y)
Thank you for useful tool.
Pin#11 and Pin#13 of orangepi_zero_plus2_H3 don't work.
This address doesn't continue.
import OPi.GPIO as GPIO
from time import sleep # this lets us have a time delay
pin = 11
GPIO.setboard(GPIO.ZEROPLUS2H3) # Orange Pi ZERO Plus H3 board
GPIO.setmode(GPIO.BOARD) # set up BOARD BCM numbering
GPIO.setup(pin, GPIO.OUT) # set BCM7 (pin 26) as an output (LED)
try:
print ("Press CTRL+C to exit")
while True:
GPIO.output(pin, 1) # set port/pin value to 1/HIGH/True
sleep(0.1)
GPIO.output(pin, 0) # set port/pin value to 0/LOW/False
sleep(0.1)
GPIO.output(pin, 1) # set port/pin value to 1/HIGH/True
sleep(0.1)
GPIO.output(pin, 0) # set port/pin value to 0/LOW/False
sleep(0.1)
sleep(0.5)
except KeyboardInterrupt:
GPIO.output(pin, 0) # set port/pin value to 0/LOW/False
GPIO.cleanup() # Clean GPIO
print ("Bye.")
Thank you for nice tool!!
There is Type mistake in README.md.
cd /OrangePi.GPIO ---> cd OrangePi.GPIO
I have encountered a problem when using
GPIO.add_event_detect(channel)
on an orangepi zero
As soon as i use this function, the GPIO.input(channel) is random and static
The interrupt is working, but i cannot read the input any longer with the actual value, instead i get a constant 0 or a constant 1, but this seems to endependent of the input-state.
The PullUp is still active and even the Pin is no output - i just get no actual value.
If i skip the add_event_detect i can read the actual value of the pin.
when add_event_detect is not used, there is no entry for this gpio in /sys/class/gpio
when add_event_detect is used, there is an entry for this gpio in /sys/class/gpio and value shows the correct pin state - so low driver seems to work...
when add_event_detect is used, a "gpio readall" on a second terminal gives the correct value
linux is the latest armbian-ubuntu image Armbian_5.69_Orangepizero_Ubuntu_bionic_next_4.19.13.img
pip list shows i have OPi.GPIO 0.3.6
I can't choose the board name
GPIO.setboard(GPIO.PC&PCPLUS)
GPIO.setboard(GPIO.ONE)
GPIO.setboard(GPIO.LITE)
An error message appears:
AttributeError: module 'OPi.GPIO' has no attribute 'ONE'
Thank you !
I'm working on OPi Lite 2 (H6, 64-bit based) board and trying to port this code into H6 env. However, no luck so far. I've modified the base addresses to match H6. However, cannot get the designated GPIO pin to work. I tried reading back the port control register, but always got 0x0 value, even the default value, according to the DS, should be 0x7777_7777 or any non-zero value. I'm wondering if this has to do with the 32-bit addressing vs 64-bit. Can anyone point me how to proceed? Really appreciated!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.