Problems activating your account? Send notification email to: [email protected]
Host4Fun Budget VPS Hosting
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Turn off PWR & ACT LED on Raspberry Pi SBC
#1
Disclaimer: This tutorial has been written by me. It was firstly published on FreeVPS Club at this link. I'm reposting this solely to share knowledge. I'm not looking forward to request a VPS here.



How to turn off the PWR and ACT LEDs on the Raspberry Pi SBC
PWR = Power & ACT = Activity


Hello and welcome to the world of SBCs*

This guide is meant to make your life easier and more comfortable while working with the Raspberry Pi SBC. It is a very brief and very easy to follow tutorial.

Since the first generation of the Raspberry Pi the stunning SBC has had a few LEDs that are working as indicators for a few important things (<- this is a link) such as power (power is connected and proper delivery is in place), activity (SD card write/read, CPU load, etc) and network activity. The network activity LEDs (link and activity) used to be a dedicated LEDs on the first generations of the board. Nowadays however the network activity LEDs are in the normal Ethernet network jack (<- this is a link) like on normal computers.

I have a few generations of the Raspberry Pi (B/B+/3 B/3 B+) and I generally use them for projects and other stuff in my room because I have no other room or dedicated place to host them. Projects that involve 24x7 operation mean that I'm always exposed to the light of the LEDs. The PWR LED is very bright and when activity is going on you constantly see a green light flashing. This is really annoying especially during the night. So I've been looking for a way to turn off the PWR and ACT LEDs somehow to reduce the amount of light caused by the Raspberry Pi so I can fall asleep normally.

I found a way to reduce the light caused by these two LEDs to zero/null. The LEDs are actually registered within the OS as devices and therefore can be controlled by editing the corresponding configuration files. Both LEDs have identifiers which are LED0 (ACT) and LED1 (PWR) and these are located in /sys/class/leds. Every LED has different configurations files and one of them is brightness located in /sys/class/leds/led<0/1>/brightness. It can contain a value between 0 and 255. The value 0 means no brightness (turned off) and 1 - 255 is simply for turned on (I didn't notice any brightness change when setting it to 1 and 255).


So to turn of these LEDs all you have to do is run the two commands below as root (sudo will NOT WORK!):
Code:
echo 0 > /sys/class/leds/led0/brightness
echo 0 > /sys/class/leds/led1/brightness

There is a little issue though and it is: once you reboot the values of these LEDs will be reset back to what they were before because the LEDs are reinitialized at startup or reboot. There is an easy fix for that though.

Open /etc/rc.local with a text editor like nano as root:
Code:
nano /etc/rc.local

Add these lines at the end of the file but before exit 0:
Code:
echo 0 > /sys/class/leds/led0/brightness
echo 0 > /sys/class/leds/led1/brightness

Save the file with CTRL + V and ENTER. Close the text editor with CTRL + X.

Now whenever your start the Raspberry Pi or reboot it the LEDs will be turned off as soon as the OS starts booting.

That's it. This way it's much better. The network activity LEDs aren't so bright and therefore not even so annoying (imho).


* Single Board Computers
Somewhere, that’s not here, in a place I can’t remember I vanished.
Reply
 


Forum Jump:


Users browsing this thread: 1 Guest(s)

Sponsors: VirMach - Host4Fun - CubeData - Evolution-Host - HostDare - SSDBlaze - VPSlices - Abc-Hosters


About Post4VPS

Post4VPS is a forum/destiny where you can Delploy Your Free VPSs just by the Power of Posts.

We Provide VPSs of many locations like Germany,US,Canada,France,London,etc.

We also Provide VPSs of Both Linux and Windows OS.