Cynical network not processing responses

Posted on
Sun Dec 06, 2015 2:53 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Cynical network not processing responses

I've setup Cynical Network with my new GlobalCache GC-100 and it's sending IR and Serial fine.

What it isn't doing is receiving (or processing) any incoming response.

I've used Putty on my Windows PC to connect to the GC100 and send the commands manually, and each receives an acknowledgment. Sending a status request receives the requested data.

My TCP_Out device is set to log responses to a variable, and I've also set an Unrecognised Input trigger to toggle my study fan, but nothing is happening - no data in the variable or toggled fan.

I did notice when testing on Windows that the response doesn't include a line-ending. My LG TV requires CR line endings, which the TCP_Out device is set to append - is this why the plugin is ignoring incoming data, because there's no line-ending? If so, can I send 'CR' manually in each send-text action, then set TCP_Out to 'None'?

Any thoughts/suggestions/ideas?

Peter

Posted on
Sun Dec 06, 2015 3:53 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Cynical network not processing responses

Right, I've sorted it myself with a bit of hacking...

I found the value for CR is \x0D which I temporarily appended to the Send Text action. I could then set 'Line Endings' to None, and see single-character responses flashing up in the defined variable.

I thus was able to notice that the last character of the incoming response was always 'x' (and if I'd read that bit of LG's protocol, I would have known that).

So, I dug into the plugin files and had a nosey around.

The Line Endings are only referenced in about 8 places. The incoming line endings, I don't quite understand how they're processed - other than referencing a nice array of line ending values - so I left that alone. The outgoing (append) line endings are a one line command:
Code: Select all
self.stream.write(action.text + EOL[self.eol][0])


I therefore was able to add a new line ending of "value 'x' " to the array in both the plugin.py and the devices.xml (to deal with all incoming data ending in an 'x') and I changed the above outgoing line to specifically reference the CR line in the array, regardless of the value of self.

Code: Select all
self.stream.write(action.text + EOL['cr'][0])


The result is, all outgoing text has CR (\x0D) appended, and all incoming text that ends in 'x' is processed into the Data In variable.

Perry, if you're reading this, it would be a nice addition to allow configuration of TWO line endings in each TCP_Out device - one for sending text, and one for receiving text - for use in such examples as this?

Peter

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest