Git Product home page Git Product logo

npi.gpio's People

Contributors

chainsx avatar tungsteno74 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

npi.gpio's Issues

Support for NanoPi Duo2

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.

Can't install on Dietpi for NanoPi M2A

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

Nanopi duo2 error

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?

Support for DietPi running on NanoPi's

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.

GPIO.input read the same value after implementing add_event_detect

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)
`

NanoPi_NEO_Core support

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!

Add support for "python setup.py install" without sudo

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.

some fixes

  • add version attribute string to __init__.py as semi-standard way.
  • add alternative to access gpio memory by /dev/gpiomem instead of /dev/mem. (but armbian seem to not have gpiomem file)
  • move log error showed at wrong time when try to open boards information file (/sys/class/sunxi_info/sys_info /etc/friendlyelec-release /etc/armbian-release).
  • add link to NPi.GPIO PYPi module in the readme file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.