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.

Simple blinky not working out of the box for Orange pi zero 2W

Featured Replies

I installed Armbian_community_26.2.0-trunk.130_Orangepizero2w_trixie_current_6.12.63_minimal and tried to follow the instructions on gpiod · PyPI.

 

GPIO are not enabled in device tree.

You have to allocate the I/O pins you want to use and how you want to use them yourself, can be done in armbianEnv.txt. 

 

A generic image cannot know what you want and what is connected to which I/O pins.

 

GPIO is not like USB or PCIe that is can be automatically let its connected hardware enumerate.

 

Also old Linux behavior w.r.t. GPIO is gone. You fundamentally need to open it, keep it operational with handle, in your code. Like you open a file when you want to read or write.

Python might do that for you, but for C-code maybe look at lgio.

 

So maybe tell first what you want to achieve, is it a temperature sensor maybe, or control a MOSFET or relay, etc.

  • Author

Thank you eselarm for the reply.

 

If it is possible to get simple SOP for running blinky program on any of the gpio of orange pi zero 2w in python, I can take it forward.

 

I am trying to operate relays using orange pi zero 2w.

Edited by vtech

OrangePi in general is bad support, as also is stated on the image download page. For just driving a relay, so a pin change between high and low, you first need to select which pin from the GPIO header you want to use. 

You can see what are probably generic GPIO by default from picture here:

http://www.orangepi.org/html/hardWare/computerAndMicrocontrollers/details/Orange-Pi-Zero-2W.html

 

In the latest image, I see there is no real support for OrangePi02W, only H5 and A64, not the actual H618 (it seems to use H616, so also that might lead to issues). 

You can look in file maybe, if you want other then defaults:  /boot/dtb/allwinner/overlay/README.sun50i-H5-overlays

I have older 32-bit Allwinner things, H3 for example. Analog and SPDIF audio works great there, that is why I bought those mainly. Also GPIO6 I use for driving a switch (via extra resistors and some MOSFET/TRIAC).

I did some C-code and got working temp sensor and switch, see lgio code https://abyz.me.uk/lg/download.html

 

But currently for years already in bash script:

 

init:

           test -f /sys/class/gpio/gpio6/value && echo 6 > /sys/class/gpio/unexport
           echo 6 > /sys/class/gpio/export
           echo out > /sys/class/gpio/gpio6/direction
           chown root:gpio /sys/class/gpio/gpio6/value
           chmod g+w /sys/class/gpio/gpio6/value

on:

       gpioset gpiochip0 6=1

off:

       gpioset gpiochip0 6=0



This still works since Armbian Buster, now kernel 6.12. Not tested yet with 6.18

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.