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!
Get Channel Information [DirecTV]
Re: Get Channel Information [DirecTV]
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.
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.
Re: Get Channel Information [DirecTV]
What is "Hercules" and where can I get it?
-
- Posts: 144
- Joined: Mon Jul 16, 2012 3:35 pm
- Location: New Zealand
- Contact:
Re: Get Channel Information [DirecTV]
You can find the download for Hercules in the following web-page.rrehart wrote:What is "Hercules" and where can I get it?
http://www.hw-group.com/products/hercules/index_en.html
Good luck with your project
"Setting the Standard in Quality and Commitment"
Re: Get Channel Information [DirecTV]
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?