vtech Posted December 27, 2025 Posted December 27, 2025 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. 0 Quote
eselarm Posted December 27, 2025 Posted December 27, 2025 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. 0 Quote
vtech Posted December 27, 2025 Author Posted December 27, 2025 (edited) 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 December 27, 2025 by vtech 0 Quote
eselarm Posted December 28, 2025 Posted December 28, 2025 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 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.