Cynical Network: Make (IP) network connections from Indigo

Posted on
Tue Jun 11, 2013 3:35 pm
henkjanvries offline
User avatar
Posts: 108
Joined: May 05, 2012

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

Hi Perry

im still trying, or rather trying again, to receive info from the onkyo. I know it works with the sending command, but as i read on the internet the onkyo sends all its info on it state. Id like to use that to have info on my media centre.

But for some reason my incoming device just keeps listening, but doesn't connect when input is received. I just dont know what to do.

could we perhaps chat about it orso?

i hope you can help me.

perhaps this links helps: http://www.wyerd.co.uk/images/onkyo_cmds.xls

at least it explains the protocol etc, but im just a noob trying to hard ;)

Posted on
Tue Jun 11, 2013 4:09 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

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

I took a quick look at that document. The framing is TCP with CRNL "line" endings, but there's no guarantee that the binary data (like the length fields) won't accidentally look like a CRNL when reading a response, which may be a problem.

The short form instructions to get started:
Set up a TCP Out device to port 60128 of the receiver. Use CRNL line endings and check the auto-connect box. It should show as connected immediately; if it doesn't, you're having networking (or receiver :-)) problems.

Next set up an unrecognized event and tell it to write the whole input into an Indigo variable.

Create an action that sends the QSTN command (query mute state). Run the action, and you should see one event for the response (I think). Examine the variable and see if it's the whole response (framing and all - it'll be wrapped with binary length fields and all that gunk).

To watch packets on the network (so you can learn what the heck is going on there :-)):
1. Open Terminal
2. Run
Code: Select all
sudo tcpdump -i enx -X port 60128
where the enx is the name of your interface - usually either en0 (Ethernet) or en1 (Wifi), though this can vary for some kinds of Macs. Leave it running.
3. Exercise your script. You'll see all the messages to and from port 60128 in the Terminal output.
4. Grab that output and try to make sense of it. :-)

Good luck!
-- perry

Posted on
Wed Jun 12, 2013 4:06 pm
henkjanvries offline
User avatar
Posts: 108
Joined: May 05, 2012

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

Ok i came closer this time.

still have control, eventhough line ending changed.

i also have a dump, but i dont really understand how to tell it to write the whole input into an Indigo variable.
what do i need to set up here.
the variable no is filled with outcount from the sending device. but that doesnt seem like a stream of output from the amp.


plus i dont get any output in terminal. it does register input, but when i control C out of it, i only get the amount the filter has seen. any idea on how to see that live?

one step closer ;)

Posted on
Thu Jun 13, 2013 12:09 am
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

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

i also have a dump, but i dont really understand how to tell it to write the whole input into an Indigo variable.
what do i need to set up here.

Set the Last line read in the device's configuration. That will write any line received to that variable.
the variable no is filled with outcount from the sending device. but that doesnt seem like a stream of output from the amp.

plus i dont get any output in terminal. it does register input, but when i control C out of it, i only get the amount the filter has seen. any idea on how to see that live?
one step closer


If you see no output from tcpdump, this means that tcpdump has seen no matching packets (unless it complains about overruns). So this either means that there really were no packets (which would be bad news), or the matching parameters are wrong. Make sure you got the interface name right and that you didn't change the port number. You can run the command without the "port 60128" part, which should produce a bunch of output if you picked the active interface (but be ready to ^C quickly in case you get overwhelmed).

Cheers
-- perry

Posted on
Thu Jun 13, 2013 6:04 am
henkjanvries offline
User avatar
Posts: 108
Joined: May 05, 2012

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

ok it had something to do with my laptop. if i try it on my macmin iserver wired with en0 i do get dumps, eventhough its not much, when i execute a action i see to things coming by in terminal. the excute command, or server to amp and a response.

right now i cant do much, but when im home ill dump what i get from pwr00, pwr01 and pwrqstn

it doesnt really matter which line-ending i use, i see with all command send and received. but nothing inputs something in a variable.

when i dump what i get in terminal, can you perhaps look at it? to me its alot of jibberish and numbers.

Posted on
Thu Jun 13, 2013 6:11 am
henkjanvries offline
User avatar
Posts: 108
Joined: May 05, 2012

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

here is what i get

im curious what the incorrect means at line 4

