Raspberry Pi – Control the on board LED lights

If you want to control a LED from the command line, but you’re not comfortable using the GPIO (and perhaps soldering), then feel free to use the HDD Status LED on the Raspberry Pi chip.

It’s a fun feature, but pretty useless. Most of Raspberry Pi’s LEDs are hardware-controlled, meaning you can’t control them from the operating system or software. But if you don’t mind the other LEDs flashing distractingly, then it might be more useful to you.

First you want to disable the trigger with:

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

Now you’re free to set the state. It goes from 0 to 255, but anything above 0 will turn the LED on. The follow would light it up:

echo 1 >/sys/class/leds/led0/brightness

And this would shut it down:

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

I’d suggest a full reboot to restore the diode when (if?) you’re done playing with it.

(You might need to use sudo, as with anything fun. At your own risk and so on.)

Raspbery Pi – Getting HDMI to Work Properly

I used a HDMI cable with a DVI adapter without issue, but I started having issues when I ditched the adapter. The resolution went down, and the smaller image was centered, leaving a big black border.

So how did I fix it? Uncomment or add the following line to /boot/config.txt


Value 2 means normal HDMI (sound will be sent over HDMI if enabled). Value 1 would be DVI mode. No idea why the adapter made it work perfectly without the settings change. Autoconfig?

I think it’s amazing that the Raspberry Pi can handle 1080p.