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_offelse
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
fiOLDVAL=$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 8 Apr 2009, 22:46)