Not sure if I'm using the right terminology, but I'm building a case for my pi and would like to "export" the status led, so that I can see them on the front panel. The case will be painted black so I need a way to adding LED to the front panel.
What is the best way of doing this?
thx
Re: Status LED - Redirecting
A light pipe.
Re: Status LED - Redirecting
The easiest way would be to use light-pipes or fibre-optic cables to channel the light from the LEDs to the front panel.
Re: Status LED - Redirecting
There's an even better way...
By editing some kernel parameters through /boot/cmdline.txt you can actually disable the green ACT LED and have it function on a GPIO of your choosing. In my example I just happen to be using GPIO17 but you should obviously change it to whatever GPIO your LED (and current-limiting resistor) is connected to.
As it's using kernel parameters this obviously only works while Linux is actually active, i.e. the multiple flashes you get after doing a "sudo poweroff" actually still flash the green ACT LED and not your 'external' status LED.
If you want to have both activity LEDs active at once, have a look at http://www.raspberrypi.org/forums/viewt ... 33&t=52893 and/or http://www.raspberrypi.org/forums/viewt ... 31&t=46517 (neither of which I've tried).

By editing some kernel parameters through /boot/cmdline.txt you can actually disable the green ACT LED and have it function on a GPIO of your choosing. In my example I just happen to be using GPIO17 but you should obviously change it to whatever GPIO your LED (and current-limiting resistor) is connected to.
- sudo nano /boot/cmdline.txt
- Keeping it all on one long line, add this to the end: bcm2708.disk_led_gpio=17 bcm2708.disk_led_active_low=0
- sudo reboot
- Do a happy dance

