WiFi AP and STA active at the same time
When the ESP32 is activating it’s accesspoint and then tries to connect as a client to another WiFi AP, the connection can fail. Reported by user josmunpav in issue 653.
Possible solution is to set WiFi first into WIFI_MODE_APSTA mode first. Example initialization sequence:
WiFi.mode( WIFI_MODE_APSTA ); WiFi.softAP(wifiName, wifiPassword); WiFi.begin(connectoToWifiSSID, connectToWifiPassword);