Cynical Network: Make (IP) network connections from Indigo

Posted on
Sat Jul 07, 2012 7:48 pm
Neil Johnson offline
User avatar
Posts: 15
Joined: Jun 01, 2012

Re: Cynical Network: Make (IP) network connections from Indi

Sending text to a Sony BDP-CX7000ES via RS232.

Hello team. I am trying to send the following command (Power On) to a Sony 400 Disc Blu Ray Mega Changer through the Cynical network plugin.

Power On: \x02\x03\x80\x60\x01\x1c

I tested this first with iTest and was successful and received "0xFD 0D", which correctly turned on the Mega changer.

However, I cannot get the same result with the Cynical Network plugin. I am using a CR for the line ending with the plugin. BUT the last character is a Check Sum.

Bottom line: how do I get this Hex line working and send it to the Mega Changer. I though that the pluggin was updated to include Hex. Do you have any suggestions on how to correctly pass this hex string?

Neil Johnson
Pushing Automation to the Max

Posted on
Sat Jul 07, 2012 8:49 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Network: Make (IP) network connections from Indi

Your hex string looks syntactically correct. If this is an entirely binary protocol though, the automatically appended line ending may mess up the communications. Check the "partial" checkbox to see if that helps.

Cheers
-- perry

Posted on
Sun Jul 08, 2012 9:08 pm
Neil Johnson offline
User avatar
Posts: 15
Joined: Jun 01, 2012

Re: Cynical Network: Make (IP) network connections from Indi

I changed the "partial" checkbox as you suggested, and it works. I am now able to turn ON and OFF the Sony Blu Ray Library via RS232. However, I created a variable named SONY in Indigo to capture the response from the Blu Ray Library but I cannot seem to get any response in the variable. Any suggestions?

Neil Johnson
Pushing Automation to the Max

Posted on
Sun Jul 08, 2012 9:25 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Network: Make (IP) network connections from Indi

I changed the "partial" checkbox as you suggested, and it works. I am now able to turn ON and OFF the Sony Blu Ray Library via RS232. However, I created a variable named SONY in Indigo to capture the response from the Blu Ray Library but I cannot seem to get any response in the variable. Any suggestions?

The Cynical Network way is to specify that variable in the last line field of the network device. Did you do that?

Cynical Network processes incoming data line-by-line, where lines are defined by the line ending you set for the device. Double-check that the bytes sent by the Sony actually end with that (and note that the line ending itself won't show up in the variable). If you're really expecting to receive \xFD\x0D, and your line ending is set to CR (0x0D), then your variable should be set to a single character 0xFD, which may not actually look like much depending on how you examine it...

Also note that if you have Recognized Input events defined for that device, the actually captured text may be different from the whole "line" (it will essentially be whatever your regular expression matched).

Cheers
-- perry

Posted on
Mon Jul 09, 2012 10:14 am
Neil Johnson offline
User avatar
Posts: 15
Joined: Jun 01, 2012

Re: Cynical Network: Make (IP) network connections from Indi

Perry,

1. The Last Line field is named "SONY", indigo has a variable named "SONY". I would expect any replies to be posted here.

2. When I use iTest I get the following as a response to 02 03 80 60 01 1C (cut and pasted from iTest):
0xFD 0x0D

3. I would assume then that I would expect to receive an \xFD\x0D, so how would I set the variable to a single character OxFD?

Best Regards,
Neil

Neil Johnson
Pushing Automation to the Max

Posted on
Sun Aug 12, 2012 5:16 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Network: Make (IP) network connections from Indi

Version 1.1.0 was released today. I have changed the way the "last seen" variables work when matching input:
  • The last line received variable in a device will always receive the full text (except line ending) of each line received by the device. Note that this is a change so you may need to adjust your scripting if you use this.
  • Event triggers can now specify a separate variable that is assigned text only if its trigger has fired. It can receive either the full line seen, or some chosen part (using parentheses).

This should make the feedback variables a bit easier to work with, and add a fair amount of flexibility without complicating matters too much.

In other news, the plugin now supports plugin formulas, which means you can write arbitrary expressions to a network device using your old friend, the Send Text action. For more details on plugin formulas, see their separate thread.

On account of major changes under the hood, this release is initially a beta. Just in case. :-)

Cheers
-- perry

Posted on
Wed Aug 15, 2012 8:13 am
pgershon offline
Posts: 509
Joined: Jul 10, 2004

Re: Cynical Network: Make (IP) network connections from Indi

Trying to use to connect to my squeezebox. Starting really basic with CLI commands. I am connecting to proper IP address that I telnet into (192.168.1.103:9090). However, when I send text, I do not get the responses expected in my last line variable. For example, sending "players" returns "players count%3A2" when done with telnet using the Terminal application. Using this plugin, however, I get just a mimic of the line I sent. "players ?" returns "players %3F". Any ideas what I might be doing wrong?

Posted on
Wed Aug 15, 2012 12:01 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Network: Make (IP) network connections from Indi