Code: Select all
henkjanvries:~ server$ sudo tcpdump -i en0 -X -v port 60128
tcpdump: listening on en0, link-type EN10MB (Ethernet), capture size 65535 bytes
14:07:52.447078 IP (tos 0x0, ttl 64, id 49532, offset 0, flags [DF], proto TCP (6), length 81, bad cksum 0 (->62bb)!)
10.0.1.100.62138 > 10.0.1.12.60128: Flags [P.], cksum 0x16b3 (incorrect -> 0xc2f9), seq 413566058:413566087, ack 208232126, win 8235, options [nop,nop,TS val 1235444183 ecr 541819576], length 29
   0x0000:  4500 0051 c17c 4000 4006 0000 0a00 0164  E..Q.|@.@......d
   0x0010:  0a00 010c f2ba eae0 18a6 846a 0c69 5ebe  ...........j.i^.
   0x0020:  8018 202b 16b3 0000 0101 080a 49a3 61d7  ...+........I.a.
   0x0030:  204b 82b8 4953 4350 0000 0010 0000 0008  .K..ISCP........
   0x0040:  0100 0000 2131 5057 5230 3100 7830 440d  ....!1PWR01.x0D.
   0x0050:  0a                                       .
14:07:52.447568 IP (tos 0x0, ttl 64, id 40721, offset 0, flags [DF], proto TCP (6), length 52)
    10.0.1.12.60128 > 10.0.1.100.62138: Flags [.], cksum 0xfaac (correct), ack 29, win 2896, options [nop,nop,TS val 541829274 ecr 1235444183], length 0
   0x0000:  4500 0034 9f11 4000 4006 8543 0a00 010c  E..4..@.@..C....
   0x0010:  0a00 0164 eae0 f2ba 0c69 5ebe 18a6 8487  ...d.....i^.....
   0x0020:  8010 0b50 faac 0000 0101 080a 204b a89a  ...P.........K..
   0x0030:  49a3 61d7                                I.a.
14:07:56.106640 IP (tos 0x0, ttl 64, id 35902, offset 0, flags [DF], proto TCP (6), length 81, bad cksum 0 (->97f9)!)
    10.0.1.100.62138 > 10.0.1.12.60128: Flags [P.], cksum 0x16b3 (incorrect -> 0x914b), seq 29:58, ack 1, win 8235, options [nop,nop,TS val 1235447430 ecr 541829274], length 29
   0x0000:  4500 0051 8c3e 4000 4006 0000 0a00 0164  E..Q.>@.@......d
   0x0010:  0a00 010c f2ba eae0 18a6 8487 0c69 5ebe  .............i^.
   0x0020:  8018 202b 16b3 0000 0101 080a 49a3 6e86  ...+........I.n.
   0x0030:  204b a89a 4953 4350 0000 0010 0000 0008  .K..ISCP........
   0x0040:  0100 0000 2131 5057 5230 3000 7830 440d  ....!1PWR00.x0D.
   0x0050:  0a                                       .
14:07:56.107134 IP (tos 0x0, ttl 64, id 40722, offset 0, flags [DF], proto TCP (6), length 52)
    10.0.1.12.60128 > 10.0.1.100.62138: Flags [.], cksum 0xec72 (correct), ack 58, win 2896, options [nop,nop,TS val 541829640 ecr 1235447430], length 0
   0x0000:  4500 0034 9f12 4000 4006 8542 0a00 010c  E..4..@.@..B....
   0x0010:  0a00 0164 eae0 f2ba 0c69 5ebe 18a6 84a4  ...d.....i^.....
   0x0020:  8010 0b50 ec72 0000 0101 080a 204b aa08  ...P.r.......K..
   0x0030:  49a3 6e86                                I.n.
