Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DirecTV Set Top Box (Ethernet)
#21
eded9698 Wrote:I spoke to soon. I change the channel a couple of times and now it losing connection again.

Are you getting the same error in log? Does it eventually connect?

If you can get it connected, set debugmode to true, and then try to get it to do it again. Post the resulting output file that is generated under /Macrofileroot.

EDIT: Nevermind - I am seeing the issue too. I am looking into it...
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#22
Ok, I am at a complete loss trying to figure out why that exception is happening. I thought I was overrunning my buffer so I upped that, but apparently that wasn't the cause and the fact that it worked for me was a fluke (or maybe because I upgraded from 3.4.4 to 3.4.5?).

Anyway, the driver sends 3 different HTTP requests on startup. The first one to get the version, works fine. The second throws the exception every time. Exception 0 - The socket is not currently connected. This is coming from the HTTP class, and if I try to configure the driver to eat the exception, I get no data back to parse. About the only thing I can think of to do is to drop the HTTP class and just use sockets. I don't know if this is related to the fact that the DTV box closes the connection down on the last pack in the response, but it does the same thing on the GetVersion reply as well.

In the sniffer I see no difference between a getVersion and getTuned except that getTuned is returning more data.

The only changes I made from when it was working was to upgrade from 3.3.x to 3.4.4. Although it is possible DTV pushed an update, but I don't see anything in the traces that point to a problem.

Edit: Hmmm. The driver runs fine against my other DTV box. I guess I need to dig a little deeper... Maybe a timing issue in the HTTP class???
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#23
If the box closes the socket but doesn't set the linger, the client will not necessarily be able to read the information sent. Normally it either sends the number of bytes to expect, in which case the HTTP client reads that many bytes or tries to. Or, it doesn't indicate how many and the client has to read until it gets zero bytes back, at which time it considers itself done. Any further attempt to read from the socket after that zero return would cause the 'other side closed' error, because now it's really closed and completed. So, in either case, if the other side doesn't linger the socket after closing, then it could get dropped on the box's side before you can read it all, though it's probably more likely in the read till done scenario.

Is it sending expected reply size info in the header lines or no size/zero size and expecting the client to just read until it gets no more bytes?
Dean Roddey
Software Geek Extraordinaire
Reply
#24
If you get a new version up that doesn't have that source/target thing, I can try connecting again and see what I can see.
Dean Roddey
Software Geek Extraordinaire
Reply
#25
Ok, i'll post that. I got that fixed in the code I am running now. So during my testing both DTV boxes started working. The only difference I can see is the inter-packet timing thing again and the amount of data being returned. Here is a quick synopsis, the numbers in ()'s are the timing, the other packets were insignificant so I didn't record them <.000 secs:

EDIT: OK 1.2 is up there with the fix for the recursive ExtractUpTo

Code:
Server<--->DirecTV

---------- GOOD ------------------------------
--> SYN
<-- SYN ACK
--> ACK
--> GET /tv/getTuned HTTP/1.0
<-- ACK
<-- (.149s) HTTP/1.0 200 OK
<-- (.008s) 882 Bytes Data (FIN/PSH/ACK)
--> ACK
--> FIN/ACK
<-- ACK

---------- BAD ------------------------------
--> SYN
<-- SYN ACK
--> ACK
--> GET /tv/getTuned HTTP/1.0
<-- ACK
<-- (.407s) HTTP/1.0 200 OK
<-- (.009s) 1152 Bytes Data (FIN/PSH/ACK)
--> ACK
--> FIN/ACK
<-- ACK
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#26
Here is the log from 1.2.

