Home Learning Flash the ACT led

Flash the ACT led

by shedboy71

Flash the ACT led from the command line, this tip was sent to me so I gave it a try, you could this in a script. The LED in question is seen below, this may depend on the version of Raspberry PI you have as well.

raspberry pi leds

raspberry pi leds

First lets navigate to the LED folder

cd /sys/class/leds/led0

Look what’s in the folder


You should see something like this:

brightness  device  max_brightness  power  subsystem  trigger  uevent

The brightness file controls if the LED is on or off (1 or 0). Lets see what its currently set as.

cat brightness

The command should display 0 which is off

The trigger file decides what controls the LED. Print the contents of the trigger file:

cat trigger

You should something like this, mmc0 is currently active so when there is SD card activity the LED lights

none [mmc0] timer oneshot heartbeat backlight gpio cpu0 default-on rfkill0 phy0rx phy0tx phy0assoc phy0radio

Change to the root user

sudo su

Take control over the LED:

echo none > trigger

Turn on the LED by putting a 1 into the brightness file:

echo 1 > brightness

Turn off the LED by putting a 0 into the brightness file:

echo 0 > brightness

Restore the trigger to the sd card

echo mmc0 > /sys/class/leds/led0/trigger

Exit and switch back to the pi user


Go home

cd ~

You may also like