-->
Page 1 of 1

TCP Client - disconnection after 10 minutes

PostPosted: Sun Nov 29, 2015 6:33 pm
by mberoldo
Hi, I´m using Arduino MEGA + ESP8266-07 with SDK v1.4.0 firmware .

My test program reads 8 analog values and sends them to Thingspeak every 15 seconds .
For this purpose, I connect ESP8266 to ThingSpeak as a TCP client using AT+CIPSTART command, then I send the data with AT+CIPSEND and finally close the TCP connection using AT+CIPCLOSE. This loop repeats every 15 seconds.

My problem is that there is a pattern: every ten minutes, after the last AT+CIPCLOSE ,ESP8266 can´t reconnect to Thingspeak for 1min 15 sec.

I know this because my program has a do while loop that looks for OK or ALREADY CONNECTED when it sends the AT+CIPSTART command, so it stays in that loop for that minute.

I have forced TCP keep alive parameter to several values in the AT+CIPSTART command without success.

Any idea of what other parameter could be changed/tested to avoid this problem?

Thanks in advance,
Marcelo

Re: TCP Client - disconnection after 10 minutes

PostPosted: Thu Jan 21, 2016 7:16 pm
by mberoldo
I found a workaround to solve this problem: I created a loop to try to reconnect several times. If AT+CIPSTART command fails (this means not receiving OK), reset the module with AT+RST and start the setup again. This has worked for me.