How can I set a GPIO pin in Rock 3A?

Hi! I found this https://wiki.radxa.com/Rock3/hardware/3a/gpio, and tried the steps listed at the bottom, but trying to run echo 153 > export I get this error: -bash: export: Permission denied, and I get it even using sudo. Any ideas? Also, is there a way to do this with code? Like with Python or something?

sudo su
echo 153 > /sys/class/gpio/export

1 Like

The sudo cannot pass the permissions to I/O redirection (> <). You can use pipe and tee instead the >, like that:

echo 153 | sudo tee /sys/class/gpio/export

1 Like

Hi,l also failed at Android11 like below.

127|rk356x_rock_3a_r:/sys/class/gpio $ echo 153 > /sys/class/gpio/export
/system/bin/sh: can’t create /sys/class/gpio/export: Permission denied
1|rk356x_rock_3a_r:/sys/class/gpio $ su root
rk356x_rock_3a_r:/sys/class/gpio # echo 153 > /sys/class/gpio/export
1|rk356x_rock_3a_r:/sys/class/gpio # cd gpio153
rk356x_rock_3a_r:/sys/class/gpio/gpio153 # echo out > direction
rk356x_rock_3a_r:/sys/class/gpio/gpio153 # echo 1 > value
rk356x_rock_3a_r:/sys/class/gpio/gpio153 # echo 0 > value
GPIO4_D1 does not changed.
Any idea would be appreciated.

I Suceed control of Rockpi3A pin number 36,38,40.

1 Like