adafruit / Adafruit_CircuitPython_ESP_ATcontrol

Use the ESP AT command sent to communicate with the Interwebs
MIT License
20 stars 17 forks source link

PING fails on ESP8266 #21

Closed jerryneedell closed 5 years ago

jerryneedell commented 5 years ago

the espatcontrol_simpletest.py fails on an esp8266. The ping code in adafruit_espatcontrol.py looks for the response "+PING:xx" where xx is the ping time. This is correct for the ESP32, but the ESP8266 only response with "+xx" - the "PING" is not there so the code rejects the response

ESP8266 example -- you can see the responses but no "PING"

---> AT
<--- b'\r\nOK\r\n'
---> AT+CIPSTATUS
<--- b'STATUS:2\r\n\r\nOK\r\n'
Pinging 8.8.8.8...---> AT+PING="8.8.8.8"
<--- b'+24\r\n\r\nOK\r\n'
Failed to get data, retrying
 Couldn't ping
Checking connection...
---> ATE0
<--- b'\r\nOK\r\n'
Changing baudrate to: 9600
---> AT+UART_CUR=9600,8,1,0,2

---> AT
<--- b'\r\nOK\r\n'
---> AT+CIPSTATUS
<--- b'STATUS:2\r\n\r\nOK\r\n'
Pinging 8.8.8.8...---> AT+PING="8.8.8.8"
<--- b'+25\r\n\r\nOK\r\n'
Failed to get data, retrying
 Couldn't ping
Checking connection...

esp32 example

---> AT
<--- b'\r\nOK\r\n'
---> AT+CIPSTATUS
<--- b'STATUS:2\r\n\r\nOK\r\n'
Pinging 8.8.8.8...---> AT+PING="8.8.8.8"
<--- b'+PING:39\r\n\r\nOK\r\n'
39
Checking connection...
---> ATE0