Controlling the WRT54G/GS leds

The 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

4 Responses to “Controlling the WRT54G/GS leds”

  1. Controlar los leds de un Linksys WRT54G

    Si estás utilizando OpenWRT en un router Linksys WRTG54G, WRT54GS o WRT54GL, ¿sabías que puedes controlar los leds mediante la utilidad gpio? ¿Sabías que, además, debajo del logo de Cisco, existen dos leds, uno de color ámbar y otro de color bla…

  2. WRT54G

    Ya estoy decidido.. tengo que comprar un linksys de estos para jugar un poco, ya que son muchas las cosas que he visto por internet que han hecho con estos juguetitos de Linksys….

  3. # 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

  4. 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?

Leave a Reply