New auto diseqc script for AAF 1.4
New auto diseqc script for AAF 1.4 2008/04/14 12:53
Based on the original diseqc_auto script, I've created a new script in an attempt to simplify
diseqc 1.2 automatic control on Kathrein.
This new script relies solely on "/data/diseqc/diseqc.cfg" file and doesn't require
"/data/bin/diseqc_cfg" nor the channel mapping file "/data/diseqc/SatPos.dsq".
This means we don't need to run "/data/bin/diseqc_cfg" everytime we update the channel list.
These 2 files can be safely deleted from Kathrein.
Instead of using satellite IDs, I've decided to use satellite names through "/data/bin/curchan",
a new binary distributed with AAF 1.4 which provides "current channel" info,
This is the reason the script runs only on AAF 1.4 - but I don't see a reason why it shouldn't run
on AAF 1.3, if "/data/bin/curchan" is copied from an AAF 1.4 image.
The "/data/diseqc/diseqc.cfg" file needs to be manually created and edited when a new satellite
is added to the channel list. The order of the satellites in this file is no longer important,
as the satellite name is searched in the file and the position is extracted from the same line.
The format of the file remains unchanged, on each line: <sat_pos> <sat_name>
If <sat_pos> is 255 then the entry (satellite) is ignored.
Prerequisites:
/data/bin/diseqcsend1.2
/data/bin/curchan (available only on AAF 1.4)
/data/diseqc/diseqc.cfg
Pros:
- doesn't require "/data/bin/diseqc_cfg" to be run everytime the channel list is updated
- keeps the current satellite in memory, doesn't create any additional files in /tmp
- uses shell built-in functions to detect when /config/PROPERTY_TABLE has changed,
should be lighter on system resources
Cons:
- "/data/bin/diseqc.cfg" needs to be manually created and maintained
Note:
- The script displays the satellite name on Kathrein's LCD upon startup and whenever
it detects a satellite change.
The new "/data/bin/diseqc_mon":
Code:
#!/bin/sh
# diseqc_mon - diseqc monitoring script
sleep 3
if [ -f /data/diseqc/diseqc.cfg ]; then
cp -p /config/PROPERTY_TABLE /tmp/property.tmp
satellite=`/data/bin/curchan -satname | /data/bin/awk '{print substr($0,6)}'`
/data/vfdctl -c "$satellite" &
while :
do
if [ /config/PROPERTY_TABLE -nt /tmp/property.tmp \
-o /config/PROPERTY_TABLE -ot /tmp/property.tmp ] ; then
cp -p /config/PROPERTY_TABLE /tmp/property.tmp
newsat=`/data/bin/curchan -satname | /data/bin/awk '{print substr($0,6)}'`
if [ "$newsat" != "" -a "$newsat" != "$satellite" ] ; then
satellite=$newsat
satpos=`grep "$satellite" /data/diseqc/diseqc.cfg | /data/bin/awk '{print $1}'`
if [ "$satpos" != "" -a "$satpos" != "255" ] ; then
/data/vfdctl -c "$satellite" &
/data/bin/diseqcsend1.2 224 49 107 $satpos 1>/dev/null 2>&1
fi
fi
fi
sleep 1
done
else
/data/vfdctl -c "No diseqc.cfg!" &
fi
EnF
http://ufs910.hdtvinfo.eu/component/option,com_fireboard/Itemid,26/func,view/id,3268/catid,36/