[App] libAirToSat D/E/F/H
Posted: Thu Feb 05, 2015 4:06 pm
Lib allows to switch directly from air/cable to sat (to air/cable) source without having to explore TV menus or use any key macro to do so. Mainly designed to be used with libRCremap with CMD support. Of course no need to try it if you have no sat tuner on your TV.
Usage:
*For D series (arm), replace every instance of /mnt below by /mtd_rwcommon/widgets/user/SamyGO/SamyGO
Usage with libRCremap with CMD support:
Usage:
*For D series (arm), replace every instance of /mnt below by /mtd_rwcommon/widgets/user/SamyGO/SamyGO
- Get latest samyGOso from there and copy/overwrite samyGOso file (not folder) to /mnt/opt/privateer/usr/bin
- Set permissions if needed (usually not if overwritten)
Code: Select all
chmod +x /mnt/opt/privateer/usr/bin/samyGOso
- Extract attached archive and copy libAirToSat.so to /mnt/opt/privateer/usr/libso (create folder if needed)
- Execute
Commandline can take 'CABLE' arg if you prefer to switch between cable/sat instead of air/sat
Code: Select all
samyGOso -d -A -B -l /mnt/opt/privateer/usr/libso/libAirToSat.so
TV should switch to sat if on air/cable, and to air/cable if on satCode: Select all
samyGOso -d -A -B -l /mnt/opt/privateer/usr/libso/libAirToSat.so CABLE
Logfile is written to /dtv/AirToSat.log
Usage with libRCremap with CMD support:
- Do not directly inject libAirToSat as CMD, a little intermediate script is needed to prevent consecutive injections, depending on how long you press remote button. Here's sample script (D/E/F only):
Script is attached in archive (CMD_libAirToSat), edit paths in it if needed.SpoilerShow
Code: Select all
#!/bin/sh [ $(pidof ${0##*/}) ] 2>/dev/null || exit 0 SODIR=/mnt/opt/privateer/usr/libso SAMYGOSODIR=/mnt/opt/privateer/usr/bin $SAMYGOSODIR/samyGOso -A -B -l $SODIR/libAirToSat.so sleep 2 # no new execution allowed before 2 seconds
- H-series users have to use another script:
SpoilerShow
Code: Select all
#!/bin/sh [ -e /tmp/.${0##*/} ] && exit 0 echo OK > /tmp/.${0##*/} SODIR=/mnt/opt/privateer/usr/libso SAMYGOSODIR=/mnt/opt/privateer/usr/bin (echo "$SAMYGOSODIR/samyGOso -A -B -l $SODIR/libAirToSat.so" ; sleep 2) | /mnt/bin/telnet localhost 23 rm /tmp/.${0##*/}
- Copy script to /mnt/opt/privateer/usr/bin
- Set permissions
Code: Select all
chmod +x /mnt/opt/privateer/usr/bin/CMD_libAirToSat
- and remap expected key in libRCremap.config to
Code: Select all
CMD:/mnt/opt/privateer/usr/bin/CMD_libAirToSat
- Check libRCremap with CMD support for more infos
- Other example scripts:
- In case you have 3 active sources (Air/Cable/Sat) and you want to cycle them:
SpoilerShowYou need to have already installed both:- libLogChannel in /mnt/opt/privateer/usr/libso
- samyGOrc in /mnt/opt/privateer/usr/bin with correct execution rights (chmod +x ...)
Code: Select all
#!/bin/sh [ $(pidof ${0##*/}) ] 2>/dev/null || exit 0 SODIR=/mnt/opt/privateer/usr/libso SAMYGOSODIR=/mnt/opt/privateer/usr/bin # Detect current antenna mode using libLogChannel $SAMYGOSODIR/samyGOso -A -B -l $SODIR/libLogChannel.so sleep 0.5 CUR_ANT=$(grep "TV mode" /dtv/LogChannel.log | sed 's/\(.*\)(\(.*\))/\2/') # Send the right command depending on detected antenna mode case $CUR_ANT in 0) #TV mode: send KEY_ANTENA with samyGOrc $SAMYGOSODIR/samyGOrc -p $(pidof exeDSP || pidof exeTV) 54 ;; 1) #Cable mode: launch libAirToSat in CABLE mode $SAMYGOSODIR/samyGOso -A -B -l $SODIR/libAirToSat.so CABLE ;; 3) #Sat mode: launch libAirToSat in TV mode $SAMYGOSODIR/samyGOso -A -B -l $SODIR/libAirToSat.so ;; esac sleep 1.5 # to prevent consecutive injections
- If you want TV to quickly display antenna name on switching:
SpoilerShowYou need to have already installed:- libAlert in /mnt/opt/privateer/usr/libso
- Current libAirToSat v0.2.9 or higher
- E/F version:
Code: Select all
#!/bin/sh [ $(pidof ${0##*/}) ] 2>/dev/null || exit 0 SODIR=/mnt/opt/privateer/usr/libso SAMYGOSODIR=/mnt/opt/privateer/usr/bin $SAMYGOSODIR/samyGOso -A -B -l $SODIR/libAirToSat.so sleep 0.5 alert=$(grep antenna /dtv/AirToSat.log | sed 's/\(.*\)\: \(.*\)/\2/') $SAMYGOSODIR/samyGOso -A -B -l $SODIR/libAlert.so "TEXT:$alert" sleep 1
- H version:
Code: Select all
#!/bin/sh [ -e /tmp/.${0##*/} ] && exit 0 echo OK > /tmp/.${0##*/} SODIR=/mnt/opt/privateer/usr/libso SAMYGOSODIR=/mnt/opt/privateer/usr/bin echo "$SAMYGOSODIR/samyGOso -A -B -l $SODIR/libAirToSat.so; sleep 0.5; alert=\$(grep antenna /dtv/AirToSat.log | sed 's/\(.*\)\: \(.*\)/\2/'); $SAMYGOSODIR/samyGOso -A -B -l $SODIR/libAlert.so \"TEXT:\$alert\"" | /dtv/bin/nc localhost 2023 sleep 2 rm /tmp/.${0##*/}
Code: Select all
22/5/2015
v0.2.9 - Logging antenna name in local language
21/5/2015
v0.2.7 - Rewrote whole lib, fix no signal issue on concerned TVs
8/2/2015
v0.2.3 - Fixed: sometimes erased sat channel name when switching to
- Switches faster ;)
5/2/2015
v0.2.1 - Added 'CABLE' switch
v0.2.0 - First release