-->
Page 6 of 9

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

PostPosted: Fri Jul 01, 2016 9:13 am
by dominator99
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?

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

PostPosted: Fri Jul 01, 2016 11:17 am
by martinayotte
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.

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

PostPosted: Fri Jul 01, 2016 4:58 pm
by dominator99
many thanks; that fixed the connection problem.

Now to get data to transfer from client to AP using multiple clients that I'm using as room temperature sensors.
I understand the max no of clients is 4; is this right?

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

PostPosted: Fri Jul 01, 2016 9:00 pm
by martinayotte
Yes, this config is the default : (see line 111 of libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp)
Code: Select allconf.max_connection = 4;

To change that, look at this recent thread : viewtopic.php?f=32&t=10620#p50023