-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AP Mode does not allow connection for most devices #1094
Comments
Similar observations:
Tested: |
does it make a difference if the AP is Open or Password protected? |
It asks me for a password before not connecting. Maybe its a issue with the SDK? My running native AP code runs on SDKs 1.1.1 and there is a fix for 1.4 ("WiFi compatibility problem of special network card"). |
Since SDK 1.3, RF calibration is stored in flash. On a few occasions i had to wipe flash completely because the board failed to connect to APs. |
I will certainly try, any quick link to wiping the data? Can't seem to capture any packets on Wireshark during connection, and open vs. encrypted does not make a difference so far. |
Using esptool.py -p /dev/ttyUSB0 erase_flash Or from inside the sketch: ESP.eraseConfig(); |
Hello all, Here is a compressed wireshark capture of trying to connect to esp in AP mode. Actions taken
I still get no connections. |
Adding this to the example script has no effect: void setup() { |
P.S |
To be clear, using a password results in no packet capture, and no successful connection. |
did you tried to change the PHY mode on ESP ? like : wifi_set_phy_mode(PHY_MODE_11B); or wifi_set_phy_mode(PHY_MODE_11G); |
Adding WiFi.mode(WIFI_AP); either before or after the WiFi.softAP(ssid, password); statement has no effect. The chip is never frozen, it continues to output serial data. etc. Just refuses to connect. |
Hello, (Updated to stable Nov 30th version just to be sure) Two questions: Here is the output of WiFi.printDiag(Serial); Mode: AP |
AP do not support phy mode N and seems you are in N, that may explain the connection issue.
|
I have the default example code, why does it do N? Can I change it?
|
it is like password or SSID, it is saved / cached of course you can change, just add the command |
There does not seem to be a command to change it that I can see....
|
did you added the header to access it ?
|
Thanks for the tip, it was a good theory, but changing to either B or G has no effect on success rate of connection. In addition to that, remember that both myself and @comino had success with certain devices connection to the default example, which seems to be N. Current test code: #include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
extern "C" {
#include "user_interface.h"
}
/* Set these to your desired credentials. */
const char *ssid = "TESTAP";
const char *password = "123456789";
ESP8266WebServer server(80);
/* Just a little test message. Go to http://192.168.4.1 in a web browser
* connected to this access point to see it.
*/
void handleRoot() {
server.send(200, "text/html", "<h1>You are connected</h1>");
}
void setup() {
ESP.eraseConfig();
delay(1000);
Serial.begin(115200);
Serial.println();
Serial.print("Configuring access point...");
/* You can remove the password parameter if you want the AP to be open. */
wifi_set_phy_mode(PHY_MODE_11B);
WiFi.mode(WIFI_AP);
WiFi.softAP(ssid, password);
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);
server.on("/", handleRoot);
server.begin();
Serial.println("HTTP server started");
}
void loop() {
server.handleClient();
WiFi.printDiag(Serial);
} Result of printDiag: |
I still have the same issue. I don’t believe its a simple issue like adding a few lines of code, since its working for 50% of my devices. I tried a lot! I must be a more complex issue, maybe even with the SDK. I wait until we change to 1.5 (as said there were apparently some issues in the SDK 1.3) and if the issue consists I will investigate further. |
Still unresolved and two more Laptops unable to connect |
Any progress on this or further suspicions ? I have the same problem, eg. IOS will not join AP with error Same config output as above, changing PHY_MODE makes no difference. This only happens if i start a softap and have a saved client config and it fails to connect. So basically a If I wifi info seems the same, so it must be some other setting or RF setup that's sticking around cause some hints... ( I think i read this similar problem somewhere ) Also get this wierd stuff in debug log now and then.. |
ok well my specific problem might be fixed now. I had to explicitly disconnect before turning on AP.
Which is odd. |
This issue sounds like #1624 with different symptoms. |
So here's my reproduction sketch, this condition occurs if you do not start ap mode fast enough or don't wait long enough for it to time out. I can reproduce fairly easily with IOS, i guess it doesn't like some channels. as far as But I am at my limit of debugging /* Create a WiFi access point and provide a web server on it. */
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
/* Set these to your desired credentials. */
const char *ssid = "ESPap";
const char *password;
ESP8266WebServer server(80);
/* Just a little test message. Go to http://192.168.4.1 in a web browser
* connected to this access point to see it.
*/
void handleRoot() {
server.send(200, "text/html", "<h1>You are connected</h1>");
}
void setup() {
delay(1000);
Serial.begin(115200);
Serial.setDebugOutput(true);
Serial.println();
WiFi.setAutoConnect(false);
// WiFi.begin("nonexisting","password"); // store
WiFi.begin(); // restore
/* THESE BOTH BREAK AP JOINS FOR SOME REASON , they give time for the reconnect to start scanning if my guess ( you will see a rogue async "scandone" */
// Serial.println("connect result: " + (String)WiFi.waitForConnectResult());
delay(6000);
WiFi.printDiag(Serial);
WiFi.mode(WIFI_AP); // this stops the autoconnect
WiFi.printDiag(Serial);
Serial.println();
Serial.print("Configuring access point...");
/* You can remove the password parameter if you want the AP to be open. */
WiFi.softAP(ssid, password); // stick a channel 1 in there, and it still fails...
delay(300);
WiFi.printDiag(Serial);
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);
server.on("/", handleRoot);
server.begin();
Serial.println("HTTP server started");
}
void loop() {
server.handleClient();
} oh and the lack of a way to call |
And of course it works fine on my other device... sigh |
I had the same experience in areas with a lot of wifi networks i believe. I tried changing channels and setting WiFi.setOutputPower(20.5) and it seems to have improved the situation. |
Interesting, what is the default output power? Anyone know of any current vs. power measurements done? And power vs On Mon, Mar 14, 2016 at 7:59 PM, Sune Pedersen notifications@github.com
Ilia Baranov | Engineering Manager, Research Solutions | Clearpath Robotics 1425 Strasburg Rd., Kitchener, Ontario N2R 1H2 Canada E: ibaranov@clearpathrobotics.com | W: www.clearpathrobotics.com _Your Unmanned Experts _TM This electronic communication (including any attachments) is CONFIDENTIAL |
I also test in an area with lots of aps, 23 or so. |
I can confirm this is an issue with the esp sdk and not the arduino implementation, and can be fixed by adding wifi_station_disconnect() before changing to AP mode. |
I am new to this and am trying to RTFM before posting. Using ESPlorer and lua, I am experiencing the same difficulty with getting consistent connection to an iOS device (iPhone 5) when my ESP-12EV2 (Banggood.com) is in SoftAP mode. I have no trouble consistently connecting with OS X or Windows. I have been through so many iterations and changes that I have lost track of the threads I have been following and cannot give a concise Step A, Step B, Step C... account of my debug attempts (I must be ADD). Suffice it to say that I am flashing "write_flash -fm dio 0x00000 ../nodemcu_integer_0.9.6-dev_20150704.bin 0x3fc000 ../esp_init_data_default.bin" when necessary and trying different orders of operations of setting up the SoftAP mode. None of the different SoftAP setup sequences allows me to connect my iPhone more than once unless I power off the ESP and turn WiFi off and back on on the iPhone. Once I power cycle the ESP and turn the iPhone WiFi on and off, I can pretty much switch between my home AP and my ESP without dropping the connection. The following sequence in init.lua sort of works:
EDIT: I was too enthusiastic. Both the iPhone and the Macbook drop the WiFi connection after a couple of minutes but I can reconnect, occasionally needing to power cycle or reset the ESP and reconnect. |
It seems I've a similar issue.. I tried all the fixes mentioned above but nothing solved the problem..
Anyone has a idea to fix this? It's stanged it workes on my phone every time, but not reliable on my computers.. |
I can offer one clue. When I have my laptop connected to a physical port on the WAP, I can talk to the ESP device no problem. Web service works. When I switch the laptop to WiFi only, rnet::ERR_CONNECTION_REFUSED. So physical to WAP, WiFi to ESP: good. WiFi to WAP, WiFi to ESP: no good. Nothing shows on the ESP console that it is even having a node try and connect. |
Hi, I also faced with this problem. Any news? |
You guys are probably gonna have to post info what versions what boards and minimal reporduction sketches. No one can really debug this but id be glad to look at it to help. Have you tested latest dev code for example. |
@igrr my sketch is working excellent on esp-01 but on esp-12e I have to use ESP.eraseConfig(); always, the first time I connect to wifi, everything goes well but when I try for second time I cant so I have to use ESP.eraseConfig(); . any idea what can be causing this on esp-12e? best regards |
This is a known issue. You have to erase the flash before uploading the sketch, or call eraseConfig(), or call WiFi.disconnect(). |
So what is the solution to this issue? It sounds like ESP8266 is not up to the task of acting as an access point. |
I had the same issue as what others describe. I could mostly connect from my iPhone but very rarely from my windows PC.
|
The addition by @tablatronix (see below) has fixed my issues for using a iphone to connect to the AP. Though I did change WIFI_AP to WIFI_STA. I am using WifiManager and this was a suggestion for an older SDK.
My snippet:
|
Hello all,
Using latest staging version, RC2 from board manager.
I have two identical ESP8266-12E modules. Powered with 600mA 3.3V regulator off of USB V+
I load them both with the example WifiAccessPoint code.
I add in a Serial.println("."); into the loop to ensure they are both working.
When attempting to connect to the modules, phone has to re-connect ~3-5 times to get a connection. And then loading the example webpage at 192.168.4.1 takes ~30 seconds.
Three different models of laptops refuse to connect at all.
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: