espressif / esp-at

AT application for ESP32/ESP32-C2/ESP32-C3/ESP32-C6/ESP8266
Apache License 2.0
870 stars 762 forks source link

[ESP32]Periodic calling of AT+CWJAP? fails after about 3 minutes. #306

Closed OipRDDinoSaric closed 4 years ago

OipRDDinoSaric commented 4 years ago

I am using older version of ESP-AT because I communicate with ESP32 over SPI from STM32F4 and newer verions don't have SPI for ESP32 (I didn't get feedback on why it was removed). Specifically I am using this commit https://github.com/espressif/esp-at/commit/b80d4469ee2ecea93ab8bb1df03766c0ef833dd9.

My setup: STM32F4 ---SPI---> ESP32 Wrover B ---IP---> Google Chrome client Access point: TP LINK WR802N

CWJAP_INFO_RECV_TO.zip

In a zip file there is my screenshot of a logic analizator.

Err2 - CWJAP_INFO_RECV_TO - success.png shows successful call of AT+CWJAP?. Err2 - CWJAP_INFO_RECV_TO - fail - pt1.png shows failed call. Err2 - CWJAP_INFO_RECV_TO - fail - pt2.png shows time from the MISO: AT+CWJAP?\r\n to hardware restart of ESP32. (28 seconds)

Test case

STM32 connects ESP32 to an AP and opens HTTP server over AT commands using this procedure. On STM32 startup I am sending, in this order: Restart ESP32 with EN pin ESPDriver_SetAutoconnectToAPoff - AT+CWAUTOCONN=0\r\n ESPDriver_SetModeStation - AT+CWMODE=1\r\n ESPDriver_SetStationDHCPon - AT+CWDHCP=1,1\r\n ESPDriver_SetMultipleConnsOn - AT+CIPMUX=1\r\n ESPDriver_ConnectToAP AT+CWJAP=”SSID”,”PW”\r\n

After a successful connection: ESPDriver_SetmDNS - AT+MDNS=1,\"esp32\",\"_http\",80\r\n ESPDriver_SetHTTPServerOn - AT+CIPSERVER=1,80\r\n ESPDriver_SetTCPTimeoutToTen - AT+CIPSTO=10\r\n

After a successful initialization procedure, I am pooling ESP32 every 3 seconds with AT+CWJAP?\r\n to check if it lost its connection to AP to reconnect it if it has. No clients connect during this test!

Issue

The issue is that ESP32 doesn't return anything after echoing the input command after about 2-5 minutes (time is random).

Is this a known issue, or is there something to fix this?

Thanks in advance. EDIT1: Added all initalization commands I am sending. EDIT: Gave up, switched to UART with the latest version.

Luxin812 commented 4 years ago

We really cannot reproduce this phenomenon. Could you provide bin? I can try to use it to reproduce this phenomenon.

OipRDDinoSaric commented 4 years ago

Here you go. Binary files - CWJAP_INFO problem.zip

SPI pins are: MISO – GPIO13
MOSI – GPIO12
SCLK – GPIO15
CS – GPIO14
handshake – GPIO2

I edited in my initial comment with commands I am sending in the initialization.

xcguang commented 4 years ago

Sorry for the late reply, now we are still on vacation because of 2019-nCoV