Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

I can't access gpio pins on Nanopi Fire 3 and Smart6818.

Featured Replies

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.

  • Author

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.

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.

  • Author

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?

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.