Timout immediately reconnects

mvandere
Posts: 8
Joined: Thu Jun 11, 2015 1:41 pm

Timout immediately reconnects

Postby mvandere » Tue Jun 16, 2015 8:59 am

Hi,

I'm using an ESP-12 and AT commands 25 and I am finding that when device is set as a TCP server it reconnects immediately after a timeout disconnection.

Here's a log

Code: Select all

AT+CWMODE_CUR=3


OK
AT+CWSAP_CUR="ESP8266","",5,0


OK
AT+CIFSR

+CIFSR:APIP,"142.255.49.94"
+CIFSR:APMAC,"c5:7c:fe:06:ff:ff"
+CIFSR:STAIP,"0.0.0.0"
+CIFSR:STAMAC,"00:56:52:04:32:20"

OK
AT+CIPMUX=1


OK
AT+CIPSERVER=1,1001


OK
0,CONNECT

+IPD,0,1:s
+IPD,0,1:s
+IPD,0,1:s
+IPD,0,1:s
+IPD,0,1:s0,CLOSED
0,CONNECT
0,CLOSED
0,CONNECT
0,CLOSED
0,CONNECT
0,CLOSED
0,CONNECT


The client (als an ESP-12) connected sent the noted 's' characters and then just sat there sending nothing further. The port 'closed' and immediately reconnected every three minutes (the 180 second default). Shouldn't it have stayed closed?

Thanks.

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: Timout immediately reconnects

Postby ESP_Faye » Tue Jun 16, 2015 2:10 pm

Hi,

It seems that your TCP client is trying to reconnect, not ESP8266.

Please create TCP client with another tool , for example , "NetAssist.exe" or "TCP&UDPDebug" , and try it again.

Thanks for your interest in ESP8266 !

mvandere
Posts: 8
Joined: Thu Jun 11, 2015 1:41 pm

Re: Timout immediately reconnects

Postby mvandere » Tue Jun 16, 2015 3:09 pm

The client is another ESP8266.

Is that normal for the ESP8266 to try and reconnect?

Is there a way to turn that on and off?

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: Timout immediately reconnects

Postby ESP_Faye » Tue Jun 16, 2015 4:15 pm

Hi,

What's the AT version are you using , you can get it by command "AT+GMR"

Are you using our official AT firmware (\esp_iot_sdk_v1.1.1\bin\at) ?http://bbs.espressif.com/viewtopic.php?f=5&t=554

Sorry that I can't duplicate your problem, could you offer your test steps ?
Serial-COM6 is the ESP8266 as softAP and TCP server, Serial-COM7 is another ESP8266 as station and TCP client. Here is my test result, it works fine.

Reconnect_test.png
Reconnect_test.png (21.21 KiB) Viewed 8253 times

mvandere
Posts: 8
Joined: Thu Jun 11, 2015 1:41 pm

Re: Timout immediately reconnects

Postby mvandere » Wed Jun 17, 2015 3:04 pm

Here's a log from the server with your commands

Code: Select all

AT+GMR

AT version:0.25.0.0(Jun  5 2015 16:27:16)
SDK version:1.1.1
compile time:Jun  5 2015 21:03:10

OK
AT+CWSAP_CUR="8266","88888888",5,3


OK
AT+CIPMUX=1


OK
AT+CIPSERVER=1,1112


OK
AT+CIFSR

+CIFSR:APIP,"192.168.4.1"
+CIFSR:APMAC,"1a:fe:34:a6:62:d7"
+CIFSR:STAIP,"0.0.0.0"
+CIFSR:STAMAC,"18:fe:34:a6:62:d7"

OK
AT+CIPSTO=10


OK
0,CONNECT

+IPD,0,4:12340,CLOSED
0,CONNECT

+IPD,0,4:ABCD0,CLOSED
0,CONNECT
0,CLOSED
0,CONNECT
0,CLOSED
0,CONNECT
0,CLOSED


Here's a log from the client with your commands, plus a couple of mine at the end

Code: Select all

AT+GMR

AT version:0.25.0.0(Jun  5 2015 16:27:16)
SDK version:1.1.1
compile time:Jun  5 2015 21:03:10

OK
WIFI GOT IP

OK
AT+CIPSTART="TCP","192.168.4.1",1112

CONNECT

OK
AT+CIPSEND=4


OK
>
Recv 4 bytes

SEND OK


ERROR
AT+CIPMODE=1


OK
AT+CIPSTART="TCP","192.168.4.1",1112

CONNECT

OK
AT+CIPSEND


OK

>


So it looks like it's the AT+CIPMODE=1 command that causes the client to immediately reestablish the timed out session with the server. Is that 'as designed'? If so, perhaps it should be documented in the manual?

ESP_Faye
Posts: 1646
Joined: Mon Oct 27, 2014 11:08 am

Re: Timout immediately reconnects

Postby ESP_Faye » Wed Jun 17, 2015 4:01 pm

Hi,

yes, “AT+CIPMODE=1” enter UART-WiFi passthrough mode,if connection broke,ESP8266 will always retry to connect to TCP server unless using “+++” and “AT+CIPMODE=0” to quit from UART-WiFi passthrough mode.

Thanks for your advice,we will add this description in the documentation.

Who is online

Users browsing this forum: No registered users and 5 guests