Controlling the WRT54G/GS leds
6 Comments Published by Felipe Alfaro Solana December 11th, 2005 in OpenWRTThe Cisco/Linksys WRT54G/GS router has two leds just beneath the Cisco Systems logo. One is a white led, while the other is an amber led. It is possible to turn them on or off using the GPIO pins on the mainboard.
- GPIO #3 controls the amber led beneath the Cisco Systems logo:
Disabling GPIO #3 turns on the amber led.
Enabling GPIO #3 turns off the amber led. - GPIO #2 controls the white led beneath the Cisco Systems logo:
Disabling GPIO #2 turns on the white led.
Enabling GPIO #2 turns off the white led. - GPIO #7 controls the DMZ led:
Disabling GPIO #7 turns on the DMZ led.
Enabling GPIO #7 turns off the DMZ led.
To control those GPIO pins with the OpenWRT firmware, download gpio.tar.gz or gpio.tar.gz and install the gpio binary into /usr/bin:
# cd /tmp # wget http://openwrt.org/downloads/gpio.tar.gz # tar -zxf gpio.tar.gz # mv gpio /usr/bin # rm /tmp/gpio.*
Use “/usr/bin/gpio disable n” to disable GPIO #n, or use “/usr/bin/gpio enable n” to enable GPIO #n.
Additionally, I customized the /etc/init.d/S99done script in order to turn on the white led under the Cisco Systems logo once the system booted:
# rm /etc/init.d/S99done # cat > /etc/init.d/S99done < < EOF > #!/bin/sh > /rom/etc/init.d/S99done > /usr/bin/gpio disable 2 > EOF # chmod +x /etc/init.d/S99done
6 Comments to “Controlling the WRT54G/GS leds”
- 1 Trackback on Dec 21st, 2005 at 05:16
- 2 Trackback on Jan 4th, 2006 at 09:53
# wget http://openwrt.org/downloads/gpio.tar.gz
Connecting to openwrt.org[195.56.146.238]:80
gpio.tar.gz 100% |*********************************************************************************************************| 444 00:00 ETA
# tar xzvf gpio.tar.gz
what-happened-to-gpio.txt
# cat what-happened-to-gpio.txt
What happened to the GPIO utility?
GPIO is a ‘general purpose io’, which depending on your point of view
is either a register that controls a hardware io or vice versa. The
gpio util was a diagnostic tool for controlling the GPIO pins, it was
never an intended as abstraction. Each device has the GPIO pins wired
slightly different, which is why we have abstractions like the ones in
/proc/sys/reset and /proc/sys/diag; using the gpio util to hardcode
GPIO numbers into scripts is just ignorant and stupid.
- mbm
Well, if using GPIO util to hardcode GPIO numbers into scripts is just ignorant and stupid, could then anybody propose a way to change how leds work in Linksys WRT54G without using GPIO?
Great work!!Works well even with DDWRT-Firmware except all lights change back to normal after a while, although this might be because i also have the sd-mod. Anyway, thanks!!!
Yes, this is because the SD mod use these GPIOs too.