-->
Page 2 of 9

Re: P2P: ESP in AP mode and ESP in STA mode not working

PostPosted: Sat Jul 18, 2015 12:56 pm
by Demos Anastasakis
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 !!

Re: P2P: ESP in AP mode and ESP in STA mode not working

PostPosted: Sat Jul 18, 2015 1:12 pm
by martinayotte
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 ...

Re: P2P: ESP in AP mode and ESP in STA mode not working

PostPosted: Sun Jul 19, 2015 10:50 am
by Demos Anastasakis
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

Re: P2P: ESP in AP mode and ESP in STA mode not working (SOL

PostPosted: Sun Jul 19, 2015 11:26 am
by Demos Anastasakis
I just figure it out !
I had a bug in my code which resulted in an expensive loop being executed over and over which fluded the ESP...

Thanks for your help martinayotte !!