Project trouble with interface.sh using buttons

Discussion about my Wifi Radio project at http://mightyohm.com/wifiradio/ or my WL-520gU talk at NOTACON.
Post Reply
Loi
Posts: 1
Joined: Mon Feb 28, 2011 2:12 am

Project trouble with interface.sh using buttons

Post by Loi »

Hi all,
I am doing my final year project base on Mightyohms router.
I am stuck on the interface.sh bash script,
1st on the hardware my display is displaying fine and my tuner buttons are workin but when i try to add a volume button the interface file does not know what to do it, it can not read it.

Please help
Loi

here is my interface code.
while true # loop forever
do
inputline="" # clear input

# Loop until we get a valid tuner position from the AVR
until inputline=$(echo $inputline | grep -e "^tuner: ") || $(echo $inputline | grep -e "^tuner: ")
do
inputline=$(head -n 1 < /dev/tts/0)
done
value=$(echo $inputline | sed 's/tuner: ) # strip out the tuner: part
#echo "$value"






if [ "$VOLUME" -ne "$oldvol" ]
then
mpc volume $VOLUME
fi
oldvol=$VOLUME

station=$value

# if station has changed, we need to change position in the playlist
if [ "$station" -ne "$oldstation" ]
then
echo "Tuner Position: " $value
echo "New station..."
mpc play $station
fi

oldstation=$station # remember what station we're on so we know
# if we need to change stations next time around
done

}
User avatar
mightyohm
Site Admin
Posts: 1063
Joined: Fri Apr 03, 2009 10:29 pm
Location: Seattle, WA
Contact:

Re: Project trouble with interface.sh using buttons

Post by mightyohm »

I don't see anywhere in the script where you actually read and parse the volume string from the serial port (assuming the microcontroller is sending one).

It has been a LONG time since I wrote that script so there may be other issues as well and I am not seeing them. :D
Post Reply