These are chat archives for esp8266/Arduino

Mar 2017
Mar 13 2017 13:42 UTC

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.

Me No Dev
Mar 13 2017 14:08 UTC
? @sticilface how do you exactly imagine that to happen?
you are changing the frequency, so unless the clients know that it will be switched (and they don't) they will get dosconnected
Mar 13 2017 14:14 UTC
This is a very good point. just from experience when my home router changes channel it seems to be a lot smoother. I was thinking there might be something in the wifi protocol that can advertise a channel change before it happens....
Mar 13 2017 17:50 UTC
The protocol does allow for this, and it is implemented in the sdk, but there seems to be a bug. It was found recently by one of the nodemcu firmware developers, and a ticket was opened for expressif, but there has been no reply afaik.
Mar 13 2017 23:52 UTC
Do you have a link to it? @deveyes_twitter