请问esp8266作为softAP使用时,并且开启TCP server,一个TCP client连接AP后,4分钟没有数据传输,AP会自动断开这个client么?

朝花夕拾
Posts: 10
Joined: Fri Mar 10, 2017 9:26 am

请问esp8266作为softAP使用时,并且开启TCP server,一个TCP client连接AP后,4分钟没有数据传输,AP会自动断开这个client么?

Postby 朝花夕拾 » Fri Mar 10, 2017 2:24 pm

请问esp8266作为softAP使用时,并且开启TCP server,一个TCP client连接AP后,4分钟没有数据传输,AP会自动断开这个client么?
如下是我的AT命令log,请问最后的 0,CLOSED 的原因是什么呢?
AT
L:32 D:Ai-Thinker Technology Co. Ltd.
L:7 D:ready
AT+GMR
L:9 D:AT+GMR
L:42 D:AT version:1.1.0.0(May 11 2016 18:09:56)
L:29 D:SDK version:1.5.4(baaeaebb)
L:32 D:Ai-Thinker Technology Co. Ltd.
L:22 D:Jun 13 2016 11:29:20
L:4 D:OK
AT+CWMODE=3
L:14 D:AT+CWMODE=3
L:4 D:OK
AT+CIPMUX=1
L:14 D:AT+CIPMUX=1
L:4 D:OK
AT+CIPDINFO=1
L:16 D:AT+CIPDINFO=1
L:4 D:OK
AT+CIPSTAMAC_CUR?
L:20 D:AT+CIPSTAMAC_CUR?
L:36 D:+CIPSTAMAC_CUR:"5c:cf:7f:d0:b9:7c"
L:4 D:OK
AT+CIPAPMAC_CUR?
L:19 D:AT+CIPAPMAC_CUR?
L:35 D:+CIPAPMAC_CUR:"5e:cf:7f:d0:b9:7c"
L:4 D:OK
AT+CIPSTA_CUR?
L:17 D:AT+CIPSTA_CUR?
L:26 D:+CIPSTA_CUR:ip:"0.0.0.0"
L:31 D:+CIPSTA_CUR:gateway:"0.0.0.0"
L:31 D:+CIPSTA_CUR:netmask:"0.0.0.0"
L:4 D:OK
AT+CIPAP_CUR?
L:16 D:AT+CIPAP_CUR?
L:29 D:+CIPAP_CUR:ip:"192.168.4.1"
L:34 D:+CIPAP_CUR:gateway:"192.168.4.1"
L:36 D:+CIPAP_CUR:netmask:"255.255.255.0"
L:4 D:OK
AT+CWSAP_CUR?
L:16 D:AT+CWSAP_CUR?
L:43 D:+CWSAP_CUR:"AI-THINKER_D0B97C","",1,0,4,0
L:4 D:OK
ESP module init successfully!
AT+CIPAPMAC_CUR?
L:19 D:AT+CIPAPMAC_CUR?
L:35 D:+CIPAPMAC_CUR:"5e:cf:7f:d0:b9:7c"
L:4 D:OK
AT+CWSAP_CUR="GxxMxx-5ECF7FD0B97C","12345678",1,3,3,0
L:56 D:AT+CWSAP_CUR="GxxMxx-5ECF7FD0B97C","12345678",1,3,3,0
L:4 D:OK
AT+CWSAP_CUR?
L:16 D:AT+CWSAP_CUR?
L:53 D:+CWSAP_CUR:"GxxMxx-5ECF7FD0B97C","12345678",1,3,3,0
L:4 D:OK
Access point settings are set. You may connect to AP now
AT+CIPSERVER=1,8888
L:22 D:AT+CIPSERVER=1,8888
L:4 D:OK
wifi server enable ok!
L:11 D:0,CONNECT
Connection 0 just became active!
L:10 D:0,CLOSED
Connection 0 was just closed!

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

Re: 请问esp8266作为softAP使用时,并且开启TCP server,一个TCP client连接AP后,4分钟没有数据传输,AP会自动断开这个client么?

Postby ESP_Faye » Wed Mar 22, 2017 11:39 am

TCP server 会踢掉长时间不活跃的 client,你可以使能 TCP keep alive 功能,看是否还会断开连接呢?

感谢对 ESP8266 的关注!

Who is online

Users browsing this forum: No registered users and 2 guests