Aditya Posted November 20, 2019 Share Posted November 20, 2019 Hi ! I am running deb stretch server on OPi Zero LTS. To control LEDs I tried to follow this thread https://forum.armbian.com/topic/6306-orange-pi-zero-h2-status-led/ So if I edit the file /sys/class/leds/orangepi:green:pwr/trigger to select "cpu" but I get the following opi@orangepizero:/$ sudo echo "power" > /sys/class/leds/orangepi:green:pwr/trigger -bash: /sys/class/leds/orangepi:green:pwr/trigger: Permission denied With root as user, this is what I get root@orangepizero:/# echo "power" > /sys/class/leds/orangepi:green:pwr/trigger bash: echo: write error: Invalid argument however, if I edit the file using nano and delete all contents and then type cpu then it gets saved and green led shows intended status. Whats the standard procedure to do this?? Link to comment Share on other sites More sharing options...
martinayotte Posted November 20, 2019 Share Posted November 20, 2019 1 hour ago, Aditya said: Whats the standard procedure to do this?? When using "sudo", it only affect the left part, here "echo", everything at right of ">" isn't "sudo" applied ... So, if you wish to use "sudo", syntax would be : echo "default-on" | sudo tee /sys/class/leds/orangepi:green:pwr/trigger Note here : "power" is not an available choice, do "cat /sys/class/leds/orangepi:green:pwr/trigger", it will show you all possible choices and the current setting is indicated with brackets. The choice you probably wish is "default-on". 2 Link to comment Share on other sites More sharing options...
Aditya Posted November 20, 2019 Author Share Posted November 20, 2019 Thanks a lot. It works fine. It asked for a password when I entered the command like you just told, so how to use this command in rc.local or how to execute it at boot?? Edit: Simply added the line to /etc/rc.local Thanks again btw Link to comment Share on other sites More sharing options...
Recommended Posts