OpenWrt Forum Archive

Topic: Signal oMeter

The content of this topic has been archived on 4 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi, i'm trying to use the "timer" function of the led configuration..

i have set my timer for gpio1 and operates

im trying to make it blink even more faster when the signal increases or slow when it loose signal, something like the "Beep radar thing"..

i want somebody to help me improve it please. heres what i did so far.
call: sh filename <device> <gpio number> eg. sh filename ath1 1 (i run it in background as sh filename <params> >> /dev/null &)

#!bash
OLDVAL=0
while [ 1 ]
do

#Getting our signal level from the desired inteface...



REZ=`iwconfig $1 | grep 'Signal level' | cut -d - -f 2 | cut -d d -f 1`

echo "Signal Level is: $REZ"

MSDELAY=`expr $REZ \* 12`
# Now we HAVE to know it gets better or worse?

if [ $OLDVAL -gt $REZ ]
then

# The signal goes down


echo "Down"
MSDELAY=`expr $MSDELAY - 90`
echo $MSDELAY > /sys/devices/platform/leds-gpio/leds/gpio$2/delay_on
echo $MSDELAY > /sys/devices/platform/leds-gpio/leds/gpio$2/delay_off

else
if [ $OLDVAL -ne $REZ ]
then

# The signal gets even better
MSDELAY=`expr $MSDELAY + 90`
echo $MSDELAY > /sys/devices/platform/leds-gpio/leds/gpio$2/delay_on
echo $MSDELAY > /sys/devices/platform/leds-gpio/leds/gpio$2/delay_off
echo "Up"
else

# We have the same signal as before, we do nothing.

echo "Static"
fi
fi


OLDVAL=$REZ

sleep 3

done

Also i own a nanostation (ubnt) and the red led its dead.. wtf? gpio1 starts from the orange/yellow one

(Last edited by syred on 9 Apr 2009, 00:46)

i use the + 90 in order to make even more difference in the human eye when it gets increased, instead of just multiplying the positive number of dbm (in order to have a normal MS value for the blinking)

(Last edited by syred on 9 Apr 2009, 00:45)

The discussion might have continued from here.