Network plugin - missing data at reconnect from client

Posted on
Fri Jun 12, 2015 9:08 am
DrLove offline
Posts: 260
Joined: Dec 12, 2014
Location: Sweden

Network plugin - missing data at reconnect from client

Hi!

I'm running the Network plugin w/ an Arduino setup (Arduino Mega + ESP8266) and all is good except that the first data to or from the Arduino (as client and "new line" end) do not reach the destination after a reconnect from the Arduino until one message goes out from the plugin.

Example:
Fresh connection (TCP in listening) - tx from Arduino OK and rx from plugin OK.
Reset the Arduion - reestablish connection to the plugin (the plugin shows connected even if the connection is down for 6-7 seconds) - Arduino can't send data - send one message from plugin to Arduion - Arduino does not receive the message BUT after that com works in either direction.

Using telnet I don't get this problem, but telnet ends the session at quit and the Arduino does not, at reset.

Is this a problem on the Arduino side or plugin side, am I missing something? I could build in some watch dog feature into Indigo/Arduino but I would like not to.

Best regards, L

Love Kull (yes it's my name)
Blog (in Swedish)
Sweden

Posted on
Fri Jun 26, 2015 10:07 am
Perry The Cynic offline
Posts: 838
Joined: Apr 07, 2008

Re: Network plugin - missing data at reconnect from client

Love,

I can't tell from your description. Cynical Network doesn't "eat" data intentionally, to be sure. Its network state management is explicit - you can't send text unless the connection has been established, and at that point it throws the data over (and TCP makes sure it gets there).

Make sure you understand the line ending rules involved in your setup. Cynical Network terminates each sent text with its configured line ending (unless marked "partial"). If the Arduino code doesn't expect the same line ending conventions, confusing things may seem to happen.

Log into your Arduino and use the nc(1) command's -l (listen) option to pretend to be your Arduino program. Then use the plugin to send stuff and see what arrives. That's usually a good debugging tactic.

Cheers
-- perry

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests