Power & Source of Big Ideas

Configuring GPIO pin mapping for libgpiod

Moderators: chensy, FATechsupport

Hi


I installed a bare minimal Debian 11 (Bullseye) distribution on a Nano Pi M1 single board computer. I would like to use it to control external devices using its GPIO pins. I was not able to find a suitable port of Python packages such RPi.GPIO for this purpose. Besides I understand the current best practice for controlling gpio pins is to use libgpiod. The gpio device is detected by the kernel as shown below

Code: Select all

$ sudo gpiodetect 
gpiochip0 [1c20800.pinctrl] (224 lines)
gpiochip1 [1f02c00.pinctrl] (32 lines)


However the pins are not named and so it is not obvious how the libgpiod pin numbers map to pins on the Nano Pi M1 board as shown below

Code: Select all


$ sudo gpioinfo gpiochip0
gpiochip0 - 224 lines:
   line   0:      unnamed       unused   input  active-high
   line   1:      unnamed       unused   input  active-high
   line   2:      unnamed       unused   input  active-high
   line   3:      unnamed       unused   input  active-high
   line   4:      unnamed       unused   input  active-high
   line   5:      unnamed       unused   input  active-high
   line   6:      unnamed       unused   input  active-high
   line   7:      unnamed       unused   input  active-high
   line   8:      unnamed       unused   input  active-high
   line   9:      unnamed       unused   input  active-high
   line  10:      unnamed "nanopi:blue:status" output active-high [used]


How do I find out what libgpiod pin numbers map to what pins on the Nano Pi M1 board ?

Is there any way to set names for these pins ?

Thanks
I'm encountering the same problem - don't know how to map lines to actual GPIO pins on the Nano Pi. Does anyone have any info on this?

Who is online

In total there are 6 users online :: 0 registered, 0 hidden and 6 guests (based on users active over the past 5 minutes)
Most users ever online was 13606 on Thu Mar 26, 2026 3:27 pm

Users browsing this forum: No registered users and 6 guests