tungsteno74 / npi.gpio Goto Github PK
View Code? Open in Web Editor NEWRPi.GPIO for nanopi (NPi.GPIO)
License: GNU General Public License v2.0
RPi.GPIO for nanopi (NPi.GPIO)
License: GNU General Public License v2.0
You are the only person I have found that took the time to make this work with Python3.
Unfortunatly, the NanoPi Duo2 was not included.
If you don't have the time to add it, that is ok, but would you be able to tell me then what files I would need to change and what to add to make that happen.
Sorry to bother you, but thank you for the time.
Hi there,
I have a NanoPi M2, I installed OS is DietPi. I cannot install "NPi.GPIO". I read that "NPi.GPIO" can only be installed on armbian? Is there a way to install it anyway?
Jurgen
pi@NanoPi-Duo2:~$ sudo python3 npi_gpio_1.py Traceback (most recent call last):
File "npi_gpio.py", line 1, in
import NPi.GPIO as GPIO
File "/usr/local/lib/python3.5/dist-packages/NPi.GPIO-0.5.8.6-py3.5-linux-armv7l.egg/NPi/GPIO/init.py", line 1, in
from NPi._GPIO import *
RuntimeError: Is not NanoPi based board.
how to fix?
cpuinfo
implementation and remove deprecated revision
attribute.This works, but the workaround is kinda sketchy.
The workaround i am using is dropping the /etc/armbian-release file from armbian onto DietPi.
I think this is not really a good solution.
The resource footprint of DietPi is way less than armbian.
Hi there,
If I simply read the input, it returns correct pin status. If I implement add_event_detect, GPIO.input always return the same value no matter in the event callback or other place in the code. Meanwhile, I also check /sys/class/gpio/ and found that the gpio value is correct. My system is NanoPi Neo Core with official ROM released at 2021/04/25. I test my test code on Raspberry Pi 3B. There is no problem at all.
`
def btnPrint(pin):
time.sleep(0.1)
print("Press1:",GPIO.input(pin))
time.sleep(0.1)
print("Press2:",GPIO.input(pin))
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)
GPIO.setup(62, GPIO.IN)
GPIO.add_event_detect(62, GPIO.RISING, callback=btnPrint, bouncetime=1000)
while 1:
print("main status 1:",GPIO.input(62))
time.sleep(5)
print("main status 2:",GPIO.input(62))
time.sleep(5)
`
Why there's exlicity no NanoPi NEO Core support?
It presumably is the same as NanoPi NEO & AIR, simply with bare headers
In the NEO Core variant, the ethernet and USB A connectors are replaced with unpopulated headers.
And from FriendlyARM own description:
It has the same form factor as the NanoPi NEO and same pin descriptions.
root@NanoPi-NEO-Core:~# uname -a
Linux NanoPi-NEO-Core 4.14.111 #64 SMP Mon May 20 15:32:02 CST 2019 armv7l armv7l armv7l GNU/Linux
Thanks!
sudo python setup.py install
is working but without sudo
I get missing permissions.
Running it with sudo will work on regular desktop but when I do the same inside snap that I am creating (.py file use NPI.GPIO as GPIO
) I get an error
Traceback (most recent call last): File "/snap/mainb/x24/on.py", line 3, in <module> import NPi.GPIO as GPIO ImportError: No module named 'NPi'
And the same when using implementing RPi.GPIO as GPIO
(Can't recreate error, my snapcraft crashing now lol)
I managed to recreate this in RPi.GPIO.NP just with the sudo python setup.py install
and not bouth python setup.py install
and sudo python setup.py install
as they asked.
Please be attention that you need use both python and sudo python to make the RPi.GPIO_NP work well.
In the Installation part
cd /NPi.GPI
need to be changed to
cd NPi.GPI
__init__.py
as semi-standard way./dev/mem
. (but armbian seem to not have gpiomem file)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.