Closed
Description
I believe there is a bug in ESP8266WiFi.cpp when using auto reconnect. Namely, the _useClientMode and _useApMode variables need to be set in the constructor, using something like this (I add the first three lines--the fourth line was already there):
ESP8266WiFiClass::ESP8266WiFiClass()
: _smartConfigStarted(false)
, _smartConfigDone(false)
, _useApMode(false)
, _useClientMode(false)
, _useStaticIp(false)
{
uint8 m = wifi_get_opmode();
_useClientMode = (m & WIFI_STA);
_useApMode = (m & WIFI_AP_STA);
wifi_set_event_handler_cb((wifi_event_handler_cb_t)&ESP8266WiFiClass::_eventCallback);
}
Without this change, calling methods like softAP or scanNetworks will change the mode (I've been using WIFI_AP_STA). I've provided more details here (before I thought to create an issue):
Metadata
Metadata
Assignees
Labels
No labels