[mythtv-users] UPNP Control of STB

Martin Compton martinc at itrans.com
Fri Apr 25 23:17:20 UTC 2014


On 04/23/2014 05:57 PM, Martin Compton wrote:
> I have a DishNetwork receiver (ViP222k) with 2 tuners, only one of 
> which can be controlled by MythTV via IR blasts, the second tuner is 
> controlled by an RF remote.  Thus I have to manually set the timers 
> for anything recorded on the second tuner (via an old WinPCI analog 
> card).
>
> However I discovered that I can change the channels on the Dish tuners 
> via UPNP actions.
>
> Does anyone know of an existing command line interface app that can be 
> called from within MythTV to send actions to a Upnp device?
>
> I'm poking around "miranda.py" to see if it can do what I need: send 
> WakeUp and SetChannel actions to the EchoSTB service, but I thought it 
> worth asking those more knowledgeable.

I was able to use a small shell script to give MythTV control of the 
Dish ViP222k STB over IP.

It should work for other Echostar STBs.

Using "miranda.py":
     msearch MediaServer (Ctrl-C to break)

     host list (note index and URL of device similar to: 
Linux/2.6.18.8-echostar)

     host get N (N=index from above)

     save data dishnet (save the host data to file: "struct_dishnet.mir")
exit

You may also want to do:
host send N MediaServer EchoSTB GetAuthChannelList

The return is the name of the xml file (read via http://dishnet url) 
listing authorized channels.

I needed this to get the 'authorized' channel numbers of my local 
channels, as well as the HD only channel numbers, else it would fail 
(local) or tune to the SD version even on TV1).

The miranda batch script loads the saved host information from above and 
appends the tuner and channel numbers to the script string, then pipes 
the script string into miranda.py.

The script looks like:
load struct_dishnet.mir
host send 2 MediaServer EchoSTB WakeUp
1
host send 2 MediaServer EchoSTB SetChannel
1
9436
exit

the bash shell command (BATCH= miranda script):
echo -e "${BATCH}" |miranda.py

The dish STB responds faster than using IR blasting, and no extra wires!
Now I can reconfigure and move my IR blaster to control the TV.

Regards,
MC


More information about the mythtv-users mailing list