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

Moderator: igrr

User avatar
By Demos Anastasakis
#23586 Awesome ! I tried your code and it works flawlessly as you say.

But the key points of how you start the AP and the STA are essentially the same.
So there must be something else in my code that is screwing things up !
Investigating ...

Thank you !!
User avatar
By martinayotte
#23588 Mainly, the AP is started by WiFi.softAP(ssid, password); and the STA is started by WiFi.begin(ssid, password);
Looking at the core lib files, there are _useApMode and _useClientMode members, both False from the constructor.
In WiFi.begin(), it sets _useClientMode to True, and since _useApMode still False, it calls mode(WIFI_STA);
On the Server side, since both still False, when WiFi.softAP() is called, it calls mode(WIFI_AP);
I don't see either why your code is not running, except that your loop() is empty ...
User avatar
By Demos Anastasakis
#23642 Sorry I didn't post all my code before.
I posted what I thought was relevant, i.e. the part where the server is started and the client tried to connect to it.

What I've discovered is wierd ! There is some interaction with the OLED connected to the server.
If I comment out the code that updates the OLED, then the ESP client connects to the server no problem.
But If I leave in the OLED update code, then the ESP client cannot connect to the servers' AP.
However, I can still connect to the server via my laptop.
I'm baffled by this !
Any suggestions ?
Thanks