Chat here is you are connecting ESP-xx type modules to existing AVR based Arduino

Moderator: igrr

User avatar
By dominator99
#50037 martinayotte

I've tried your code 'MyAPServer' & 'MyAPClient' today on 2 Adafruit Huzzah boards & the AP seems to start OK

Configuring Access Point ...
AP IP address: 192.168.4.1
HTTP server started

but the client returns:

onnecting to MyESPAP
...................
WiFi connected
IP address:
192.168.4.2
connecting to 192.168.4.1
connection failed
connecting to 192.168.4.1
connection failed
connecting to 192.168.4.1
connection failed
connecting to 192.168.4.1
connection failed
etc

I've not changed your sketches at all; any suggestions?
User avatar
By martinayotte
#50041 My examples are quite outdated, they were done one year ago.
At that time, the Arduino framework had some default behaviours which probably changed.

You need to make sure the the MyAPClient is really in STA mode only (not STA+AP).
To do that simply add "WiFi.mode(WIFI_STA);" just before the the WiFi.begin().

This will avoid the client trying to connect to itself, since 192.168.4.1 is also present on the client when the mode is WIFI_AP_STA.