Wemos D1 shows AP on boot -how to erase

Hi all,

I’ve just begun working with ESP8266’s and bought a Wemos D1 R2 board and a few barebones ESP-01 modules (along with a USB-to-serial adapter to program them).

Working with the Wemos and the barebones ESP-01 are easy enough - download the chip-specific additional files from github, select the board, and flash away. I’ve got the bog standard LED blinky and toggle-LED-through-WiFi-webserver working fine, so I know that my boards are working fine.

I’ve noticed that the Wemos board displays an access point “ESP_54F108” (snapshot attached) before it even connects to my home WiFi network. Even when the Wemos is connected to my home WiFi nework, it still hosts a parallel AP. As long as I have webserver code on the ESP8266, connecting to the AP hosted by the ESP8266 while the ESP8266 is simultaneously connected to the home WiFi netowrk redirects me to the webserver page. It doesn’t matter how many times I burn new code to the WEMOS board. In fact, it doesn’t even matter what the code is. A blinky with no WiFi header included still creates the AP (just that connecting to the AP and going to 192.168.4.1 results in a "page not found’ error).

Why is the Wemos creating an AP, despite flashing new code onto it?

I checked online, and other users have reported that the Wemos board does infact create an AP using the chip ID in the name, so this doesn’t seem like my problem alone.

I’ve fiddled with the IDE flashing settings (Erase Flash - All Flash), but that does not seem to change anything. This leads me to believe that I am somehow not wiping all the code off the SPI memory chip of the Wemos and that there is some time of residual WiFi manager type code still in the flash. Is there some ‘protected bootloader’ space on the Wemos ESP8266? Is this code built-into the bootloader of the Wemos ESP? Can I burn a new bootloader onto the ESP?

Cheers
-Rohit

https://arduino.stackexchange.com/questions/63187/esp8266-advertising-ap-even-when-flashed-with-custom-firmware/63215#63215

Thanks Juraj.

Thanks for your answer. If you don't mind, I will copy-paste the StackExchange response here as well so that things are in the same place for other users:

The Espressif ESP8266 SDK is part of every Arduino sketch for the ESP8266. The SDK handles the WiFi and other basic functions of the chip. If enabled, the SDK remembers WiFi STA and SoftAP settings and start to connect right after boot. At default it is enabled. In Arduino sketch this is controlled by WiFi.persistent(bool) and of course this setting is stored too. To clear SoftAP settings, call WiFi.softAPdisconnect(). To only turn off SoftAP, use WiFi.setMode(WIFI_STA)

This would imply that even if WiFi functions are not explicitly called by the code, or ESP8266WiFi.h is not included in the code, the WiFi-handling code still occupies space, and is written to flash every single time. Quite strange.

I guess I will have to live with just turning off the AP or forgetting the WiFi settings.

Thanks! -Rohit

rohitdesa: This would imply that even if WiFi functions are not explicitly called by the code, or ESP8266WiFi.h is not included in the code, the WiFi-handling code still occupies space, and is written to flash every single time. Quite strange.

I guess I will have to live with just turning off the AP or forgetting the WiFi settings.

it is a chip for WiFi. developed to do only WiFi. every other usage is strange