As it's using kernel parameters this obviously only works while Linux is actually active, i.e. the multiple flashes you get after doing a "sudo poweroff" actually still flash the green ACT LED and not your 'external' status LED.
If you want to have both activity LEDs active at once, have a look at http://www.raspberrypi.org/forums/viewt ... 33&t=52893 and/or http://www.raspberrypi.org/forums/viewt ... 31&t=46517 (neither of which I've tried).
- DougieLawson
- Posts: 42155
- Joined: Sun Jun 16, 2013 11:19 pm
- Location: A small cave in deepest darkest Basingstoke, UK
Re: Status LED - Redirecting
The hardware solution trumps that every time. It's not difficult to pipe the light in a piece of plexiglass.
Languages using left-hand whitespace for syntax are ridiculous
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
DMs sent on https://twitter.com/DougieLawson or LinkedIn will be answered next month.
Fake doctors - are all on my foes list.
The use of crystal balls and mind reading is prohibited.
Re: Status LED - Redirecting
Hi!, to start off I am new in this, I am utilizing all the gpio in the pie, haw can I use the same command in the 23017 chip?
bcm2708.disk_led_gpio=17 bcm2708.disk_led_active_low=0
bcm2708.disk_led_gpio=17 bcm2708.disk_led_active_low=0
Re: Status LED - Redirecting
BUMP this old thread.AndrewS wrote:There's an even better way...![]()
By editing some kernel parameters through /boot/cmdline.txt you can actually disable the green ACT LED and have it function on a GPIO of your choosing. In my example I just happen to be using GPIO17 but you should obviously change it to whatever GPIO your LED (and current-limiting resistor) is connected to.Discovered by looking at /proc/cmdline on the Compute Module, and by looking at https://github.com/raspberrypi/linux/bl ... /bcm2708.c
- sudo nano /boot/cmdline.txt
- Keeping it all on one long line, add this to the end: bcm2708.disk_led_gpio=17 bcm2708.disk_led_active_low=0
- sudo reboot
- Do a happy dance
As it's using kernel parameters this obviously only works while Linux is actually active, i.e. the multiple flashes you get after doing a "sudo poweroff" actually still flash the green ACT LED and not your 'external' status LED.
If you want to have both activity LEDs active at once, have a look at http://www.raspberrypi.org/forums/viewt ... 33&t=52893 and/or http://www.raspberrypi.org/forums/viewt ... 31&t=46517 (neither of which I've tried).
I'm interested in having the trigger functionalities on GPIO. This solution looks promising and quite easy to implement and maintain (working on kernel means to recompile everything on kernel updates, that is quite time consuming).
Awfully, I'm not able to let it work... I'm on an RPi3; is there something different that have to be written on /boot/cmdline.txt for this board? I didn't catch any hint from /proc/cmdline
Many thanks!
Re: Status LED - Redirecting
I made some research.
@AndrewS mentioned bcm2708.c file; in this file there is a /* command line parameters */ section that lists the mentioned disk_led_gpio. BTW, on the kernel build readme https://www.raspberrypi.org/documentati ... uilding.md it is mentioned that RPi 3 uses bcm2709 configuration. In bcm2708.c the /* command line parameters */ section just lists boardrev, serial and reboot_part. Maybe this trick can't be done on RPi3? Strange thing is that RPi 2 also uses bcm2709, and given the date of this thread's posts I *suppose* that users was talking about RPi 2.
I'm probably missing something...
@AndrewS mentioned bcm2708.c file; in this file there is a /* command line parameters */ section that lists the mentioned disk_led_gpio. BTW, on the kernel build readme https://www.raspberrypi.org/documentati ... uilding.md it is mentioned that RPi 3 uses bcm2709 configuration. In bcm2708.c the /* command line parameters */ section just lists boardrev, serial and reboot_part. Maybe this trick can't be done on RPi3? Strange thing is that RPi 2 also uses bcm2709, and given the date of this thread's posts I *suppose* that users was talking about RPi 2.
I'm probably missing something...
-
- Posts: 2
- Joined: Fri Feb 22, 2013 4:33 pm
Re: Status LED - Redirecting
I Disagree with the hardware solution.
Sorry to be negative, but the hardware solution is much worse when the pi is embedded inside another box - fiber optics are fine for your custom "pi case" but what about a large scale media center inside a cabinet - I want a light that tells my wife - "Don't pull the plug until this light is off"
I love the low-level software approach - is there a way to mimic this "SD Active" light for an external hard drive? The idea being that my wife doesn't "pull the plug" while the external HD is still mounted either.
Love the work by the way...
Sorry to be negative, but the hardware solution is much worse when the pi is embedded inside another box - fiber optics are fine for your custom "pi case" but what about a large scale media center inside a cabinet - I want a light that tells my wife - "Don't pull the plug until this light is off"
I love the low-level software approach - is there a way to mimic this "SD Active" light for an external hard drive? The idea being that my wife doesn't "pull the plug" while the external HD is still mounted either.
Love the work by the way...
Re: Status LED - Redirecting
Whoa, an update!
@pdeschulthess , I have almost the same problem. I need to warn if it is safe to turn off the system, and I can't use the hardware solution since I'm using an RGB LED, and the 3 colors have different meaning, so I need a dedicated GPIO.
Awfully, still no luck with the sw solution...
If someone have more experience and/or find some documentation about this for RPi3 I'll be really thankful!
@pdeschulthess , I have almost the same problem. I need to warn if it is safe to turn off the system, and I can't use the hardware solution since I'm using an RGB LED, and the 3 colors have different meaning, so I need a dedicated GPIO.
Awfully, still no luck with the sw solution...
If someone have more experience and/or find some documentation about this for RPi3 I'll be really thankful!
Re: Status LED - Redirecting
@il_mix,
You can redirect the green activity LED signal to any GPIO on the Pi 3B using "dtoverlay=pi3-act-led" in your '/boot/config.txt' file.
The dt parameter for earlier models is "act_led_gpio"
Both are documented in the (long) file '/boot/overlays/README' file on your Pi.
Hope this helps,
Dave.
You can redirect the green activity LED signal to any GPIO on the Pi 3B using "dtoverlay=pi3-act-led" in your '/boot/config.txt' file.
The dt parameter for earlier models is "act_led_gpio"
Both are documented in the (long) file '/boot/overlays/README' file on your Pi.
Hope this helps,
Dave.
Re: Status LED - Redirecting
Hi,
I've tried to add the following to /boot/config.txt:
dtoverlay=act_led_gpio,gpio=26
But my LED shows no indication what so ever..
I have a Rpi B+.. Any ideas on how to troubleshoot?
Thanks
I've tried to add the following to /boot/config.txt:
dtoverlay=act_led_gpio,gpio=26
But my LED shows no indication what so ever..

