Permission denied for /sys/class/gpio
I'm using Emteria on a Raspberry Pi 4 B and I need to modify the state of a GPIO pin. To do that, I'm using sysf and also following the steps on https://emteria.com/kb/device-configuration-style-initd-scripts in Termux. However, I always get the Permission denied error when trying to include a script inside /data/init.d and when trying to run the echo 17 > /sys/class/gpio/export
command inside Termux.
I already tried using sudo
commands and other methods to access as root like going through the folder in file manager apps, but none of them worked so far. Is there anyway I can get root access to modify the files and folders I mentioned inside Termux? Or is there something else I can do access the GPIO pin?
Comments
Hi @sophia_celine
Maybe you can try to do it with sushell, as sudo isn't available, but I've never used Termux to set this up. Have you tried to create an init script and move it to /data/init.d/?
Hey @smieschek, thanks for the reply! I managed to get root permissions using adb. I run
adb shell
and thensushell
, which lets me change the gpio files.