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.

GPIO libraries for the Banana Pi / Banana Pro (A20) fixed for current Armbian, with .deb packages

Featured Replies

Hi all,

I fixed the old LeMaker GPIO libraries so they work again on current Armbian (Debian 13 trixie, mainline kernel 6.18), and I built ready .deb packages for armhf. They were written for the old sunxi 3.4 kernel and had not been updated since 2016-2019.

What's included:

  • WiringBP (WiringPi for C, with gpio readall): kernel GPIO numbers for sysfs and interrupts, I2C bus detection, and PWM no longer switches off the LCD backlight.

  • LMK.GPIO (RPi.GPIO for Python): works with Python 3.13, with board detection, edge events and callbacks fixed.

  • lg (lgpio/rgpio by joan2937, the successor of pigpio, which can't run on the A20): one fix for alerts on GPIO numbers above 255. Most header pins on these boards are in bank PI (256 and up), so Python callbacks on them never ran.

Packages (Debian 13 armhf): wiringbp, python3-lmk-gpio, lgpio, python3-lgpio

cd /tmp
wget https://github.com/cyryllo/banana-a20/raw/master/gpio/pakiety/dist/wiringbp_2.0-1_armhf.deb
wget https://github.com/cyryllo/banana-a20/raw/master/gpio/pakiety/dist/python3-lmk-gpio_0.0.1-1_armhf.deb
wget https://github.com/cyryllo/banana-a20/raw/master/gpio/pakiety/dist/lgpio_0.2.2-1_armhf.deb
wget https://github.com/cyryllo/banana-a20/raw/master/gpio/pakiety/dist/python3-lgpio_0.2.2-1_armhf.deb
sudo apt install ./wiringbp_2.0-1_armhf.deb ./python3-lmk-gpio_0.0.1-1_armhf.deb ./lgpio_0.2.2-1_armhf.deb ./python3-lgpio_0.2.2-1_armhf.deb

Documentation with a pinout, examples (C, Python, libgpiod) and the list of changes: https://github.com/cyryllo/banana-a20/blob/master/gpio/README.md

Boards:

  • Banana Pro: everything was tested on my board.

  • Banana Pi M1 (the original Banana Pi) and M1+: the packages install and lg and libgpiod work, because they use kernel GPIO numbers. WiringBP and LMK.GPIO only know the Banana Pro header. On the M1/M1+ pins 7, 8, 10 and 12 (and 29-40 on the M1+) are wired to different SoC pins, so use those two libraries only on the pins that match, or use lg/libgpiod there. The details are in the README. If someone with an M1 or M1+ can test, I'm happy to add proper support for those headers.

If something doesn't work, write here or open an issue on GitHub: https://github.com/cyryllo/banana-a20/issues

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.

Guest
Reply to this topic...

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.