|
SageTV for unRAID/Docker Discussion related to SageTV for unRAID/Docker. Questions, issues, problems, suggestions, etc. relating to SageTV for unRAID/Docker should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
3 Zone IR control with iTach
Like many people, I am kicking the tires on the Docker implementation of SageTV. One big impediment for me is using my favorite, reliable USB-UIRT to tune the three Uverse STBs I have in my setup. I saw Sean's description of the CommandIR and wanted to follow the same path, but stymied with unavailability. I thought of using something independent of USB driver requirements and stumbled on the iTach IP2IR gathering dust at my local Micro Center.
I liked that it was network attached, had 3 IR outputs and a published API. I didn't like that their IR format was not the standard Hex format I'm used to seeing (although they have an iTranslate utility that can convert) and the price was $90. I'm using this GENTUNER script to drive my Uverse boxes. Hopefully it will be helpful to others that might want to try this path. Code:
#!/bin/bash # # gentuner.GCACHE # GenericTunerPlugin Connector to control Global Cache IR controllers # See gentuner.README for details on gentuner # # This script proxies commands from the Generic Tuner Plugin # to a GC IP2IR controller (should work for any GC device using API). # There are 3 IR ports that can be mapped for up to 3 STB tuners. Use # the controller web page to make sure each port is set for 'IR Out'. # # You must change the IP address below to indicate your particular # GC device. The GC family uses a unique IR encoding scheme. Check # their web site for help in translating your own device. This example is # for the ATT Uverse command set. The OK command is included so that you # can call this script from CRON to simulate the STB KeepAlive process. # if [ $# = 0 ] #error out if no command line then exit 32 fi gcipaddr='192.168.1.17/4998' #address and port of GC controller (might want to reserve in your DHCP server to prevent drift) delay=.2 #delay for Uverse to accept IR input lockfile=/tmp/gcachelock #if simultaneous calls (i.e. keepalive and sage tune cmd) then let one finish first # socket routine to transact command with controller transact () { exec 3<>/dev/tcp/$gcipaddr retmsg="" printf "$1\r" >&3 #bytewise pipe while IFS= read -N 1 byte <&3 do retmsg="$retmsg$byte" if [[ $byte =~ $'\r' ]]; then break; fi done sleep $delay if [ "${retmsg:0:3}" = "ERR" ] then return 0 else return 4 fi } #lower case for consistency cmd="$(echo $1 | tr '[A-Z]' '[a-z]')" remote="$(echo $2 | tr '[A-Z]' '[a-z]')" channel="$(echo $3 | tr '[A-Z]' '[a-z]')" declare -A tuners #enter the STBs for your installation tuners=([uverse1]=0 [uverse2]=1 [uverse3]=2) declare -A remoteCmd #add any extra keys here, place IR codes starting in 11th position in IRCode array remoteCmd=([ok]=10 [enter]=11) IRPort=('sendir,2:1' 'sendir,2:2' 'sendir,2:3') #GC command for each IR port (make sure they are set as IR Out in controller web page) IRPreamble=',1,36000,3,1,15,10,6,10,6,22,6,10,6,28,6,16,6,10,6,10,6,10,6,22,6,22,6,16,6,22,6,' # codes for 0-9, ok, enter. add any new IR codes for any new keys you put in remoteCmd at the end IRCode=('10,6,10,6,10,6,10' '10,6,10,6,10,6,16' '10,6,10,6,10,6,22' '10,6,10,6,10,6,28' '10,6,10,6,16,6,10' '10,6,10,6,16,6,16' '10,6,10,6,16,6,22' '10,6,10,6,16,6,28' '10,6,10,6,22,6,10' '10,6,10,6,22,6,16' '16,6,16,6,28,6,10' '28,6,22,6,10,6,16') IRPost=',6,3100' if [ "$cmd" = "remotes" ] then for i in "${!tuners[@]}" do echo $i done elif [ "$cmd" = "keys" ] then for i in 1 2 3 4 5 6 7 8 9 0 "${!remoteCmd[@]}" do echo $i done elif [ "$cmd" = "send" -o "$cmd" = "tune" ] #matters not which command received. send is the single unit case of tune. then SECONDS=0 while [ -f $lockfile ] do #echo "Waiting for lock" sleep $delay if ((SECONDS > 5)); then rm $lockfile; fi #brute force after 5 secs done touch $lockfile exitcode=0 if [ ${tuners[$remote]} <> " " ] #sanity check in case called outside sagetv then IRTuner=${IRPort[${tuners[$remote]}]} if [[ $channel =~ ^[0-9]+$ ]] #test for channel number or key command then #channel number for ((i=0; i<${#channel}; i++)) #iterate through each digit do IRString=$IRTuner$IRPreamble${IRCode[${channel:$i:1}]}$IRPost if (transact "$IRString"); then exitcode=16; fi #fail on error return done IRString=$IRTuner$IRPreamble${IRCode[${remoteCmd["ok"]}]}$IRPost if (transact "$IRString"); then exitcode=16; fi #fail on error return elif [ ${remoteCmd[$channel]} <> " " ] #sanity check if key command is in our list then IRString=$IRTuner$IRPreamble${IRCode[${remoteCmd[$channel]}]}$IRPost if (transact "$IRString"); then exitcode=16; fi #fail on error return else exitcode=8 fi else exitcode=4 fi rm $lockfile exit $exitcode elif [ "$cmd" = "can_tune" ] then echo "YES" else exit 1 fi
__________________
Frankentivo: iStar D-380HB, SuperMicro X107-F-O, Xeon 1270v3 CPU, Kingston 8 GB 1600MHz DDRR3L x 4 Tuners: 4 x HDHR OTA, 4 x HDHR3 OTA, 3 x HDHR Prime UnRAID Pro: 1 x Samsung 500GB Cache, 5 x WD Red 4TB (1 Parity, 4 Data) Extenders: 2 x HD-200, 1 x HD-300 on Atlona PRO3HD66m Sage: V9.0.14.567 with OpenDCT on unRaid docker, Gemstone, BMT, Web UI, PlayOn, TiSage |
#2
|
||||
|
||||
That device looks neat. Keep us posted on your thoughts as you use it. I love the commandIR for it's reliability, and I have a usb-uirt that I've played with with, but I need multiple zones for it to be useful.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#3
|
|||
|
|||
I have had very good experience with this little box so far. Connection is solid and no missed tuning. So many times these things seem to go to sleep and go unrealized until needed. Unfortunately I'm also trying out an HDHR Prime with OpenDCT. Definitely more responsive and better image quality over the HD-PVR. If things continue going well with the Prime then the IP2IR will have a short but appreciated role.
I've had more than 50 recordings go through the HD-PVRs with this tuning setup and no problems. At least three occasions where all three were recording a the same time. I haven't seen an issue. Very reliable. I'm really liking the Docker/SageTV
__________________
Frankentivo: iStar D-380HB, SuperMicro X107-F-O, Xeon 1270v3 CPU, Kingston 8 GB 1600MHz DDRR3L x 4 Tuners: 4 x HDHR OTA, 4 x HDHR3 OTA, 3 x HDHR Prime UnRAID Pro: 1 x Samsung 500GB Cache, 5 x WD Red 4TB (1 Parity, 4 Data) Extenders: 2 x HD-200, 1 x HD-300 on Atlona PRO3HD66m Sage: V9.0.14.567 with OpenDCT on unRaid docker, Gemstone, BMT, Web UI, PlayOn, TiSage |
#4
|
||||
|
||||
I can't speak to the IP2IR specifically, but Global Cache is pretty much a staple in the HA realm...
they tend to be very stable... a bit pricey, but stable...
__________________
NOTE: As one wise professional something once stated, I am ignorant & childish, with a mindset comparable to 9/11 troofers and wackjob conspiracy theorists. so don't take anything I say as advice... |
#5
|
|||
|
|||
Re:
@MacDaddy
I'm trying to get this setup with IR2IP. In your gentuner script, where would you add an "if" to use 2 different sets of IR codes? I think you use the same IR Codes for your 3 tuners but I want to use a set of codes for uverse1 and another one for uverse2. I can probably create IRPort2, IRPreamble2, IRCode2 and IRPost2 and add a "if" when IRString is created? I haven't coded since too long Update : My IR codes now work! Yeah! BUT, digits are being sent one by one to gentuner and my receiver tunes each digit as if it was the whole channel. So if I want to tune channel 1000, it ends up trying to tune channel 1 then channel 0 then channel 0 then again channel 0. Trying to figure out why it does that. If you have a clue.... Update 2 : Oh... the scripts sends OK each time it runs (IRString=$IRTuner$IRPreamble${IRCode[${remoteCmd["ok"]}]}$IRPost)... now I need to figure out either how to not send the OK but have the script run properly or have sage send the whole channel number to the script and run it only once. Humm.... simply commenting out the ok line ends up sending the ir twice again. Update 3 : Figured it out ! Your script sets : CAN_TUNE is OK to YES but in order for sage to Macro Tune (send the whole channel number to gentuner) the script needs to return OK not YES. I changed the "echo "YES" line to echo "OK" and it works perfectly now !!! Quote:
Now I only have to figure out how to configure a different sent of IR codes for my other receiver. Last edited by atchoo; 04-10-2018 at 01:34 PM. |
#6
|
|||
|
|||
I got everything working with Bell Fibe + Dishnetwork and the iTach IR2IP. That's a really nice device and tuning is perfect. I'll post my gentuner script later.
__________________
Happily running SageTV since 2009 ! SERVER: Dell Poweredge R710 2x Xeon 5650 + 72GB RAM + 3x WD-Red 6GB 3.5" (6 bays) + 400GB SAS Cache Drive SOFTWARE: Unraid + Docker + SageTV v9 + OpenDCT + Phoenix 3 (PLite) + BMT + Web UI CAPTURE & IR: BM3500-HDMI (x2) + iTach IR2IP - Gentuner Script - Bell Fibe + Dish Network CLIENTS: HD200 (x3) + HD300 (x2) RETIRED: WinXP Server, HD-PVR (x2), USB-UIRT (10 years life as my SageTV setup) |
#7
|
|||
|
|||
Here's my version of the script in case you have different boxes with different IR codes....
This has been a great alternative to the USB-UIRT for me. It just works. gentuner Code:
#!/bin/bash # # gentuner.GCACHE # GenericTunerPlugin Connector to control Global Cache IR controllers # See gentuner.README for details on gentuner # # This script proxies commands from the Generic Tuner Plugin # to a GC IP2IR controller (should work for any GC device using API). # There are 3 IR ports that can be mapped for up to 3 STB tuners. Use # the controller web page to make sure each port is set for 'IR Out'. # # You must change the IP address below to indicate your particular # GC device. The GC family uses a unique IR encoding scheme. Check # their web site for help in translating your own device. # The OK command is included so that you # can call this script from CRON to simulate the STB KeepAlive process. # # Modified version that supports 3 tuners identified as uverse1, uverse2 and uverse3 # Configured with IR codes for Dish Network VIP211K and Bell Fibe VIP1200 # if [ $# = 0 ] #error out if no command line then exit 32 fi gcipaddr='XXYOURiTACHIPXX/4998' #address and port of GC controller (might want to reserve in your DHCP server to prevent drift) delay=.2 #delay for Uverse to accept IR input lockfile=/tmp/gcachelock #if simultaneous calls (i.e. keepalive and sage tune cmd) then let one finish first # socket routine to transact command with controller transact () { exec 3<>/dev/tcp/$gcipaddr retmsg="" printf "$1\r" >&3 #bytewise pipe while IFS= read -N 1 byte <&3 do retmsg="$retmsg$byte" if [[ $byte =~ $'\r' ]]; then break; fi done sleep $delay if [ "${retmsg:0:3}" = "ERR" ] then return 0 else return 4 fi } #lower case for consistency cmd="$(echo $1 | tr '[A-Z]' '[a-z]')" remote="$(echo $2 | tr '[A-Z]' '[a-z]')" channel="$(echo $3 | tr '[A-Z]' '[a-z]')" declare -A tuners #enter the STBs for your installation tuners=([uverse1]=0 [uverse2]=1 [uverse3]=2) declare -A remoteCmd #add any extra keys here, place IR codes starting in 11th position in IRCode array remoteCmd=([ok]=10 [enter]=11) IRPort=('sendir,1:1' 'sendir,1:2' 'sendir,1:3') #GC command for each IR port (make sure they are set as IR Out in controller web page) if [ "$remote" = "uverse1" ] then IRPreamble=',1,35816,2,1,15,10,6,10,6,22,6,16,6,16,6,10,6,10,6,10,6,10,6,' # codes for 0-9, ok, enter. add any new IR codes for any new keys you put in remoteCmd at the end IRCode=('10,6,22,6,16,6,22,6,10,6,10,6,10,6,10,6,3234' '22,6,22,6,16,6,22,6,10,6,10,6,10,6,16,6,3217' '10,6,22,6,16,6,22,6,10,6,10,6,10,6,22,6,3222' '22,6,22,6,16,6,22,6,10,6,10,6,10,6,28,6 ,3204' '22,6,22,6,16,6,22,6,10,6,10,6,16,6,10,6,3216' '10,6,22,6,16,6,22,6,10,6,10,6,16,6,16,6,3222' '22,6,22,6,16,6,22,6,10,6,10,6,16,6,22,6,3205' '10,6,22,6,16,6,22,6,10,6,10,6,16,6,28,6,32 10' '22,6,22,6,16,6,22,6,10,6,10,6,22,6,10,6,3210' '22,6,22,6,16,6,22,6,10,6,10,6,22,6,16,6,3204' '22,6,22,6,16,6,22,6,16,6,16,6,28,6,10,6,3192' '22,6,22,6,16,6,22,6,16,6,16,6,28,6,10,6,3192' ) IRPost='' # echo 1 fi if [ "$remote" = "uverse2" ] then IRPreamble=',1,57077,5,1,23,161,23,' # codes for 0-9, ok, enter. add any new IR codes for any new keys you put in remoteCmd at the end IRCode=('97,23,161,23,161,23,161,23,97,23,161,23,161,23,161,23,161,23,161,23,161,' '161,23,161,23,97,23,161,23,161,23,161,23,161,23,161,23,161,23,161,23,161,' '161,23,161,23,97,23,161,23,97 ,23,161,23,161,23,161,23,161,23,161,23,161,' '161,23,161,23,97,23,97,23,161,23,161,23,161,23,161,23,161,23,161,23,161,' '161,23,97,23,161,23,161,23,161,23,161,23,161,23,161,23,161,23,161,23,1 61,' '161,23,97,23,161,23,161,23,97,23,161,23,161,23,161,23,161,23,161,23,161,' '161,23,97,23,161,23,97,23,161,23,161,23,161,23,161,23,161,23,161,23,161,' '161,23,97,23,97,23,161,23,161,23,16 1,23,161,23,161,23,161,23,161,23,161,' '161,23,97,23,97,23,161,23,97,23,161,23,161,23,161,23,161,23,161,23,161,' '161,23,97,23,97,23,97,23,161,23,161,23,161,23,161,23,161,23,161,23,161,' '97, 23,161,23,161,23,161,23,161,23,161,23,161,23,161,23,161,23,161,23,161,' '97,23,161,23,161,23,161,23,161,23,161,23,161,23,161,23,161,23,161,23,161,') IRPost='23,161,23,161,23,161,23,161,23,354' # echo 2 fi if [ "$remote" = "uverse3" ] then IRPreamble='' # codes for 0-9, ok, enter. add any new IR codes for any new keys you put in remoteCmd at the end IRCode=('' '' '' '' '' '' '' '' '' '' '' '') IRPost='' # echo 3 fi if [ "$cmd" = "remotes" ] then for i in "${!tuners[@]}" do echo $i done elif [ "$cmd" = "keys" ] then for i in 1 2 3 4 5 6 7 8 9 0 "${!remoteCmd[@]}" do echo $i done elif [ "$cmd" = "send" -o "$cmd" = "tune" ] #matters not which command received. send is the single unit case of tune. then SECONDS=0 while [ -f $lockfile ] do #echo "Waiting for lock" sleep $delay if ((SECONDS > 5)); then rm $lockfile; fi #brute force after 5 secs done touch $lockfile exitcode=0 if [ ${tuners[$remote]} <> " " ] #sanity check in case called outside sagetv then IRTuner=${IRPort[${tuners[$remote]}]} if [[ $channel =~ ^[0-9]+$ ]] #test for channel number or key command then #channel number for ((i=0; i<${#channel}; i++)) #iterate through each digit do IRString=$IRTuner$IRPreamble${IRCode[${channel:$i:1}]}$IRPost if (transact "$IRString"); then exitcode=16; fi #fail on error return done IRString=$IRTuner$IRPreamble${IRCode[${remoteCmd["ok"]}]}$IRPost if (transact "$IRString"); then exitcode=16; fi #fail on error return elif [ ${remoteCmd[$channel]} <> " " ] #sanity check if key command is in our list then IRString=$IRTuner$IRPreamble${IRCode[${remoteCmd[$channel]}]}$IRPost if (transact "$IRString"); then exitcode=16; fi #fail on error return else exitcode=8 fi else exitcode=4 fi rm $lockfile exit $exitcode elif [ "$cmd" = "can_tune" ] then echo "OK" else exit 1 fi
__________________
Happily running SageTV since 2009 ! SERVER: Dell Poweredge R710 2x Xeon 5650 + 72GB RAM + 3x WD-Red 6GB 3.5" (6 bays) + 400GB SAS Cache Drive SOFTWARE: Unraid + Docker + SageTV v9 + OpenDCT + Phoenix 3 (PLite) + BMT + Web UI CAPTURE & IR: BM3500-HDMI (x2) + iTach IR2IP - Gentuner Script - Bell Fibe + Dish Network CLIENTS: HD200 (x3) + HD300 (x2) RETIRED: WinXP Server, HD-PVR (x2), USB-UIRT (10 years life as my SageTV setup) Last edited by atchoo; 04-17-2018 at 12:49 PM. |
#8
|
|||
|
|||
I just switched from Bell to Videotron, got a 4K receiver (it's a Samsung Ultra HD model). Here are the iTach IR codes in case someone needs it :
Code:
0 sendir,1:1,1,57339,5,1,192,192,48,145,48,145,48,48,48,145,48,145,48,145,48,48,48,48,48,145,48,145,48,48,48,48,48,48,48,145,48,48,48,48,48,48,48,145,48,145,48,48,48,48,48,145,48,2153 1 sendir,1:1,1,57339,5,1,192,192,48,145,48,145,48,48,48,145,48,145,48,48,48,48,48,48,48,48,48,145,48,48,48,48,48,48,48,145,48,48,48,48,48,145,48,145,48,145,48,145,48,48,48,145,48,2152 2 sendir,1:1,1,57339,5,1,192,192,48,145,48,145,48,48,48,145,48,145,48,145,48,48,48,48,48,48,48,145,48,48,48,48,48,48,48,145,48,48,48,48,48,48,48,145,48,145,48,145,48,48,48,145,48,2153 3 sendir,1:1,1,57339,5,1,192,192,48,145,48,145,48,48,48,145,48,145,48,48,48,145,48,48,48,48,48,145,48,48,48,48,48,48,48,145,48,48,48,48,48,145,48,48,48,145,48,145,48,48,48,145,48,2153 4 sendir,1:1,1,57339,5,1,192,192,48,145,48,145,48,48,48,145,48,145,48,145,48,145,48,48,48,48,48,145,48,48,48,48,48,48,48,145,48,48,48,48,48,48,48,48,48,145,48,145,48,48,48,145,48,2153 5 sendir,1:1,1,57339,5,1,192,192,48,145,48,145,48,48,48,145,48,145,48,48,48,48,48,145,48,48,48,145,48,48,48,48,48,48,48,145,48,48,48,48,48,145,48,145,48,48,48,145,48,48,48,145,48,2153 6 sendir,1:1,1,57339,5,1,192,192,48,145,48,145,48,48,48,145,48,145,48,145,48,48,48,145,48,48,48,145,48,48,48,48,48,48,48,145,48,48,48,48,48,48,48,145,48,48,48,145,48,48,48,145,48,2153 7 sendir,1:1,1,57339,5,1,192,192,48,145,48,145,48,48,48,145,48,145,48,48,48,145,48,145,48,48,48,145,48,48,48,48,48,48,48,145,48,48,48,48,48,145,48,48,48,48,48,145,48,48,48,145,48,2153 8 sendir,1:1,1,57339,5,1,192,192,48,145,48,145,48,48,48,145,48,145,48,145,48,145,48,145,48,48,48,145,48,48,48,48,48,48,48,145,48,48,48,48,48,48,48,48,48,48,48,145,48,48,48,145,48,2153 9 sendir,1:1,1,57339,5,1,192,192,48,145,48,145,48,48,48,145,48,145,48,48,48,48,48,48,48,145,48,145,48,48,48,48,48,48,48,145,48,48,48,48,48,145,48,145,48,145,48,48,48,48,48,145,48,2153 OK sendir,1:1,1,57339,5,1,192,192,48,145,48,145,48,48,48,145,48,145,48,48,48,48,48,145,48,145,48,48,48,48,48,48,48,48,48,145,48,48,48,48,48,145,48,145,48,48,48,48,48,145,48,145,48,2153
__________________
Happily running SageTV since 2009 ! SERVER: Dell Poweredge R710 2x Xeon 5650 + 72GB RAM + 3x WD-Red 6GB 3.5" (6 bays) + 400GB SAS Cache Drive SOFTWARE: Unraid + Docker + SageTV v9 + OpenDCT + Phoenix 3 (PLite) + BMT + Web UI CAPTURE & IR: BM3500-HDMI (x2) + iTach IR2IP - Gentuner Script - Bell Fibe + Dish Network CLIENTS: HD200 (x3) + HD300 (x2) RETIRED: WinXP Server, HD-PVR (x2), USB-UIRT (10 years life as my SageTV setup) |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Box Landing Zone Bug | wrems | Phoenix | 0 | 03-24-2011 05:45 AM |
USB-UIRT ZONE CONTROL | tahoebob | Hardware Support | 2 | 06-28-2010 01:37 PM |
3 tuners, 3 cable boxes: USB-UIRT 3 Zone Control | weeeg | Hardware Support | 121 | 05-07-2009 01:13 PM |
Whole-house audio over ethernet with control at each zone | CPA | General Discussion | 39 | 02-16-2009 07:40 AM |
Zone Alarm and HD PVR | TallMomof2 | Hardware Support | 7 | 12-10-2008 06:12 PM |