frkn Posted October 5, 2021 Posted October 5, 2021 Armbianmonitor: http://ix.io/3ATW Hello everone. I'm new to embedded linux. To start with, I have nanopi fire 3 and smart 6818 cards, but I cannot access gpio pins with any gpio library. Why doesn't the NPi-GPIO library work with these cards? At first I was using the lubuntu version, I tried a lot there, but I couldn't. Now I'm trying to do something using armbian version 21.04. I'll post the problem I'm facing below. Thank you in advance for your help. Traceback (most recent call last): File "npigpio.py", line 1, in import NPi.GPIO as GPIO File "/usr/local/lib/python3.7/dist-packages/NPi.GPIO-0.5.8.6-py3.7-linux-aarch64.egg/NPi/GPIO/init.py", line 1, in from NPi._GPIO import * RuntimeError: Is not NanoPi based board. 0 Quote
frkn Posted October 5, 2021 Author Posted October 5, 2021 Also, when I connect the LED to 5V and GND on my fire 3 card, it does not work, but when I connect it to the power inputs and outputs on the uart part, the LED lights up. 0 Quote
tparys Posted October 6, 2021 Posted October 6, 2021 Not familiar with the Npi-GPIO package. However ... Standard newer way to access GPIO pins is with gpiod package: gpiodetect gpiofind gpioget gpioinfo gpiomon gpioset Standard older way is to use /sys/class/gpio interface to export pins and then read/write them. This has been deprecated as it requires either root access or custom udev rules to set ownership so normal users can access them. GPIO pin numbers are also subject to change between kernel versions. But documentation on this interface is far more common online, and still works fine. Also, questions regarding Smart6818 should go in Peer-to-Peer support as is not a supported board. 0 Quote
frkn Posted October 6, 2021 Author Posted October 6, 2021 Thank you for your answer. So, does this method have any differences compared to pigpio or npi-gpio? So like the speed of accessing the pins. Because when I did an experiment on the led, I was able to get a maximum 125 Hz square signal from a normal gpio output. Also, is there another library or method you can recommend? I would like to learn to research them too. Is it a difficult step to make it compatible by editing npi-gpio or another library? 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.