auto3000 / rpi.gpio_np Goto Github PK
View Code? Open in Web Editor NEWA Python module to control the GPIO on a NanoPi
License: MIT License
A Python module to control the GPIO on a NanoPi
License: MIT License
Hi!
im triying to install the library but i have this error
/usr/include/python3.9/ceval.h:130:37: note: declared here 130 | Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); | ^~~~~~~~~~~~~~~~~~ arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-9BkwDf/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-9BkwDf/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.9 -c source/py_pwm.c -o build/temp.linux-armv7l-3.9/source/py_pwm.o arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-9BkwDf/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-9BkwDf/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.9 -c source/soft_pwm.c -o build/temp.linux-armv7l-3.9/source/soft_pwm.o arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-9BkwDf/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.9/source/c_gpio.o build/temp.linux-armv7l-3.9/source/common.o build/temp.linux-armv7l-3.9/source/constants.o build/temp.linux-armv7l-3.9/source/cpuinfo.o build/temp.linux-armv7l-3.9/source/event_gpio.o build/temp.linux-armv7l-3.9/source/py_gpio.o build/temp.linux-armv7l-3.9/source/py_pwm.o build/temp.linux-armv7l-3.9/source/soft_pwm.o -o build/lib.linux-armv7l-3.9/RPi/_GPIO.cpython-39-arm-linux-gnueabihf.so /usr/bin/ld: build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/common.h:42: multiple definition of
module_setup'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:42: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/common.h:41: multiple definition of setup_error'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:41: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/common.h:40: multiple definition of
rpiinfo'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:40: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/common.h:39: multiple definition of gpio_direction'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:39: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/common.h:38: multiple definition of
pin_to_gpio'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:38: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/common.h:37: multiple definition of pin_to_gpio_nanopi'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:37: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/common.h:36: multiple definition of
pin_to_gpio_rev3'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:36: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/common.h:35: multiple definition of pin_to_gpio_rev2'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:35: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/common.h:34: multiple definition of
pin_to_gpio_rev1'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:34: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/common.h:33: multiple definition of gpio_mode'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:33: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/common.h:33: multiple definition of
gpio_mode'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:33: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/common.h:41: multiple definition of setup_error'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:41: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/common.h:40: multiple definition of
rpiinfo'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:40: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/common.h:39: multiple definition of gpio_direction'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:39: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/common.h:42: multiple definition of
module_setup'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:42: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/common.h:38: multiple definition of pin_to_gpio'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:38: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/common.h:37: multiple definition of
pin_to_gpio_nanopi'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:37: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/common.h:36: multiple definition of pin_to_gpio_rev3'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:36: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/common.h:35: multiple definition of
pin_to_gpio_rev2'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:35: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/common.h:34: multiple definition of pin_to_gpio_rev1'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:34: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:42: multiple definition of
both_edge'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:42: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:41: multiple definition of falling_edge'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:41: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:40: multiple definition of
rising_edge'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:40: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:39: multiple definition of pud_down'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:39: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:38: multiple definition of
pud_up'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:38: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:37: multiple definition of pud_off'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:37: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:36: multiple definition of
bcm'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:36: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:35: multiple definition of board'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:35: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:34: multiple definition of
unknown'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:34: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:33: multiple definition of spi'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:33: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:32: multiple definition of
i2c'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:32: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:31: multiple definition of serial'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:31: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:30: multiple definition of
pwm'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:30: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:29: multiple definition of output'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:29: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:28: multiple definition of
input'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:28: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:27: multiple definition of low'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:27: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/constants.h:26: multiple definition of
high'; build/temp.linux-armv7l-3.9/source/constants.o:/root/gits/RPi.GPIO_NP/source/constants.h:26: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_pwm.o:/root/gits/RPi.GPIO_NP/source/common.h:39: multiple definition of gpio_direction'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:39: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_pwm.o:/root/gits/RPi.GPIO_NP/source/py_pwm.h:23: multiple definition of
PWMType'; build/temp.linux-armv7l-3.9/source/py_gpio.o:/root/gits/RPi.GPIO_NP/source/py_pwm.h:23: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_pwm.o:/root/gits/RPi.GPIO_NP/source/common.h:42: multiple definition of module_setup'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:42: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_pwm.o:/root/gits/RPi.GPIO_NP/source/common.h:41: multiple definition of
setup_error'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:41: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_pwm.o:/root/gits/RPi.GPIO_NP/source/common.h:40: multiple definition of rpiinfo'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:40: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_pwm.o:/root/gits/RPi.GPIO_NP/source/common.h:38: multiple definition of
pin_to_gpio'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:38: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_pwm.o:/root/gits/RPi.GPIO_NP/source/common.h:37: multiple definition of pin_to_gpio_nanopi'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:37: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_pwm.o:/root/gits/RPi.GPIO_NP/source/common.h:36: multiple definition of
pin_to_gpio_rev3'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:36: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_pwm.o:/root/gits/RPi.GPIO_NP/source/common.h:35: multiple definition of pin_to_gpio_rev2'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:35: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_pwm.o:/root/gits/RPi.GPIO_NP/source/common.h:34: multiple definition of
pin_to_gpio_rev1'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:34: first defined here
/usr/bin/ld: build/temp.linux-armv7l-3.9/source/py_pwm.o:/root/gits/RPi.GPIO_NP/source/common.h:33: multiple definition of gpio_mode'; build/temp.linux-armv7l-3.9/source/common.o:/root/gits/RPi.GPIO_NP/source/common.h:33: first defined here /usr/bin/ld: build/temp.linux-armv7l-3.9/source/soft_pwm.o:/root/gits/RPi.GPIO_NP/source/soft_pwm.c:28: multiple definition of
threads'; build/temp.linux-armv7l-3.9/source/event_gpio.o:/root/gits/RPi.GPIO_NP/source/event_gpio.c:48: first defined here
collect2: error: ld returned 1 exit status
error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1`
Any idea?
Thanks!
I have installed following standard image on my NanoPi Neo 1.2
http://www.mediafire.com/file/g4wwv8u4gl94t4l/nanopi-neo_ubuntu-core-xenial_4.11.2_20170705.img.zip
Output and GPIO.input are ok. But neither GPIO.add_event_detect nor GPIO.wait_for_edge is working. No event is triggered by any input.
After installation by 'python setup.py install' and using 'import RPi.GPIO' , it threw an error.
`
import RPi.GPIO
Traceback (most recent call last):
File "", line 1, in
File "/root/RPi.GPIO_NP/RPi/GPIO/init.py", line 23, in
from RPi._GPIO import *
ModuleNotFoundError: No module named 'RPi._GPIO'
import RPi._GPIO
Traceback (most recent call last):
File "", line 1, in
ModuleNotFoundError: No module named 'RPi._GPIO'
`
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.