JAndrassy / WiFiEspAT

Arduino networking library. Standard Arduino WiFi networking API over ESP8266 or ESP32 AT commands.
GNU Lesser General Public License v2.1
271 stars 44 forks source link

cannot set softap persistent #77

Closed atesin closed 2 years ago

atesin commented 2 years ago

hi... in my sketch i have these commands (i previously configured ap parameters)

  WiFi.setPersistent();
  WiFi.beginAP();

everything is fine, i can detect the wifi with my phone and can connect with my parameters... then as the configurarion is stored in the esp i commented these lines and reflash the sketch

but if i hard-reset the arduino+esp reconnecting power the wifi was gone... so i repeat the process with logging enabled and that is what i saw

esp INFO: begin SoftAP persistent
esp> AT+CWMODE_CUR=3 ...sent
esp> OK ...matched

i believe for persistent mode the command should be AT+CWMODE_DEF=3 instead the _CURone ... furthermore i grepped the _DEF string in all files and just found 2 lines in EspAtDrv.cpp referencing AT+CIPDNS_DEF command, nothing more... there are many persistent commands ended with _DEF present in my firmware, it is based on espressif nonos sdk ver 3.0.1 (at v1.7 custom)

lobo AT reference documentation

i have LoBo firmware and esp-01s (the tiny black 2x4 pins 2 chips esp with 1M flash), because espressif firmware didn't support passive mode transfer for 1mb chips esp-01s

JAndrassy commented 2 years ago

without _DEF it is same as _DEF in AT 1. I will check the softAP persistence

JAndrassy commented 2 years ago

SoftAP mode is not made persistent. the SoftAP settings are persistent. you can use WiFi.beginAP() without parameters to start the SoftAP with persistent settings.

atesin commented 2 years ago

SoftAP mode is not made persistent. the SoftAP settings are persistent. you can use WiFi.beginAP() without parameters to start the SoftAP with persistent settings.

that is true for AT+CWSAP_DEF... but how about AT+CWMODE_DEF=3 or 2 ??

image image

image image image

JAndrassy commented 2 years ago

beginAP doesn't change remembered CWMODE. I decided that when I was creating the library.

atesin commented 2 years ago

sorry for post before closing ..... that means that if i set AT+CWMODE_DEF externally (with an ftdi and AT commands for example), this lib will never overwrite that configuration stored on the flash ??
good to know it

JAndrassy commented 2 years ago

sorry for post before closing ..... that means that if i set AT+CWMODE_DEF externally (with an ftdi and AT commands for example), this lib will never overwrite that configuration stored on the flash ?? good to know it

I think, it will overwrite CWMODE_DEF if WiFi.begin is called with persistent true.