PHP Code:
-----------------------------------------------------------------
10:41:21 AM Begin Log DumpDirecTV Set Top Box (Ethernet)
-----------------------------------------------------------------
12/11/10 10:41:25.991 - -----------------------------------------------------------------
12/11/10 10:41:25.991 Poll:
12/11/10 10:41:25.991 - -----------------------------------------------------------------
12/11/10 10:41:25.991 GetTunerInfoGetting Info...
12/11/10 10:41:25.991 SendGetUrl=http://192.168.1.90:8080/tv/getTuned
12/11/10 10:41:26.257 SendGetException 0 The socket is not currently connectedUrl=http://192.168.1.90:8080/tv/getTuned Ignore.
12/11/10 10:41:26.257 GetTunerInfoRequest Failed.
12/11/10 10:41:26.257 PollGetTunerInfo Failed (2 of 3)
12/11/10 10:41:31.257 - -----------------------------------------------------------------
12/11/10 10:41:31.257 Poll:
12/11/10 10:41:31.257 - -----------------------------------------------------------------
12/11/10 10:41:31.257 GetTunerInfoGetting Info...
12/11/10 10:41:31.257 SendGetUrl=http://192.168.1.90:8080/tv/getTuned
12/11/10 10:41:31.804 SendGetException 0 The socket is not currently connectedUrl=http://192.168.1.90:8080/tv/getTuned Ignore.
12/11/10 10:41:31.804 GetTunerInfoRequest Failed.
12/11/10 10:41:31.804 PollGetTunerInfo Failed (3 of 3)
12/11/10 10:41:31.804 Max Failures ReachedReconnecting.
12/11/10 10:42:01.804 - -----------------------------------------------------------------
12/11/10 10:42:01.804 ConnectConnecting to 192.168.1.90...
12/11/10 10:42:01.804 - -----------------------------------------------------------------
12/11/10 10:42:01.804 GetVersionGetting Version...
12/11/10 10:42:01.804 SendGetUrl=http://192.168.1.90:8080/info/getVersion
12/11/10 10:42:02.38 SendGetGot Response 107 Bytes
12
/11/10 10:42:02.38 - {
  
"status": {
    
"code"200,
    
"msg""OK",
    
"query""/info/getVersion"
  
},
  
"version""1.0"
}
12/11/10 10:42:02.38 GetParmGroupstatus Parmcode
12
/11/10 10:42:02.38 GetParmFound Group "status"at index 14
12
/11/10 10:42:02.38 GetParmLooking for status_code
12
/11/10 10:42:02.38 GetParmFound "code"at index 5
12
/11/10 10:42:02.38 GetParmValue is 200
12
/11/10 10:42:02.38 GetParmGroupstatus Parmmsg
12
/11/10 10:42:02.38 GetParmFound Group "status"at index 14
12
/11/10 10:42:02.38 GetParmLooking for status_msg
12
/11/10 10:42:02.38 GetParmFound "msg"at index 22
12
/11/10 10:42:02.38 GetParmValue is OK
12
/11/10 10:42:02.38 SendGetResponse is 200OK
12
/11/10 10:42:02.38 GetParmLooking for version
12
/11/10 10:42:02.38 GetParmFound "version"at index 17
12
/11/10 10:42:02.38 GetParmValue is 1.0
12
/11/10 10:42:02.38 GetVersionCommandVersion is 1.0
12
/11/10 10:42:07.38 - -----------------------------------------------------------------
12/11/10 10:42:07.38 Poll:
12/11/10 10:42:07.38 - -----------------------------------------------------------------
12/11/10 10:42:07.38 GetTunerInfoGetting Info...
12/11/10 10:42:07.38 SendGetUrl=http://192.168.1.90:8080/tv/getTuned
12/11/10 10:42:07.226 SendGetException 0 The socket is not currently connectedUrl=http://192.168.1.90:8080/tv/getTuned Ignore.
12/11/10 10:42:07.226 GetTunerInfoRequest Failed.
12/11/10 10:42:07.226 PollGetTunerInfo Failed (1 of 3)
12/11/10 10:42:12.226 - -----------------------------------------------------------------
12/11/10 10:42:12.226 Poll:
12/11/10 10:42:12.226 - -----------------------------------------------------------------
12/11/10 10:42:12.226 GetTunerInfoGetting Info...
12/11/10 10:42:12.226 SendGetUrl=http://192.168.1.90:8080/tv/getTuned
12/11/10 10:42:12.804 SendGetException 0 The socket is not currently connectedUrl=http://192.168.1.90:8080/tv/getTuned Ignore.
12/11/10 10:42:12.804 GetTunerInfoRequest Failed.
12/11/10 10:42:12.804 PollGetTunerInfo Failed (2 of 3)
12/11/10 10:42:17.819 - -----------------------------------------------------------------
12/11/10 10:42:17.819 Poll:
12/11/10 10:42:17.819 - -----------------------------------------------------------------
12/11/10 10:42:17.819 GetTunerInfoGetting Info...
12/11/10 10:42:17.819 SendGetUrl=http://192.168.1.90:8080/tv/getTuned
12/11/10 10:42:18.54 SendGetException 0 The socket is not currently connectedUrl=http://192.168.1.90:8080/tv/getTuned Ignore.
12/11/10 10:42:18.54 GetTunerInfoRequest Failed.
12/11/10 10:42:18.54 PollGetTunerInfo Failed (3 of 3)
12/11/10 10:42:18.54 Max Failures ReachedReconnecting.
12/11/10 10:42:48.54 - -----------------------------------------------------------------
12/11/10 10:42:48.54 ConnectConnecting to 192.168.1.90...
12/11/10 10:42:48.54 - -----------------------------------------------------------------
12/11/10 10:42:48.54 GetVersionGetting Version...
12/11/10 10:42:48.54 SendGetUrl=http://192.168.1.90:8080/info/getVersion
12/11/10 10:42:48.241 SendGetGot Response 107 Bytes
12
/11/10 10:42:48.241 - {
  
"status": {
    
"code"200,
    
"msg""OK",
    
"query""/info/getVersion"
  
},
  
"version""1.0"
}
12/11/10 10:42:48.241 GetParmGroupstatus Parmcode
12
/11/10 10:42:48.241 GetParmFound Group "status"at index 14
12
/11/10 10:42:48.241 GetParmLooking for status_code
12
/11/10 10:42:48.241 GetParmFound "code"at index 5
12
/11/10 10:42:48.241 GetParmValue is 200
12
/11/10 10:42:48.241 GetParmGroupstatus Parmmsg
12
/11/10 10:42:48.241 GetParmFound Group "status"at index 14
12
/11/10 10:42:48.241 GetParmLooking for status_msg
12
/11/10 10:42:48.241 GetParmFound "msg"at index 22
12
/11/10 10:42:48.241 GetParmValue is OK
12
/11/10 10:42:48.241 SendGetResponse is 200OK
12
/11/10 10:42:48.241 GetParmLooking for version
12
/11/10 10:42:48.241 GetParmFound "version"at index 17
12
/11/10 10:42:48.241 GetParmValue is 1.0
12
/11/10 10:42:48.241 GetVersionCommandVersion is 1.0
12
/11/10 10:42:53.241 - -----------------------------------------------------------------
12/11/10 10:42:53.241 Poll:
12/11/10 10:42:53.241 - -----------------------------------------------------------------
12/11/10 10:42:53.241 GetTunerInfoGetting Info...
12/11/10 10:42:53.241 SendGetUrl=http://192.168.1.90:8080/tv/getTuned
12/11/10 10:42:53.757 SendGetException 0 The socket is not currently connectedUrl=http://192.168.1.90:8080/tv/getTuned Ignore.
12/11/10 10:42:53.757 GetTunerInfoRequest Failed.
12/11/10 10:42:53.757 PollGetTunerInfo Failed (1 of 3)
12/11/10 10:42:58.757 - -----------------------------------------------------------------
12/11/10 10:42:58.757 Poll:
12/11/10 10:42:58.757 - -----------------------------------------------------------------
12/11/10 10:42:58.757 GetTunerInfoGetting Info...
12/11/10 10:42:58.757 SendGetUrl=http://192.168.1.90:8080/tv/getTuned
12/11/10 10:42:58.929 SendGetException 0 The socket is not currently connectedUrl=http://192.168.1.90:8080/tv/getTuned Ignore.
12/11/10 10:42:58.929 GetTunerInfoRequest Failed.
12/11/10 10:42:58.929 PollGetTunerInfo Failed (2 of 3)
12/11/10 10:43:03.929 - -----------------------------------------------------------------
12/11/10 10:43:03.929 Poll:
12/11/10 10:43:03.929 - -----------------------------------------------------------------
12/11/10 10:43:03.929 GetTunerInfoGetting Info...
12/11/10 10:43:03.929 SendGetUrl=http://192.168.1.90:8080/tv/getTuned
12/11/10 10:43:04.444 SendGetException 0 The socket is not currently connectedUrl=http://192.168.1.90:8080/tv/getTuned Ignore.
12/11/10 10:43:04.444 GetTunerInfoRequest Failed.
12/11/10 10:43:04.444 PollGetTunerInfo Failed (3 of 3)
12/11/10 10:43:04.444 Max Failures ReachedReconnecting.
12/11/10 10:43:34.444 - ----------------------------------------------------------------- 
Reply
#27
Ok, I think I have found a pattern. This particular exception (not the same as the no colon separator one) started appearing when I upgraded to 3.4.4. It appears to be related to packet size of the 3rd (data) packet sent from the DTV box. Adjusting the buffers size, which I thought fixed it was a fluke, I must have changed the channel between tests or the program info changed on me causing the packet size to drop below the critical limit.

