I did some more tests and this is the serial output.
When I connect to the Hotspot it does not ask for a password.
Line 25 mywifi is just a dummy <name> <password> does not excist.
--- Terminal on COM1 | 115200 8-N-1
--- Available filters and text transformations: colorize, debug, default, direct, esp32_exception_decoder, hexlify, log2file, nocontrol, printable, send_on_enter, time
--- More details at https://bit.ly/pio-monitor-filters
--- Quit: Ctrl+C | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H
[ 1040][E][WiFiGeneric.cpp:1583] hostByName(): DNS Failed for api1.chipchop.io
[ 1048][E][WiFiClient.cpp:320] setSocketOption(): fail on -1, errno: 9, "Bad file number"
ChipChop => Waiting to establish socket connection
ChipChopPluginsManager::start
LittleFS started
fileSystemOK: 1
3
Keep Alive => ChipChop socket is closed...starting monitoring
Configuring access point...
AP IP address: 8.8.8.8
HTTP server started
Credentials_loaded
Updating credentials
Networks found: #Omni20_Setup_1BC#Afrihost LTE MDB#Mfundo Wifi#HUAWEI-B315-2690#
mywifi
<ssid name>
Connecting to wifi...mywifi
Connection response: 1
Keep Alive => ChipChop socket is closed...starting monitoring
Networks found: #
mywifi
<ssid name>
Trying to reconnect
Keep Alive => ChipChop socket is closed...starting monitoring
Networks found: #
mywifi
<ssid name>
//=========Stop here until Phone connects to Hotspot====================
//========When Phone connects to Hotspot================================
[]
[162939][E][WiFiClient.cpp:429] write(): fail on fd 50, errno: 104, "Connection reset by peer"
[]
[]
[170989][E][WiFiClient.cpp:429] write(): fail on fd 50, errno: 104, "Connection reset by peer"
[171411][E][WebServer.cpp:638] _handleRequest(): request handler not found
[]
[]
[171482][E][WiFiClient.cpp:429] write(): fail on fd 50, errno: 104, "Connection reset by peer"
[]
[176435][E][WebServer.cpp:638] _handleRequest(): request handler not found
[]
[]
[176523][E][WiFiClient.cpp:429] write(): fail on fd 50, errno: 104, "Connection reset by peer"
Trying to reconnect
Keep Alive => ChipChop socket is closed...starting monitoring
Networks found: #
mywifi
<ssid name>
[]
[]
[181240][E][WiFiClient.cpp:429] write(): fail on fd 50, errno: 104, "Connection reset by peer"
[181253][E][WebServer.cpp:638] _handleRequest(): request handler not found
[]
[181363][E][WiFiClient.cpp:429] write(): fail on fd 50, errno: 104, "Connection reset by peer"
[181377][E][WebServer.cpp:638] _handleRequest(): request handler not found
[]
[]
[181746][E][WiFiClient.cpp:429] write(): fail on fd 50, errno: 104, "Connection reset by peer"
Closing Portal
Trying to reconnect
Keep Alive => ChipChop socket is closed...starting monitoring
Networks found: #
mywifi
<ssid name>
restarting portal
//=========Hotspot dissconects from Phone===============================