14:07:59.838994 IP (tos 0x0, ttl 64, id 50691, offset 0, flags [DF], proto TCP (6), length 83, bad cksum 0 (->5e32)!)
    10.0.1.100.62138 > 10.0.1.12.60128: Flags [P.], cksum 0x16b5 (incorrect -> 0x1130), seq 58:89, ack 1, win 8235, options [nop,nop,TS val 1235450783 ecr 541829640], length 31
   0x0000:  4500 0053 c603 4000 4006 0000 0a00 0164  E..S..@.@......d
   0x0010:  0a00 010c f2ba eae0 18a6 84a4 0c69 5ebe  .............i^.
   0x0020:  8018 202b 16b5 0000 0101 080a 49a3 7b9f  ...+........I.{.
   0x0030:  204b aa08 4953 4350 0000 0010 0000 0008  .K..ISCP........
   0x0040:  0100 0000 2131 5057 5251 5354 4e00 7830  ....!1PWRQSTN.x0
   0x0050:  440d 0a                                  D..
14:07:59.839474 IP (tos 0x0, ttl 64, id 40723, offset 0, flags [DF], proto TCP (6), length 52)
    10.0.1.12.60128 > 10.0.1.100.62138: Flags [.], cksum 0xddc5 (correct), ack 89, win 2896, options [nop,nop,TS val 541830013 ecr 1235450783], length 0
   0x0000:  4500 0034 9f13 4000 4006 8541 0a00 010c  E..4..@.@..A....
   0x0010:  0a00 0164 eae0 f2ba 0c69 5ebe 18a6 84c3  ...d.....i^.....
   0x0020:  8010 0b50 ddc5 0000 0101 080a 204b ab7d  ...P.........K.}
   0x0030:  49a3 7b9f                                I.{.
^C
6 packets captured
9395 packets received by filter
0 packets dropped by kernel
henkjanvries:~ server$

Posted on
Thu Jun 13, 2013 10:05 am
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

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

im curious what the incorrect means at line 4

It means that tcpdump thinks some checksums in the packet are wrong. Those are packets to the receiver from whatever 10.0.1.100 is. It doesn't seem to bother the receiver though...

The replies don't look anythink like your documentation seems to say. There's no CRNL in them at all (which is why you don't get anything assigned to the variable; there's no line ending anywhere). At this point I'll just have to admit that I don't understand the message format of your receiver.

One think you can try: set the line ending to none and try to make it work explicitly. You'll need to send the CRNL yourself (use \r\n or the right 0xnn forms). At this point, Cynical Network will deliver whatever comes off the network as it arrives, and it's up to you to interpret it. Though at this point, I'll have to say that I don't really understand that format...

Cheers
-- perry

Posted on
Sat Jun 29, 2013 4:02 pm
Korey offline
User avatar
Posts: 816
Joined: Jun 04, 2008
Location: Henderson, NV

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

Perry,

Checking debug in the plugin options does not send debug data to the Log.

Plugin v1.5.1
Indigo v6.0.0b11

--
Korey

Posted on
Sat Jun 29, 2013 9:12 pm
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

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

Korey,
Checking debug in the plugin options does not send debug data to the Log.

It does here. If you disable a device and then re-enable it, do you see log lines about the device stopping and starting? If you do, what lines are you missing?

Certainly, restarting the plugin with debug enabled should print several lines to the log...

Oh, and where did you get a 6.0.0b11 from? :-)

Cheers
-- perry

Posted on
Sun Jun 30, 2013 7:31 am
Korey offline
User avatar
Posts: 816
Joined: Jun 04, 2008
Location: Henderson, NV

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

Perry The Cynic wrote:
Korey,
Checking debug in the plugin options does not send debug data to the Log.

It does here. If you disable a device and then re-enable it, do you see log lines about the device stopping and starting? If you do, what lines are you missing?

Certainly, restarting the plugin with debug enabled should print several lines to the log...

Oh, and where did you get a 6.0.0b11 from? :-)

Cheers
-- perry



I guess then I'm asking for your Debug Modules code(s).

I incorrectly assumed I would see the serial communications with debugging enabled from the IP2SL.

I'm trying to diagnose why some commands returned fill in a variable properly (Last line read), and others seem to be followed by a blank line, so the variable is blank (I can see the variable change correctly an then it's cleared).

Indigo 6 b11 (or rather a pre b11), Jay sent as a fix to a issue I was having with "Smartphone Radar" 8)

Code: Select all
Jun 30, 2013 7:19:36 AM
  Reloading plugin "Cynical Network 1.5.1"
  Stopping plugin "Cynical Network 1.5.1" (pid 43407)
  Cynical Network                 shutdown sensed
  Cynical Network                 D1 Zone 1 Volume stopping
  Cynical Network                  Anthem D1 Serial stopping
  Cynical Network                  Anthem D1 Serial is now unavailable
  Stopped plugin "Cynical Network 1.5.1"
  Starting plugin "Cynical Network 1.5.1" (pid 43444)
  Started plugin "Cynical Network 1.5.1"
  Cynical Network                 mapping device " Anthem D1 Serial" 130542549(outgoing)
  Cynical Network                  Anthem D1 Serial starting
  Cynical Network                  Anthem D1 Serial is now preparing
  Cynical Network                  Anthem D1 Serial connecting to 192.168.0.242
  Cynical Network                 mapping event "D1 Zone 1 Volume" 321270181(recognized)
  Cynical Network                 D1 Zone 1 Volume starting
  Cynical Network                 plugin starting asyn operation
  Cynical Network                  Anthem D1 Serial is now connecting
  Cynical Network                  Anthem D1 Serial configured for 1 input event(s)

Jun 30, 2013 7:21:37 AM
  Cynical Network                 mapping[org.yergeyjDoesntHaveaURL.simpleserial] " Anthem D1" 286565157
  Cynical Network                  Anthem D1 starting
