Hi,
i’m using RockPiS (hardware v12) and i can control GPIOs on PinHeader 1 without problems using libmraa. Works great.
But i can’t control GPIOs, e.g. GPIO 77 up to 80 (pin 2,4,6,8 on PinHeader 2). I need these GPIOs, too. Can you help?
Many Thanks.
How to control GPIOs on Pin-Header 2?
Currently it is not available to control GPIOs on 26-pin Header 2 by using libmraa.
Okay. I understand.
And when i try to use the filesystem like …
cd /sys/class/gpio
sudo echo 78 > export
cd gpio78
sudo chmod 666 /sys/class/gpio/gpio78/direction
sudo echo out > direction
sudo chmod 666 /sys/class/gpio/gpio78/value
sudo echo 1 > value # output high
sudo echo 0 > value # output low
… it has no effect on the Pin4 at Header2, too.
Is there no chance to use GPIOs from Header2?
Thank you.
You can try this. At first, change to superuser, and then use command echo
to set direction and value.
For example,
$ sudo su
# echo 78 > /sys/class/gpio/export
# echo out > /sys/class/gpio/gpio78/direction
# echo 1 > /sys/class/gpio/gpio78/value
# echo 0 > /sys/class/gpio/gpio78/value
the best solution is to use a port-expander (i use a SX1509 with I²C).
That’s working great.
mraa Gpio() function has a raw parameter. If you use raw=True than you can address any GPIO, even on Header2.
Got same problem. on PinHeader 2 only work 72(GPIO2_B0) and 80(GPIO2_C0) gpio, other 75,76,77,78,79 not working. I try thru libmraa RAW, SYSFS/CLASS/GPIO, no chance.
Think, some thing in kernel, but chek all rock-p-s dts tree and found no problem. remove support wifi,bluetooth,sound,i2s0_8ch,pdm from dts tree in kernell but same problem. Mb pcb problem ?
Last try … dev/mem
dev/mem no way,
wrote simple kernel driver to test and debug gpios.
not linux kernell driver problem at all.
problem in rk3308 firmware.
rk3308 manual
I`m so sorry, my folt.
All work fine.
Finally found my pcb error (easy eda component rock pi s pinheader2 180 degree, do not use it).
I thik that man who draw component in esasy eda open this post :))