13

Can I disable the yellow (PWR?) LED on the Pi Zero?

I've tried setting the brightness to 0 of led1 (it starts life as 255) and led0 is already 0 but I still get the LED glow.

Out of interest, I only managed to set the brightness file to zero by running the following from /etc/rc.local

echo 0 > /sys/class/leds/led1/brightness

Verified after booting with the following.

$ cat /sys/class/leds/led1/brightness
0

If I try as the pi user or even via sudo, I get the following error. Even after chmod. Any ideas why?

-bash: /sys/class/leds/led0/brightness: Permission denied
4
  • 1
    It's not a power LED, the Pi Zero has one LED, the activity LED.
    – joan
    Jan 4, 2016 at 20:15
  • 1
    Makes sense, I can see ACT next to it :)
    – Toby
    Jan 4, 2016 at 20:16
  • "...If I try as the pi user or even via sudo,..." I think that is a common trap where people do not realise that the redirection (of stdout to the /sys/class/leds/led1/brigthness file) occurs before the sudo command is run so it does not get the sought for privileged elevation. There is a (somewhat funky) way around it with a tee command but I do not have the details to hand...!
    – SlySven
    Jan 5, 2016 at 16:11
  • Thanks. I'd tried bash -c 'echo 0 > ... with the same affect (it doesn't work). I can't quiet remember but I think there's a difference between true root (which will be the user for rc.local no?) and sudo. Anyway... I'd have to do some reading to remind myself :D
    – Toby
    Jan 5, 2016 at 18:06

1 Answer 1

8

Add the following to /boot/config.txt and reboot.

dtparam=act_led_trigger=none

The LED is wired with inverse logic.

Write 1 to GPIO 47 to switch it off.

Write 0 to GPIO 47 to switch it on.

3
  • 1
    Thanks, that worked (along with running echo 1 | sudo tee /sys/class/leds/led0/brightness, which I put in rc.local)
    – Toby
    Jan 4, 2016 at 20:23
  • 2
    You may get away with also adding dtparam=act_led_activelow=on to /boot/config.txt (so you don't need the rc.local script). It doesn't do what it should do but a side effect does seem to be the LED starts up off.
    – joan
    Jan 4, 2016 at 20:26
  • Even better! That works and keeps it all in one place. Thanks again.
    – Toby
    Jan 4, 2016 at 22:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.