1

I see there are quite a few posts about this already but none seem to work for me.

I am running a pihole server on my RPi 3 and I would like to turn off the external power and LAN LEDs (green and orange) as they can be quite bright at night. I am running a Raspberry Pi 3 Model B Rev 1.2

I know it is possible to do as I managed to achieve this once before but it was a few years ago and I can't remember the steps I took. Also not sure if anything changed in the later versions of Raspbian.

I have tried methods mentioned in this thread: https://www.raspberrypi.org/forums/viewtopic.php?t=149126 as well as https://www.jeffgeerling.com/blogs/jeff-geerling/controlling-pwr-act-leds-raspberry-pi and Turning off LEDs on Raspberry Pi 3 and quite a few others but nothing seems to work for me.

One of the methods /boot/config.txt

# Disable Ethernet LEDs
dtparam=eth_led0=14
dtparam=eth_led1=14

# Disable the PWR LED
dtparam=pwr_led_trigger=none
dtparam=pwr_led_activelow=off

# Disable the Activity LED
dtparam=act_led_trigger=none
dtparam=act_led_activelow=off

Has anyone achieved this on a Pi 3 Model B and could share the method?

EDIT

$ cat /sys/class/leds/led0/trigger
[none] rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight gpio cpu cpu0 cpu1 cpu2 cpu3 default-on input panic actpwr mmc1 mmc0 rfkill-any rfkill-none rfkill0 rfkill1
  • 1
    I know it's not helping, but overlay LED settings do work on a Pi 4. Do you have anything in /sys/class/leds? – Dmitry Grigoryev Oct 15 at 14:28
  • 1
    Are you using a 3 or 3B+? The documentation states "N.B. For Pi 3B, 3B+, 3A+ and 4B, use the act-led overlay" – Milliways Oct 15 at 23:11
  • @DmitryGrigoryev the following is in /sys/class/leds default-on led0 led1 mmc0 @Milliways it is a 3B – GiarcTNA Oct 16 at 12:47
3

You control the green activity led with /sys/class/leds/led0/trigger and the red power led with /sys/class/leds/led1/trigger. First look at its standard settings with:

rpi ~$ cat /sys/class/leds/led0/trigger
none rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight gpio cpu cpu0 cpu1 cpu2 cpu3 default-on input panic actpwr [mmc0]

rpi ~$ cat /sys/class/leds/led1/trigger
none rc-feedback kbd-scrolllock kbd-numlock kbd-capslock kbd-kanalock kbd-shiftlock kbd-altgrlock kbd-ctrllock kbd-altlock kbd-shiftllock kbd-shiftrlock kbd-ctrlllock kbd-ctrlrlock timer oneshot heartbeat backlight gpio cpu cpu0 cpu1 cpu2 cpu3 default-on [input] panic actpwr mmc0

The settings within square brackets are set on boot up: [mmc0] for the green activity led and [input] for the red power led on my Raspberry Pi 3B. Don't forget them if you want to reset to these trigger without booting.

To turn the leds permanent on just use trigger default-on, to turn them off use none with:

rpi ~$ sudo bash -c 'echo none > /sys/class/leds/led0/trigger'
rpi ~$ sudo bash -c 'echo none > /sys/class/leds/led1/trigger'
| improve this answer | |
  • Thanks for the reply. It seems both LEDs are already set to none, I have updated my original post with the output of led0 – GiarcTNA Oct 16 at 12:53
  • @GiarcTNA What Raspberry Pi version exactly do you use? RPi 3B or RPi 3B+? Have you tried to switch the LEDs on and off? – Ingo Oct 16 at 18:04
  • It is the RPi 3B running the latest Raspbian. I don't seem to be able to switch them off. I have managed to do this before so I am not sure why it is not working now. – GiarcTNA Oct 18 at 11:39
  • I saw in another post that someone wasn't able to do it with the latest Raspbian version (Buster). I suppose I can try another OS to see. raspberrypi.stackexchange.com/questions/70593/… – GiarcTNA Oct 18 at 11:51
  • @GiarcTNA Maybe it is active low? Try to switch ON with trigger none. – Ingo Oct 18 at 23:45
0

Rather than use the device tree I've had success using the "tmpfiles.d" hook provided by systemd.

For example, create a new file leds.conf at /etc/tmpfiles.d/:

w    /sys/class/leds/led0/trigger    - - - - timer
w    /sys/class/leds/led0/delay_off  - - - - 5000
w    /sys/class/leds/led0/delay_on   - - - - 1

That should give you a very short blink every 5 seconds on the green LED after a reboot. Adjust and expand to suit...

| improve this answer | |
  • Unfortunately this didn't seem to work. Even using your settings unchanged it didn't blink the green LED – GiarcTNA Oct 28 at 16:03

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.