devyte on master
fix for #6904: NodeMCU v1.0 boa… (compare)
Is anyone aware of a way to switch the channel of the ESP8266 AP without causing clients to become disconnected?
even using the raw sdk API I still get a disconnect. I'm asking as i'm trying to design a smooth experience of connecting to the AP, setting WiFi credentials, and then connecting to the wifi network. At the moment if the AP is on a different channel to the prospective network it must change first, only the client then drops the connection and reconnects to the main network. this requires you to reconnect manually back to the ESP to continue the setup. its just a bit clunky... not particularly professional.
I use this code
bool result = false;
struct softap_config * _currentconfig = new softap_config;
if (_currentconfig && wifi_softap_get_config(_currentconfig)) {
_currentconfig->channel = channel;
result = wifi_softap_set_config_current(_currentconfig);
}
maybe @igrr can enquire internally. an SDK function to switch wifi channel would be good.