Get Channel Information [DirecTV]

Forum to ask for any help
Post Reply
rrehart
Posts: 44
Joined: Thu Sep 06, 2012 12:08 am

Get Channel Information [DirecTV]

Post by rrehart » Wed Jan 01, 2014 11:49 pm

I am trying to get and display specific channel information from my direcTV receiver. I can get the information via the 'send data to a website' action:
http://<receiver IP>:8080/tv/getTuned

Returning:
{
"callsign": "NFLHD",
"date": "20131231",
"duration": 3600,
"episodeTitle": "Vince Lombardi, Part 2",
"isOffAir": false,
"isPclocked": 3,
"isPpv": false,
"isRecording": false,
"isVod": false,
"major": 212,
"minor": 65535,
"offset": 2497,
"programId": "11408688",
"rating": "No Rating",
"startTime": 1388613600,
"stationId": 3900923,
"status": {
"code": 200,
"commandResult": 0,
"msg": "OK.",
"query": "/tv/getTuned"
},
"title": "A Football Life"
}

But I have no idea how to get (in this instance) the result of "callsign": - which is "NFLHD" and display it in a label.

I have tried setting up the receiver as a device, specifying "GET /tv/getTuned HTTP1.1\x0d\x0a" as a command (and having that command run on startup), then configuring two-way feedback to condition: feedback matches a pattern, data: "callsign": "(.*)", -> [CurrentChannelInfo] label to no avail.

I telnet'd to the receiver from Windows and issued the same "GET /tv/getTuned HTTP1.1\x0d\x0a" command, and saw it error. So I removed the \x0d\x0a and it worked. So I removed that from my command in Demopad, and still got nothing back.

I am at a loss. Anyone have any idea how to Get the channel info to show up in a label??? HELP!

User avatar
DemoPad
Site Admin
Posts: 770
Joined: Thu Jun 14, 2012 10:46 am
Contact:

Re: Get Channel Information [DirecTV]

Post by DemoPad » Sat Jan 11, 2014 11:16 am

You are correct to use a device, rather than the 'send data to website' action type. The trick is to make sure the command is correct (uppercase always for hex chars, eg \x0D\x0A) and to use the feedback module to parse the returned data into a label.

Suggest using Hercules to send the command (Hercules uses $xx format for hex!), and inspect the actual data coming back - in particular, show hex chars to work out if each line is separated by a hex 0A, or hex 0D (which then needs to be the response terminator), then use something like:

"episodeTitle": "(.*)",

As a regex pattern to assign the result to a label.

rrehart
Posts: 44
Joined: Thu Sep 06, 2012 12:08 am

Re: Get Channel Information [DirecTV]

Post by rrehart » Sat Jan 11, 2014 8:52 pm

What is "Hercules" and where can I get it?

Idealhomes
Posts: 144
Joined: Mon Jul 16, 2012 3:35 pm
Location: New Zealand
Contact:

Re: Get Channel Information [DirecTV]

Post by Idealhomes » Sat Jan 11, 2014 9:03 pm

rrehart wrote:What is "Hercules" and where can I get it?
You can find the download for Hercules in the following web-page.

http://www.hw-group.com/products/hercules/index_en.html

Good luck with your project :D
"Setting the Standard in Quality and Commitment"

rrehart
Posts: 44
Joined: Thu Sep 06, 2012 12:08 am

Re: Get Channel Information [DirecTV]

Post by rrehart » Mon Sep 22, 2014 10:38 pm

I got hercules and verified the code was coming back correctly. What I don't know how to do is 'scrape' the returned page for the info to set into a label. Any ideas?

Post Reply