Loading...

NCLUG Talk : Hardware Hacking and Embedded Linux

December 11, 2007 1 Comment Tagged as: embedded-linux hardware-hacking nclug

The slides from my talk tonight at NCLUG are posted here for anyone who'd like to see them. I'll be posting the video soon.

OpenWRT LED Fiddlery

In preparation for my talk at NCLUG tomorrow, I've been fiddling around with OpenWRT on a few of my WRT54G devices. One of the things I've most appreciated about many of the embedded linux devices is their attention to detail in getting every little device to work on it. I usually don't spend the time mucking with my desktops to that degree. The cool thing about OpenWRT is that even the front LEDs can be controlled through the /proc filesystem. Since I found myself writing lots of scripts that manipulate these LEDs, I wrote a generic script that I can run from the command line to manipulate the LEDsa as well.

#!/bin/sh

usage () {
  echo "ledset - A program to set led values"
  echo " Usage : ledset led_name value"      
}                                      

if [ $# -ne 2 ]; then
  usage              
  exit 
fi    

if [ -f /proc/diag/led/$1 ] ; then
  echo $2 > /proc/diag/led/$1     
else                         
  echo "No led found named " $1
fi