- Sat May 16, 2015 4:10 pm
#17590
Hi rheslip,
Thank you so much for sharing your code. I am attempting a similar setup with a GPS and some other sensors. I tried your code as posted using this release (
https://github.com/sandeepmistry/esp826 ... /tag/0.0.5) of the ESP Arduino setup.
Unfortunately the status of the AP does not seem to change once the station (my phone) connects to it. I modified the portion of the setup() call a bit to get some more debugging from it but can't find a reason for the failure:
Code: Select allvoid setup() {
Serial.begin(4800); // NMEA 0183 speed
delay(10);
// We start by setting up WiFi access point
Serial.println();
Serial.print("Setting up AP ");
Serial.println(ssid);
WiFi.mode(WIFI_AP);
WiFi.begin(ssid);//, password);
WiFi.softAP(ssid);//,password,1); // doesn't seem to set up a secure network
Serial.print("Starting AP at: "); Serial.println(WiFi.softAPIP());
WiFi.printDiag(Serial);
int x = 0;
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.print(WiFi.status());Serial.print(".");
if(x++ > 80)
{
Serial.println();
x = 0;
}
}
Serial.println("");
Serial.println("WiFi connected");
Serial.print("AP IP address: ");
Serial.println(WiFi.softAPIP());
//Serial.print("Remote IP address: ");
//Serial.println(WiFiClient.remoteIP()); // doesn't work - not sure how you get client's IP
Udp.beginPacket("192.168.4.2", 2000); // seems to always give out the next IP after its own, but this increases as more connections are made
}
The WiFi.status() method seems to relate to the station mode of the ESP and not the AP mode so it continuously reports a status of 1 (WL_NO_SSID_AVAIL) when waiting for the connection although I can see my reports being connected to humminbird with a valid IP (I can even ping 192.168.4.1).
How did you manage to get the connection working?
Here's a sample debug output of the setup() method:
Code: Select allSetting up AP humminbird
Starting AP at: 192.168.4.1
Mode: STA+AP
PHY mode: N
Channel: 1
AP id: 0
Status: 1
Auto connect: 1
SSID (10): humminbird
Passphrase (0):
BSSID set: 0
6.6.6.6.6.6.6.6.6.6.6.6.6.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.
1.1.1.1.1.1.1