Trying to use to connect to my squeezebox. Starting really basic with CLI commands. I am connecting to proper IP address that I telnet into (192.168.1.103:9090). However, when I send text, I do not get the responses expected in my last line variable. For example, sending "players" returns "players count%3A2" when done with telnet using the Terminal application. Using this plugin, however, I get just a mimic of the line I sent. "players ?" returns "players %3F". Any ideas what I might be doing wrong?

That's odd. 3F is the hex code for "?", so something is encoding the question mark and sending the resulting line to you. It's certainly not my plugin ("%" for hex isn't its thing). Double-check that you're connecting to the right thing.

If you turn on the debug checkbox in the plugin preferences, you should get a message in the Indigo log whenever a line is sent or received. That might help you figure out what's going on.

Cheers
-- perry

Posted on
Wed Aug 15, 2012 1:09 pm
pgershon offline
Posts: 509
Joined: Jul 10, 2004

Re: Cynical Network: Make (IP) network connections from Indi

Thanks. Seems to be working now. No idea what is different other than passage of time...

Actually one other question? Can I call send text and read responses within another plugin script?

Posted on
Thu Aug 16, 2012 9:43 am
pgershon offline
Posts: 509
Joined: Jul 10, 2004

Re: Cynical Network: Make (IP) network connections from Indi

I am still confused by what is happening. I have an action group that (1) sends text to the TCP port with you Send Text Plug in. (2) looks at the output variable called "LastLineSq" and writes the value to a new variable "LastLineDisplay" (3) processes "LastLineDisplay" to convert ascii received, such as "%20" to " ". Trouble is that the first time I run the action group, LastLineSq does not have a value until after the process is complete. So If I run the action group twice (assuming LastLineSq is "" to start), the first time LastLineDisplay is set to blank and the text in LastLineSq comes once everything is done. I assumed this was a delay problem so I inserted a delay between (1) and (2) above but it did not help. The text does not go into my variable until the action group has finished running. Any thought?

Posted on
Tue Apr 02, 2013 3:10 pm
henkjanvries offline
User avatar
Posts: 108
Joined: May 05, 2012

Re: Cynical Network: Make (IP) network connections from Indi

Ive got my Onkyo receiver (model tx-nr808) connected. i can send texts by string. for now just tested on and off.
But i have not got it working receiving anything from the receiver.

the input device has " listening" as state, and i've put the variable text. but nothing is received. So if i try:
ISCP\x00\x00\x00\x10\x00\x00\x00\x08\x01\x00\x00\x00!1PWRQSTN\x0D with my sending device nothing returns.
but i do know that my string works while using:
ISCP\x00\x00\x00\x10\x00\x00\x00\x08\x01\x00\x00\x00!1PWR01\x0D for on state
or
ISCP\x00\x00\x00\x10\x00\x00\x00\x08\x01\x00\x00\x00!1PWR00\x0D for off state

any ideas?

Posted on
Tue Apr 02, 2013 5:43 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Network: Make (IP) network connections from Indi

the input device has " listening" as state...

You're may be getting confused by terminology. The listening state means you've created a TCP In device that is "listening" for an incoming network connection. It is not currently connected to anything; if it was, the state would be connected.

The way you receive text with Cynical Network is by creating trigger events and matching data with regular expressions. That'll be "interesting" if what you're expecting contains binary data, but it's possible.

If you have trouble, start by creating an Unrecognized Input trigger and assign it an Indigo variable. This lets you see when/if Indigo actually receives text. Make sure you get the line ending setting right, because incoming data is separated and received by line endings. If that gives you problems, set the connection line ending to nothing; this should fire your Unrecognized Input trigger if anything at all is received. (Of course, then you have to collect the input yourself.)

Cheers
-- perry

Posted on
Wed Apr 03, 2013 12:57 pm
henkjanvries offline
User avatar
Posts: 108
Joined: May 05, 2012

Re: Cynical Network: Make (IP) network connections from Indi

if i try to make a unrecognized event, i cant choose connection. The only option is " ---invalid---" and "no selection"

any clues?

if i try recognized then i can choose the different kinds of connections i made as devices

Posted on
Wed Apr 03, 2013 3:11 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Network: Make (IP) network connections from Indi

if i try to make a unrecognized event, i cant choose connection. The only option is " ---invalid---" and "no selection"

You found a bug! (Looks like Unrecognized Input events are not terribly popular. I think I broke that months ago. :-)) I'll fix that in the next release. Meanwhile, you can achieve the same effect by creating a Recognized Input trigger for the pattern
Code: Select all
^.*$
which is regex for "anything matches".

Cheers
-- perry

Posted on
Fri Apr 26, 2013 9:13 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

Re: Cynical Network: Make (IP) network connections from Indi

if i try to make a unrecognized event, i cant choose connection. The only option is " ---invalid---" and "no selection"

Cynical Network version 1.5.0 (just posted) solves this problem.

Cheers
-- perry

Who is online

Users browsing this forum: No registered users and 3 guests