From fe58e9b762e457f00761f3c9f77f71a51760f45b Mon Sep 17 00:00:00 2001 From: Ron Evans Date: Tue, 18 Jun 2019 09:32:40 +0200 Subject: [PATCH] espat: use only AT commands that work on both ESP8266 and ESP32 Signed-off-by: Ron Evans --- espat/commands.go | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/espat/commands.go b/espat/commands.go index f5bd02b..1a01bee 100644 --- a/espat/commands.go +++ b/espat/commands.go @@ -42,12 +42,14 @@ const ( Disconnect = "+CWQAP" // Set softAP configuration. This also activates the ESP8266/ESP32 to act as an access point. - // The settings will not be saved in flash memory, so they will be forgotten on next reset. - SoftAPConfigCurrent = "+CWSAP_CUR" + // On the ESP8266 the settings will not be saved in flash memory, so they will be forgotten on next reset. + // On the ESP32 the settings WILL be saved in flash memory, so they will be used on next reset. + SoftAPConfigCurrent = "+CWSAP" - // Set softAP configuration as saved in flash. This also activates the ESP8266/ESP32 to act as an - // access point. The settings will be saved in flash memory, so they will be used on next reset. - SoftAPConfigFlash = "+CWSAP_DEF" + // Set softAP configuration. This also activates the ESP8266/ESP32 to act as an access point. + // On the ESP8266 the settings will not be saved in flash memory, so they will be forgotten on next reset. + // On the ESP32 the settings WILL be saved in flash memory, so they will be used on next reset. + SoftAPConfigFlash = "+CWSAP" // List station IP's connected to softAP ListConnectedIP = "+CWLIF" @@ -65,12 +67,14 @@ const ( SetStationIP = "+CIPSTA" // Set IP address of ESP8266/ESP32 when acting as access point. - // The IP address will not be saved in flash memory, so it will be forgotten on next reset. - SetSoftAPIPCurrent = "+CIPAP_CUR" + // On the ESP8266 the IP address will not be saved in flash memory, so it will be forgotten on next reset. + // On the ESP32 the IP address WILL be saved in flash memory, so it will be used on next reset. + SetSoftAPIPCurrent = "+CIPAP" // Set IP address of ESP8266/ESP32 when acting as access point. - // The IP address will be saved in flash memory, so they will be used on next reset. - SetSoftAPIPFlash = "+CIPAP_DEF" + // On the ESP8266 the IP address will not be saved in flash memory, so it will be forgotten on next reset. + // On the ESP32 the IP address WILL be saved in flash memory, so it will be used on next reset. + SetSoftAPIPFlash = "+CIPAP" ) // TCP/IP commands