Sending commands to linknx from localhost works fine. I used netcat to test. No problems locally.
When I try netcat from a remote system (windows) it doesn't work.
On the linux box I verified this:
- with netstat I see that the socket connection works.
- with tcpdump I can see that the command is send correctly to the linux box.
But for some reason it doesn't make it to linknx. Nothing happens.
Any ideas?
Thanks
Manfred
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What happens if you try "telnet ip.of.linux.box 1028" on the windows pc?
Do you see something like:
C:\>telnet 192.168.0.3 1028
Connecting To 192.168.0.3...Could not open connection to the host, on port 1028: Connect failed
If you get this message, that means linknx is not accessible from the windows box. Perhaps a firewall on the linux system is blocking external access.
If not, try to type something followed by <ctrl>+d in the telnet session
You should see something like:
<error>Couldn't load document from string <ticpp.cpp@747></error>
If you see this message, linknx is working correctly and the problem is probably with netcat. Which netcat program are you using, and how does the command line look like?
Regards,
Jean-François
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Telnet to the server is successfull. At least connection doesn't fail. Sending someting followed by <ctrl>+d does not bring any response. With netstat I can verify that the session is open. This is the same behaviour I get when I use netcat from windows.
In addition I tried 2 other methods to connect to linknx from a windows machine.
The command I send is:
<write><object id='licht_arbeitszimmer' value='off'/></write>\n\4
Same result with all my tests. The socket connection works. The packets are received by the linux server, but they are not forwarded to linknx.
In the capture of your tcpdump i see a error. The command "<write><object id='licht_arbeitszimmer' value='off'/></write>" is right, but at the end you send the ASCII chars "\n\4", thats not correct. The "\4" must be send as hex char 0x04 ! A linebreak is not needed. I dont know how you can do this with telnet.
Hi,
maybe just a linux beginners problem.
Sending commands to linknx from localhost works fine. I used netcat to test. No problems locally.
When I try netcat from a remote system (windows) it doesn't work.
On the linux box I verified this:
- with netstat I see that the socket connection works.
- with tcpdump I can see that the command is send correctly to the linux box.
But for some reason it doesn't make it to linknx. Nothing happens.
Any ideas?
Thanks
Manfred
Hi,
What happens if you try "telnet ip.of.linux.box 1028" on the windows pc?
Do you see something like:
C:\>telnet 192.168.0.3 1028
Connecting To 192.168.0.3...Could not open connection to the host, on port 1028: Connect failed
If you get this message, that means linknx is not accessible from the windows box. Perhaps a firewall on the linux system is blocking external access.
If not, try to type something followed by <ctrl>+d in the telnet session
You should see something like:
<error>Couldn't load document from string <ticpp.cpp@747></error>
If you see this message, linknx is working correctly and the problem is probably with netcat. Which netcat program are you using, and how does the command line look like?
Regards,
Jean-François
Hi Jean-François,
I greatly appreciate your help.
Telnet to the server is successfull. At least connection doesn't fail. Sending someting followed by <ctrl>+d does not bring any response. With netstat I can verify that the session is open. This is the same behaviour I get when I use netcat from windows.
In addition I tried 2 other methods to connect to linknx from a windows machine.
The command I send is:
<write><object id='licht_arbeitszimmer' value='off'/></write>\n\4
Same result with all my tests. The socket connection works. The packets are received by the linux server, but they are not forwarded to linknx.
Here is a capture of tcpdump
17:42:32.132512 IP (tos 0x0, ttl 128, id 5064, offset 0, flags [DF], proto: TCP (6), length: 107) cl-mgr01h.57202 > s2.1028: P, cksum 0x7636 (correct), 1:68(67) ack 1 win 256
0x0000: 4500 006b 13c8 4000 8006 f700 c0a8 3767 E..k..@.......7g
0x0010: c0a8 370c df72 0404 0e53 ffef cc1a 11a6 ..7..r...S......
0x0020: 5018 0100 7636 0000 3c77 7269 7465 3e3c P...v6..<write><
0x0030: 6f62 6a65 6374 2069 643d 276c 6963 6874 object.id='licht
0x0040: 5f61 7262 6569 7473 7a69 6d6d 6572 2720 _arbeitszimmer'.
0x0050: 7661 6c75 653d 276f 6666 272f 3e3c 2f77 value='off'/></w
0x0060: 7269 7465 3e5c 6e5c 340d 0a rite>\n\4..
17:42:32.132841 IP (tos 0x0, ttl 64, id 36347, offset 0, flags [DF], proto: TCP (6), length: 40) s2.1028 > cl-mgr01h.57202: ., cksum 0xe4ea (correct), 1:1(0) ack 68 win 2920
0x0000: 4500 0028 8dfb 4000 4006 bd10 c0a8 370c E..(..@.@.....7.
0x0010: c0a8 3767 0404 df72 cc1a 11a6 0e54 0032 ..7g...r.....T.2
0x0020: 5010 0b68 e4ea 0000 P..h....
Nothing happens in linknx.
When I send the same commands locally on the linux box everything is fine.
Could it be that something went wrong when I compiled linknx? Do you have a binary for debian x86 available?
Thanks, Merci und Danke (I'm not sure which language you prefer ;-) )
In the capture of your tcpdump i see a error. The command "<write><object id='licht_arbeitszimmer' value='off'/></write>" is right, but at the end you send the ASCII chars "\n\4", thats not correct. The "\4" must be send as hex char 0x04 ! A linebreak is not needed. I dont know how you can do this with telnet.
Maybe this will help you: https://sourceforge.net/forum/message.php?msg_id=5541991
That's it! Thank you Ronny.
With .net you can just add +chr(4) to the string.
Now after re-reading the chapter "Interacting with Linknx" I found it documented.
Sorry to keep you busy.
No problem / kein Problem ;-)