Description
The code is running in ESP8266 under Arduino ESP8266 library.
ESP8266 is working in WiFi.mode(WIFI_AP_STA). ESP is connected to both the AP network and to (an independent) Stat network. There is a WebSocketsServer working through the AP network that has 2 or 3 connected active client sockets. All this is working flawlessly.
But when the code disconnects the Stat network (WiFi.disconnect()), in which there are no sockets, the WebSocketsServer closes all connected (AP network) sockets.
Additionally, the server also closes all sockets connected through the AP network when:
-
The code tries to connect, in Station mode, to an SSID not present (WL_NO_SSID_AVAIL)
-
The code tries to connect, in Station mode, to a present SSID but using a bad pass-word (WL_CONNECT_FAILED)