http://www.pro-bono-publico.de/openbsd/gpio/

Blinkenlights

Exploiting your Net4501 Error LED

Well, there you have your Soekris box, running OpenBSD -current, with GPIO drivers enabled, and the Error LED is still idle? Don't despair: Here's about the most useless application you may ever find:

gpioflicker

On the Net4501, this small giveaway lets the Error LED flash whenever pf logs something to pflog0. Usage instructions are:
# gpioflicker -h

Usage: gpioflicker [options]
 Options:
  -f                foreground [off]
  -d device         gpio device [/dev/gpio0]
  -p pin            gpio pin [9]
  -t milliseconds   minimum period to keep LED active [100]
  -i interface      network interface [pflog0]
  -n                don't monopolize gpio device
  -r                invert LED behavior
  -P                write pidfile [off]
  -B basename       pidfile basename (implies -P) [gpioflicker]
  -I {0|1}          initial state of gpio pin
 Signals:
  USR1 activates gpio pin
  USR2 deactivates gpio pin
 Version: 0.3
#

The default values are suitable for a Soekris Net4501. For other systems, you may need to use the -d and -p switches, and possibly do some initialization with gpioctl. The tarball includes a man page.

Here comes the download link: gpioflicker-0.3.tar.gz (about 4kB).

(Older versions: gpioflicker-0.2.tar.gz, gpioflicker-0.1.tar.gz.)

Kudos to Alexander Yurchenko (grange@) for the GPIO framework!


 Made with VI 
 Valid CSS 
 Valid HTML 4.0 
 NO ePATENTS 
 Impressum