So to summarize, the DTV box sends the response in 3 packets. A quick ACK, a short HTTP 200 OK packet with a delay, and then the final JSON data packet. It is this third data's size that seems to trigger the exception, something in the low 1000 bytes, something between 1062 bytes and 1090 bytes on the 3rd data packet. Of course the total response you will see in CQC would include the HTTP header info, so add another 100 bytes or so to that.

Code:
[b]Exception 0/Not Working Samples[/b]
[b]ACKTime    HTTPOK    Data    Data(bytes)[/b]
.0008    .151390        1196
.0008    .480467        1393
.0008    .121488        1433
.0008    .125169    .006471    1135
.0008    .144087    .011068    [Color=Red]1090 <---Low[/Color]
.0008    .136545    .006002    1207
.0008    .171151    .011092    1317

[b]Working/No Exception[/b]
[b]ACKTime    HTTPOK    Data    Data(bytes)[/b]
.0008    .363008        1010
.0008    .122348        1029
.0008    .175351        928
.0008    .137122        837
.0008    .323169    .007814    837
.0008    .153307    .005634    817
.0008    .156956    .006570 924
.0008    .146240    .008527    958
.0008    .354391    .017122    [Color=Red]1062 <---High[/Color]
.0008    .225743    .006322    953
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply
#28
Well, it's suspiciously close to what may be the MTU size for the network, when you include the other overhead of the packet. But it would seem pretty odd if the requirement to break the TCP message into multiple IP packets would make any difference.
Dean Roddey
Software Geek Extraordinaire
Reply
#29
OK, I may see what's the deal. Let me send you another DLL to test.
Dean Roddey
Software Geek Extraordinaire
Reply
#30
Dean Roddey Wrote:Well, it's suspiciously close to what may be the MTU size for the network, when you include the other overhead of the packet. But it would seem pretty odd if the requirement to break the TCP message into multiple IP packets would make any difference.

Well I don't think it's illegal to break it up, but it isn't a common thing to do. They obviously have written their own cheesy HTTP server to support this. I will keep a lookout for the DLL.

I guess the good news is, in future versions of their protocol they are going to start sending less info (that's why I didn't implement a lot of data fields in this driver, that exist today in the output). So if we don't fix it in a few months it may fix itself... Smile
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Control Internet TVs with ethernet port bryanb 3 2,676 04-08-2011, 02:08 PM
Last Post: znelbok
  DIRECTV GenII Enhancements ToyMaster458 175 26,113 09-30-2010, 07:22 AM
Last Post: George M

Forum Jump:


Users browsing this thread: 1 Guest(s)