Please note: This project is no longer active. The website is kept online for historic purposes only.
If you´re looking for a Linux driver for your Atheros WLAN device, you should continue here .

Graphing iwconfig values

It might be useful to graph WLAN values, as obtained by iwconfig, either graphically with eg. GD or gnuplot(1) or with ASCII in a terminal, like wavemon(1). Here's a quick logger on terminal, with Y-axis horizontal and X or T running axis vertical, top to bottom:

IFACE=ath0; S="--------"; N=$[${#S}+1]
while true;do
  set -- `iwconfig $IFACE |\
    tr '\n' ' '|\
    sed  -n "s/.*ESSID:\"\?\([^\"]*\)\".*Access Point:[ ]*\([^ ]*\) .*Bit Rate:\([0-9]*\).*Link Quality=\([0-9]*\).*Signal level=-\([0-9]*\).*Noise level=-\([0-9]*\).*/'\1' \2 \4 \3 \5 \6/p"
  echo -n -e "$1\t$2  |${S:0:$[$3*$N/60]}+${S:$[$3*$N/60]}|"
  echo -n -e "|${S:0:$[$4*$N/54]}+${S:$[$4*$N/54]}|"
  echo -n -e "|${S:$[($5-20)*$N/75]}+${S:0:$[($5-20)*$N/75]}|"
  echo    -e "|${S:$[($6-55)*$N/40]}+${S:0:$[($6-55)*$N/40]}|"
  sleep 1
done

would print something like:

...                                  L/Q         B/R        S/L        N/L
'MyEsSiD'      00:11:50:xx:xx:xx |-----+---||--+------||----+----||+--------|
'MyEsSiD'      00:11:50:xx:xx:xx |-----+---||--+------||----+----||+--------|
'MyEsSiD'      00:11:50:xx:xx:xx |-----+---||--+------||----+----||+--------|
'MyEsSiD'      00:11:50:xx:xx:xx |-----+---||--+------||----+----||+--------|
...

Change the sed(1) REGEX and/or scale/limit values to suit your need.

If you want fully bloated version, get graf_wlan.sh from http://web.tiscali.it/oopla/wifi/graf_wlan.sh

Here's a sample usage:

# sh bin/graf_wlan.sh -I ath0 -br -sl -nl -mb -tx -rx  -wh -i 0.5 -Mt 200 -Mr 200 -sw 8 -at -ts +%H:%
M:%S -in -im -ic -if

TimeStamp __ESSID___ |---LQ---|---BR---|---SL---|---NL---|---TX---|---RX---|-MB-|-IN-|-IC-|-IM-|-IF-|
02:24:28  My_ESSID   |----+---|---+----|---+----|+-------|+-------|+-------|----|----|----|----|----|
02:24:29  My_ESSID   |----+---|---+----|---+----|+-------|+-------|+-------|----|----|----|----|----|
02:24:29  My_ESSID   |---+----|---+----|---+----|+-------|+-------|+-------|----|----|----|----|----|
02:24:30  My_ESSID   |----+---|---+----|---+----|+-------|+-------|+-------|----|----|----|----|----|
02:24:30  My_ESSID   |----+---|---+----|---+----|+-------|+-------|+-------|----|----|----|----|----|
02:24:31  My_ESSID   |----+---|---+----|---+----|+-------|+-------|+-------|----|----|----|----|----|
02:24:31  My_ESSID   |----+---|---+----|---+----|+-------|+-------|+-------|----|----|----|----|----|
02:24:32  My_ESSID   |----+---|---+----|---+----|+-------|+-------|+-------|----|----|----|----|----|
02:24:32  My_ESSID   |----+---|---+----|---+----|+-------|----+---|----+---|----|----|----|----|----|
02:24:33  My_ESSID   |----+---|-----+--|---+----|+-------|----+---|----+---|----|----|----|----|----|
02:24:33  My_ESSID   |----+---|-----+--|---+----|+-------|----+---|----+---|----|----|----|----|----|
02:24:34  My_ESSID   |----+---|-----+--|---+----|+-------|----+---|----+---|----|----|----|----|----|
02:24:34  My_ESSID   |----+---|-----+--|---+----|+-------|----+---|----+---|----|----|----|----|----|
02:24:35  My_ESSID   |----+---|-----+--|---+----|+-------|----+---|----+---|----|----|----|----|----|
02:24:35  My_ESSID   |----+---|-----+--|---+----|+-------|----+---|----+---|----|----|----|----|----|
02:24:36  My_ESSID   |----+---|-----+--|---+----|+-------|----+---|----+---|----|----|----|----|----|
02:24:36  My_ESSID   |----+---|-----+--|---+----|+-------|-+------|-+------|----|----|----|----|----|
02:24:37  My_ESSID   |----+---|-----+--|---+----|+-------|+-------|+-------|----|----|----|----|----|
02:24:37  My_ESSID   |----+---|-----+--|---+----|+-------|+-------|+-------|----|----|----|----|----|

run it as

sh bin/graf_wlan.sh -h

for an (hopefully) understandable guide.

See also

UserDocs/Tools/rrdtooSnmpget and UserDocs/Tools/rrdtoolIwconfig for data collection and graphics diagrams using RRDtool and Python

Here's the code (attached) for graf_wlan.sh anyway, just in case I forget to pay for that webspace ...

Attachments