I have two RPis one 3B Model 1.2 one 4B. I set up both as subnet routers for Tailscale and wanted to turn off both the Power/Activity and Ethernet LEDs (all the LEDs). I put PiOS 64 Lite (Bullseye) on both units.
On the 4B it was straightforward, I followed the directions here for amending config.txt in boot (although he got line #2 wrong, it should be dtparam=pwr_led_trigger=none). They all turn off at or shortly after boot.
On the 3B it was much more challenging. This post is about disabling LEDs on the 3B. I ended up with a hybrid of commands in:
(a) config.txt for the Power/Activity LEDs using the post above; and (b) in rc.local based on Andrews Cordolino Sobral's post here:
There are other versions but these are (I believe the originals).
I say hybrid because for (a), the last two sets of commands in config.txt did not work
# Turn off Power LED dtparam=pwr_led_trigger=none dtparam=pwr_led_activelow=off # Turn off Activity LED dtparam=act_led_trigger=none dtparam=act_led_activelow=off # Turn off Ethernet ACT LED dtparam=eth_led0=14 # Turn off Ethernet LNK LED dtparam=eth_led1=14
and for (b) the first four lines did not work on my Pi 3B:
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' sudo sh -c 'sudo /home/pi/Projects/lan951x-led-ctl/lan951x-led-ctl --fdx=0 --lnk=0 --
/etc$ sudo sh -c 'echo none > /sys/class/leds/led0/trigger' sh: 1: cannot create /sys/class/leds/led0/trigger: **Directory nonexistent**
I am very new to all this, so it was a challenge for me to git clone and make lan951x-led-ctl, it kept throwing permission errors but that's another story.
I wanted to understand why (b) did not work for the Power/Activity LEDs, it appears it is due to teh led0 and led1 dirs not existing on my unit.
Around the internet there are many references to the /sys/class/leds/led0 and led1 directories.
My Pi 4B has these directories (but I do not reference them, directly at least, to issue commands to turn off the the LEDs).
My Pi 3B has a /sys/class/leds directory but it does NOT have any led0 or led1 subdirectory. Others have a similar query (trumpet205 here e.g. https://forums.raspberrypi.com/viewtopic.php?t=149126).
Rather it has these four subdirectories, all as shortcuts only:
/ACT (as a shortcut) /default-on (as a shortcut) /mmc0 (as a shortcut) /PWR (as a shortcut)
Now, INSIDE /ACT and /POWER shortcuts are actually trigger and brightness files. Assuming led0=ACT and led1=PWR, replacing the dir path with ACT and PWR and issuing the sudo turns ON the lights:
sudo sh -c 'echo input > /sys/class/leds/ACT/trigger' sudo sh -c 'echo input > /sys/class/leds/PWR/trigger' sudo sh -c 'echo 1 > /sys/class/leds/ACT/brightness' sudo sh -c 'echo 1 > /sys/class/leds/PWR/brightness'
Reverting to none and 0 turns them off, as expected. Progress.
sudo sh -c 'echo none > /sys/class/leds/ACT/trigger' sudo sh -c 'echo none > /sys/class/leds/PWR/trigger' sudo sh -c 'echo 0 > /sys/class/leds/ACT/brightness' sudo sh -c 'echo 0 > /sys/class/leds/PWR/brightness'
So my query is simply this, why, with identical PiOS 64 installs and ostensibly part of the 3B, 3B+, 4B and 400 family who I have seen all referenced to /sys/class/leds/led0 and led1, why does my 3B model 1.2 NOT have these directories?
I have searched on "/sys/class/leds/ACT/trigger" and "/sys/class/leds/PWR/trigger" and they do show up here https://raspi.debian.net/faq/ (without explanation). While I came across a couple of folks who are also missing these dirs, there was no explanation why (or whether they should have them).
Is it by design i.e. I should just use the ACT and PWR as I have above or am I missing them?
If nothing else, hopefully this query will help someone wondering the same things I did.
EDIT1: If ACT and PWR were introduced in Bullseye to replace led0 and led1, and I put Bullseye (PiOS 64 Lite) on both the 3B and 4B, I am scratching my head as to why the 3B got these newer ACT and PWR dirs, but the 4B got the old led0 and led1 ones. Anyway, it is a quick fix to change the dir path in rc.local.