Hey,
I am using Arduino due as client with MVC as a server that runs on my local PC.
The arduino client is polling for actions from the server every 3 seconds.
The communication works fine most of the times, but once every 10-15 seconds the client can’t get a response from the server. I know that the server is getting all the requests from the arduino(writing a log in server), and also sends back a response (with using wireshark). When a message is not received in the arduino-client, it says on the wireshark:
62148 10:37:26.515258000 192.168.1.251 192.168.1.48 HTTP 254 [TCP Retransmission] HTTP/1.1 200 OK (text/html)
and then:
62186 10:37:32.378177000 192.168.1.48 192.168.1.251 TCP 60 [TCP Dup ACK 62184#1] 49628→80 [ACK] Seq=253 Ack=1 Win=2048 Len=0
62188 10:37:32.579896000 192.168.1.48 192.168.1.251 TCP 60 [TCP Spurious Retransmission] 49628→80 [FIN, ACK] Seq=252 Ack=1 Win=2048 Len=0
62189 10:37:32.579919000 192.168.1.251 192.168.1.48 TCP 54 [TCP Dup ACK 62185#1] 80→49628 [ACK] Seq=692 Ack=253 Win=64050 Len=0
62190 10:37:32.580089000 192.168.1.48 192.168.1.251 TCP 60 [TCP Dup ACK 62188#1] 49628→80 [ACK] Seq=253 Ack=1 Win=2048 Len=0
62192 10:37:32.984329000 192.168.1.48 192.168.1.251 TCP 60 [TCP Spurious Retransmission] 49628→80 [FIN, ACK] Seq=252 Ack=1 Win=2048 Len=0
62193 10:37:32.984365000 192.168.1.251 192.168.1.48 TCP 54 [TCP Dup ACK 62185#2] 80→49628 [ACK] Seq=692 Ack=253 Win=64050 Len=0
62194 10:37:32.984545000 192.168.1.48 192.168.1.251 TCP 60 [TCP Dup ACK 62192#1] 49628→80 [ACK] Seq=253 Ack=1 Win=2048 Len=0
62195 10:37:32.984570000 192.168.1.251 192.168.1.48 HTTP 744 [TCP Retransmission] HTTP/1.1 200 OK (text/html)HTTP/1.1 400 Bad Request (text/html)
In my client i wait for chars like this:
//wait for chars to read (more than 0)
while (!client.available())
{
delay(1);
sWait++;
if (sWait>250)
{
print.MyPrintln(“No chars to read from stream”, bDebugMode);
break;
}
}
and than reads all the chars in a different loop.
I don’t know if this packet loss a normal thing on arduino as a client.
What could it be?