I have a Rpi B+.. Any ideas on how to troubleshoot?
Thanks
Re: Status LED - Redirecting
@cpt,
Two things, first - you need to reboot for changes in '/boot/config.txt' to take effect and second - "gpio=26" is physical pin 37 on a B+. See here.
Also, on models before the Pi 3B (like your B+) you should use:
in your '/boot/config.txt' file.
Hope this helps,
Dave.
Two things, first - you need to reboot for changes in '/boot/config.txt' to take effect and second - "gpio=26" is physical pin 37 on a B+. See here.
Also, on models before the Pi 3B (like your B+) you should use:
Code: Select all
act_led_gpio=26
in your '/boot/config.txt' file.
Hope this helps,
Dave.
Re: Status LED - Redirecting
@dgordon42 - thanks, but I'm not sure if I follow.. It does not seem to make any difference...
My /boot/config.txt looks like this now at the end:
I removed
Also, just to make sure, on the should it say 26 or 37?
Attached is an image with a red circle of which gpio pin I've connected my custom led to.
cheers
My /boot/config.txt looks like this now at the end:
Code: Select all
act_led_gpio=26
Code: Select all
dtoverlay=act_led_gpio,gpio=26
Code: Select all
act_led_gpio=26
Attached is an image with a red circle of which gpio pin I've connected my custom led to.
cheers
Re: Status LED - Redirecting
I got it working by only having:
in my /boot/config.txt
Code: Select all
dtparam=act_led_gpio=26
Re: Status LED - Redirecting
Sorry, this was incorrect, it should read:dgordon42 wrote:act_led_gpio=26
Code: Select all
dtparam=act_led_gpio=26
This should send the green activity led signal out on Physical Pin 37 which is GPIO 26 in Broadcom's numbering scheme (it's the one you circled in the post above).
Dave.
Re: Status LED - Redirecting
Thanks @dgordon42 and @cpt !
I've put all the hints together, and now I can control an external LED as activity LED, forcing a given trigger mode at runtime.
I've added this to /boot/config.txt
Activity LED is redirected to GPIO 22, and is set to heartbeat during boot.
The LED (actually GPIO 22) can be controlled via /sys/class/leds/led0. More precisely, one can set the trigger mode with command
where desired_mode can be anything listed by
(current mode is the one between [ ] brackets).
In my application, LED is in heartbeat mode during boot, thanks to /boot/config.txt setting. Than a startup program (e.g. /etc/rc.local) set it to default-on (steady on). When I press the reset/shutdown button I've added to the system, the script that controls the reset/shutdown pin will set the LED to heartbeat again, to inform the user the system is rebooting/shutting down.
That's exactly what I was trying to achieve!
I've put all the hints together, and now I can control an external LED as activity LED, forcing a given trigger mode at runtime.
I've added this to /boot/config.txt
Code: Select all
dtoverlay=pi3-act-led,gpio=22
dtparam=act_led_trigger=heartbeat
The LED (actually GPIO 22) can be controlled via /sys/class/leds/led0. More precisely, one can set the trigger mode with command
Code: Select all
echo <desired_mode> | sudo tee /sys/class/leds/led0/trigger >/dev/null
Code: Select all
cat /sys/class/leds/led0/trigger
In my application, LED is in heartbeat mode during boot, thanks to /boot/config.txt setting. Than a startup program (e.g. /etc/rc.local) set it to default-on (steady on). When I press the reset/shutdown button I've added to the system, the script that controls the reset/shutdown pin will set the LED to heartbeat again, to inform the user the system is rebooting/shutting down.
That's exactly what I was trying to achieve!

Re: Status LED - Redirecting
Awesome!!
-
- Posts: 227
- Joined: Wed Jan 02, 2013 8:28 am
Re: Status LED - Redirecting
Hi to all.
Is this code for re-directing heartbeat from led to gpio.... or also to "clone" heartbeat?
On Raspberry B+ v1.2 with stretch lite image (2017-11-29) I set config.txt as follows:
And now I have heartbeat on GPIO18.
Green led (act) is always off, but I would like to have heartbeat on BOTH green led and GPIO18.
Taking a look to sysfs code, I can see led0 is already set to "heartbeat", so I suppose heartbeat has moved from led GPIO to GPIO18.
How can I duplicate heartbeat?
Thanks.
Is this code for re-directing heartbeat from led to gpio.... or also to "clone" heartbeat?
On Raspberry B+ v1.2 with stretch lite image (2017-11-29) I set config.txt as follows:
Code: Select all
dtoverlay=pi3-act-led,gpio=18
dtparam=act_led_trigger=heartbeat
Green led (act) is always off, but I would like to have heartbeat on BOTH green led and GPIO18.
Taking a look to sysfs code, I can see led0 is already set to "heartbeat", so I suppose heartbeat has moved from led GPIO to GPIO18.
How can I duplicate heartbeat?
Thanks.
Re: Status LED - Redirecting
I might be wrong with this Idea , A short light pipe with a photo transistor in the end of the pipe
A simple circuit switching a remote LED , using the 3.3vrail for power,
A simple circuit switching a remote LED , using the 3.3vrail for power,
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong
Some Times Right Some Times Wrong
Re: Status LED - Redirecting
Might work might not Give it a try You research parts
- Attachments
-
- remotw led.jpg (46.21 KiB) Viewed 8787 times
BoyOh ( Selby, North Yorkshire.UK)
Some Times Right Some Times Wrong
Some Times Right Some Times Wrong