Attachments
Screen Shot 2013-06-30 at 9.16.26 AM.PNG
Screen Shot 2013-06-30 at 9.16.26 AM.PNG (8.53 KiB) Viewed 4108 times

--
Korey

Posted on
Sun Jun 30, 2013 10:29 am
Perry The Cynic offline
Posts: 836
Joined: Apr 07, 2008

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

I incorrectly assumed I would see the serial communications with debugging enabled from the IP2SL.

It looks like I never put a debug message for that into Cynical Network. I'll add one for the next version. Meanwhile, as a work-around you can set Debug Modules to asyn.scan, which will log operation of the regular expression scanner that the plugin uses to decide which trigger should fire and when. It's a bit verbose, but it'll do.
I'm trying to diagnose why some commands returned fill in a variable properly (Last line read), and others seem to be followed by a blank line, so the variable is blank (I can see the variable change correctly an then it's cleared).

It's usually better to set variables for each event (not the whole device), and be as specific as possible for the regular expression of each event - only match what you know is well-formed and ditch the rest. Of course, that doesn't help if you're wondering what the remote is sending in the first place; see above.

Cheers
-- perry

Posted on
Mon Aug 26, 2013 11:24 am
henkjanvries offline
User avatar
Posts: 108
Joined: May 05, 2012

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

Hey Perry

since the release of 6 i know am able to send all commands to the receiver.
the response is still crap. any ideas.

when i send a command (volume level up or down) i see that there is a response with the volume state (in the tcpdump output). But when i try to send a request nothing returns, at least nothing readable.

right now im sending with no line endings.
auto connected
and outputting to a variable (no input tho)

with a action i send a command
ISCP\x00\x00\x00\x10\x00\x00\x00\x08\x01\x00\x00\x00!1MVLDOWN\0x0D -- this is for volume level down
partial unchecked

THIS IS AN OUTPUT AFTER A REQUEST
18:46:02.741904 IP 10.0.1.100.49304 > 10.0.1.12.60128: Flags [P.], seq 3649155885:3649155894, ack 2756263087, win 8192, options [nop,nop,TS val 646048685 ecr 43560973], length 9
0x0000: 4500 003d ffa4 4000 4006 0000 0a00 0164 E..=..@.@......d
0x0010: 0a00 010c c098 eae0 d981 b32d a449 3caf ...........-.I<.
0x0020: 8018 2000 169f 0000 0101 080a 2681 ebad ............&...
0x0030: 0298 b00d 2131 5057 5251 5354 4e ....!1PWRQSTN
18:46:02.742500 IP 10.0.1.12.60128 > 10.0.1.100.49304: Flags [.], ack 9, win 2896, options [nop,nop,TS val 43567681 ecr 646048685], length 0
0x0000: 4500 0034 4d25 4000 4006 d72f 0a00 010c E..4M%@.@../....
0x0010: 0a00 0164 eae0 c098 a449 3caf d981 b336 ...d.....I<....6
0x0020: 8010 0b50 5cca 0000 0101 080a 0298 ca41 ...P\..........A
0x0030: 2681 ebad &...

this is an output after sending a levelchange action


18:47:00.424577 IP 10.0.1.12.60128 > 10.0.1.100.49731: Flags [P.], seq 1:27, ack 1, win 2896, options [nop,nop,TS val 43573449 ecr 646090374], length 26
0x0000: 4500 004e f27f 4000 4006 31bb 0a00 010c E..N..@.@.1.....
0x0010: 0a00 0164 eae0 c243 05d8 2999 3a9c 7f56 ...d...C..).:..V
0x0020: 8018 0b50 9c4d 0000 0101 080a 0298 e0c9 ...P.M..........
0x0030: 2682 8e86 4953 4350 0000 0010 0000 000a &...ISCP........
0x0040: 0100 0000 2131 4d56 4c32 341a 0d0a ....!1MVL24...
18:47:00.424610 IP 10.0.1.100.49731 > 10.0.1.12.60128: Flags [.], ack 27, win 8233, options [nop,nop,TS val 646102288 ecr 43573449], length 0
0x0000: 4500 0034 5c52 4000 4006 0000 0a00 0164 E..4\R@.@......d
0x0010: 0a00 010c c243 eae0 3a9c 7f56 05d8 29b3 .....C..:..V..).
0x0020: 8010 2029 1696 0000 0101 080a 2682 bd10 ...)........&...
0x0030: 0298 e0c9 ....

i hope you can point me in the right direction

Who is online

Users browsing this forum: No registered users and 3 guests