Reputation: 1284
I can't for the life of me figure out why my ESP8266s create WiFi access points.
I plug it in and send an empty sketch, and it creates an AP called "ESP_28F2F8" and here the ESP is at 192.168.4.1
.
I do not want it to create a WiFi network. I just want it to connect to one.
Has anyone else run into this issue? Is this perhaps some weird OS?
Upvotes: 0
Views: 199
Reputation: 6784
That's normal operation of the underlying Espressif's SDK. It remembers some of the settings in flash, like the last created AP and last WiFi network connected.
You need to run
WiFi.softAPdisconnect(true);
so the ESP disconnects all clients currently connected to it, disables AP and remembers it to flash.
If you might also need to disable automatic connection to the last WiFi network, you need to call:
WiFi.setAutoConnect(false);
Upvotes: 1