4

I need to disable all LEDs on my Raspberry Pi 3s otherwise they interfere with the operation of my camera setup. I use Raspbian Jessie.

I can successfully use the following code:

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

Both LED go dark - I am happy. However, if I put these commands in rc.local or in a script called by rc.local, most of the times (but not always) one of those LEDs (in particular the red one) will not turn off. If I ssh into the Pi and repeat the command it will correctly turn off.

When the LED is not turned off, the brightness value contains 255:

# cat /sys/class/leds/led1/brightness
255

like if some other program sets it back up after rc.local is executed.

I have also tried to add:

echo none >/sys/class/leds/led0/trigger
echo none >/sys/class/leds/led1/trigger

But it did not have any effect.

What entity/program might interfere with LED brightness at boot time?

Also note: I have tried to add a 5 to 15 seconds delay to the execution in rc.local but the problem did not disappear, in fact I did not see any difference

  • Have you considered the low tech approach - piece of tape over the LEDs? – Steve Robillard Aug 1 '17 at 22:04
  • No. The units I have deployed are thousands of km away, installed in stainless steel boxes at the top of mountains - it's expensive to get physical access. There is a 100% software solution that works very well, I only have a problem applying it automatically at boot. – Alessio Sangalli Aug 2 '17 at 7:35
  • @SteveRobillard Disabling them should also mean power savings. Just a tiny amount, but savings nonetheless. – Gene Aug 2 '17 at 8:02
  • True; I value the power savings in form of less heat generated by the system. – Alessio Sangalli Aug 2 '17 at 18:20
9

For the Raspberry Pi 2 you can add the following lines to /etc/rc.local:

sudo sh -c 'echo none > /sys/class/leds/led0/trigger'
sudo sh -c 'echo none > /sys/class/leds/led1/trigger'
sudo sh -c 'echo 0 > /sys/class/leds/led0/brightness'
sudo sh -c 'echo 0 > /sys/class/leds/led1/brightness'

Maybe it works for RPi3 too?

  • This worked for me too. An FYI though, the lights still come for roughly 30 seconds at boot. This is fine by me though. – Ben Mar 9 '18 at 15:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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