Closed simonvanderveldt closed 4 years ago
I am also Interested in this. I have had the same issue. I use ESP12, and it fails to connect to some APs. Works fine with 95% of the routers I guess.
I saw another issue posted where connections were dropping out, and it was due to bad beacons, maybe related?
@tablatronix do you mean this one? #1997 I'm not seeing any exceptions though, so not sure if it's the same issue.
Oh yeah thats it, my bad. Hmm yeah not sure if the exception is related or a side effect i did find it strange that there was a problem or incompatibility that went away when the router was changed.
I raised a similar issue. I rolled back the IDE to version 2.0.0 and the problem went away. Not the idea solution but I have lost no other functionality in what I am doing.
I raised a similar issue. I rolled back the IDE to version 2.0.0 and the problem went away. Not the idea solution but I have lost no other functionality in what I am doing.
@sixbacon thanks for the pointer. Do you mean version 2.0.0 of this project (i.e. https://github.com/esp8266/Arduino/releases/tag/2.0.0) or something else? I just built the above code with that version (with some items that didn't exist back then removed) but that still gives me the same error.
I might've done something wrong though since I'm using platformio and I'm not 100% sure how to replace the framework with an older version, though after some fiddling it compiled fine.
Hi, I used the library manager in the Arduino IDE to list the available versions of the ESP8266 libarires under Info and selected 2.0.0.
Hi, I used the library manager in the Arduino IDE to list the available versions of the ESP8266 libarires under Info and selected 2.0.0.
OK, thanks for the extra info! I'll give that a try this week.
Just tried the above code using v2.0.0 from this project using the Arduino IDE, I had to comment out a couple of lines because the functions didn't exist (setAutoConnect
, setPhyMode
and getPhyMode
), erased the flash and then flashed it, but unfortunately still the same result: no SimonAP found, reconnect after 1s
Ran into this problem as well today. Interestingly enough, the esp8266 could connect to the router until I uploaded a sketch including the setPhyMode(WIFI_PHY_MODE_11B) function. After that, it would no longer connect to the router, but would still connect to a different hotspot created by my phone. I flashed another chip with the same sketch, and it has no issues connecting to the router. So far I have tried flashing the factory AT firmware on the chip and factory resetting the router- neither have worked. Please let me know if anyone else has made any progress.
i have exactly the same issue, when trying to connect to any HotSpot (created from my phone or using portable hotspot) the module connect to the hotSpot, acquire an IP but don't have any connection to Internet, using my router at home i don't have any problem... Any ideas ?
i am using #include
For a more stable connection, I use fixed parameters for IP, GATEWAY and NETMASK. Getting them via DHCP seems not to work with every Router reliable and stable.
@simonvanderveldt is this still an issue with latest git? there is also #3215 . Did you ever erase the entire flash before flashing your sketch? I see that you also had issues with the nodemcu firmware, per your comments in their repo. This makes me suspect an SDK issue, in which case there wouldn't be any possible fix to implement in this repo.
@simonvanderveldt is this still an issue with latest git? there is also #3215 . Did you ever erase the entire flash before flashing your sketch?
@devyte I tried pretty much everything, using multiple devices, entirely nuking them, etc. Nothing worked.
I see that you also had issues with the nodemcu firmware, per your comments in their repo. This makes me suspect an SDK issue, in which case there wouldn't be any possible fix to implement in this repo.
That could very well be the case. Is it somehow possible to identify if this is really and SDK issue?
So here's what I did to allow the esp8266 to reconnect to the router:
Reflash stock firmware using the nodeMCU flashing software and ESP8266_NONOS_SDK-2.1.0 .bin files
Under 'Config' in the flash software, set these files to their corresponding memory locations
File Path | Memory Location |
---|---|
ESP8266_NONOS_SDK-2.1.0\bin\esp_init_data_default.bin | 0xFC000 |
ESP8266_NONOS_SDK-2.1.0\bin\blank.bin | 0xFE000 |
ESP8266_NONOS_SDK-2.1.0\bin\boot_v1.7.bin | 0x00000 |
ESP8266_NONOS_SDK-2.1.0\bin\at\512+512\user1.1024.new.2.bin | 0x01000 |
Now, plug in the ESP8266 via FTDI, and hit flash.
Once completed, you can unplug the ESP, exit the flash software, and plug it back in.
Open Putty or some other serial comm software and set your Serial address. For me, the baud rate was 115200 but you may have to experiment.
Start by typing in AT
to verify that communication works.
To send any command, type your command, followed by enter, followed by ctrl+J. Don't know why putty requirs ctrl-J after enter, but knowing this will save you some headache.
If you get a response, you can type in AT+RST
to fully reset the device.
Next, I don't know if this is necessary, but I changed the device's hard ip and mac address. This is supposed to stick after a reboot but didn't for me. Regardless, it may have had an effect on letting the chip reconnect to the router.
AT+CIPSTAMAC_DEF="18:fe:35:98:d3:7b"
(example values)
AT+CIPSTA_DEF="192.168.0.70","192.168.6.1","255.255.255.0"
(example values)
Further commands are documented here
After all this is done, flash a normal arduino sketch and see if you can connect!
@simonvanderveldt are you sure you tried with latest git? your original post said 2.3.0, which is ancient. Some comments:
I had same problem to connect to a specific Access Point (a Chinese D-LINK!), while my ESP connects normally to other APs. In my case the problem solved by changing AP security settings, this AP was set on WPA2-PSK (AES) security mode (that I could connect to it by my PC), in this mode my ESP was unable to connect to AP. By changing this to WPA-PSK (TKIP) (or set in open mode) the ESP connected to AP. I have to mention that my ESP connects to other APs in WPA2 mode and this problem is for just this kind of AP.
In summary I could say:
Hello guys, I am facing the same problem. I have two APs at home - both are Asus wl500-gP. One has stock firmware, the second one was flashed with alternative "oleg's firmware". My iphone can connect to both of them without any problem. Some android phones refuse to connect to the AP with alternative firmware, as well as the wemos D1 board equipped with ESP-12 module. So it is probably related to the wifi configuration in your router.
Update: I did a small research on the wifi settings in router web interface and found out that following setup works with ESP8266 (use WPA-Personal with AES encryption):
@simonvanderveldt we're now on SDK 2.2+. Does this still happen?
@devyte I've long ago left the esp behind because it didn't work, maybe someone that also experienced the issues can verify if it still happens?
@gabonator @electrosaeed any feedback from you?
@devyte I am using 2.3.0 and recently had issues with Ruckus ZoneDirector 3000 Series and Ruckus R500 WAPs. Could not get it to connect. Had to giveup.
I cannot verify it right now, will try new SDK during weekend and report whether it works
Changed my WiFi AP to WPA2-Auto (AES+TKIP) and it works now! Thank you @electrosaeed very much!
I had the same problem using UBNT-APs. AES Only won't work, Auto (AES/TKIP) works. But I don't think TKIP should be used anymore. With ESPEasy_v2.0-20180319 I wasn't able to connect to the AP at all. R120 works.
I had been facing the issue that my ESP12E module would connect to some routers and not connect to others,
I really don't know whether this works for others or not, I tried with all 4 of the stand alone ESP12E modules that I have and through trial and error figured out that none of them would connect if the SSID was 4 characters or less, the moment I changed the SSID to 5 or more characters, the same ESP12E Modules would connect to the same routers without a hitch.
If any body has any knowledge about this, kindly share your information
changing mac address does no good. My ESP12 still not connect to one of my router TP-LINK with encryption WPA_WPA2_PSK. Changing this to WPA2 or WPA solves the problem any my esp can now connect to router. This should not be the only solution. looking forward for this bug fix soon.
I had problems that the ESP sometimes disconects, since I've added
the connection is more stable.
For those still struggling, this did the trick:
WiFi.persistent(false); WiFi.disconnect(true); WiFi.begin(ssid, password);
source: http://blog.flynnmetrics.com/uncategorized/esp8266-exception-3/
I had problems connecting to my Linksys WRT3200acm running OpenWRT (SNAPSHOT r7925-b6adfde).
Changing the channel, mode or width did not help. Neither did changing the SSID or encryption key.
For me turning off WMM
mode did the trick.
My code looks like this:
#include <ESP8266WiFi.h>
void setup()
{
Serial.begin(115200);
Serial.println();
uint8_t macAddr[6];
WiFi.macAddress(macAddr);
Serial.printf("mac address: %02x:%02x:%02x:%02x:%02x:%02x\n", macAddr[0], macAddr[1], macAddr[2], macAddr[3], macAddr[4], macAddr[5]);
WiFi.begin("myssid", "mypasswurdz");
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED)
{
delay(500);
Serial.printf("Connection status: %d\n", WiFi.status());
}
Serial.println();
WiFi.printDiag(Serial);
Serial.print("Connected, IP address: ");
Serial.println(WiFi.localIP());
}
void loop() {}
My Wifi settings are
Mode: N
Channel: 6
Width: 40 MHz
Transmit Power: auto
WMM Mode: disabled!!!!!!
Encryption: WPA2-PSK
Cipher: Force CCMP (AES)
Short Preamble: checked
Thanks for the great work!
Hi, I have the same configuration: Linksys WRT3200acm, running OpenWRT (LEDE 17.01.4, distrib revision r3560-79f57e422d), and multiple clones of ESP8622 claiming to be ESP12E. All the ESP8622 clones worked well with other routers, but with this version of the router, no packet would be received by the router after the (successful) connection to the WiFi network.
Disabling WMM mode on the interface solves the problem. I don't know if it is a bug of ESP8622 or of OpenWRT. I couldn't test if WMM was enabled on the other routers I tested.
reading https://github.com/kaloz/mwlwifi/issues/278 seems ESP's have an issue connecting to some (in this case Marvell 88W8x64 based) routers
one (not very satisfactory) solution is to turn WMM off, thus disabling 802.11n - which I can confirm does improve things, though I can't say if it solves them
another (not very safe) solution is to turn wifi encryption off - I didn't try this one for obvious reasons
Although the issue I linked to is with the current OpenWrt firmware, I can confirm, at least with the Linksys WRT32X, that the issue is also present in the factory firmware (which is based on an older OpenWrt anyway)
The debate continues if this is a bug in ESP or Marvell driver
seinecle commented on 7 Nov 2018>
For those still struggling, this did the trick:
WiFi.persistent(false); WiFi.disconnect(true); WiFi.begin(ssid, password);
source: http://blog.flynnmetrics.com/uncategorized/esp8266-exception-3/
This worked fine for me... thank you very much....
I am fairly certain there is a new bug causing connect issues. I have not been able to nail it down but the fix is as above to disconnect and begin, there seems to be a problem with the wifi station status sync, it imagine it could also be a race condition. I will post more details later or somewhere else
Hi All: our product currently suffering from the above issue. our device stops connecting ti the WiFi router. some of those worked for 4 weeks and then enters the state of unsuccessful WiFi connection. the resetting the device sometimes resolves the issue but always. resetting the router resolves the issue. I really need an explanation of the source of this problem. I will apply the Fix and retry again using the above fix and you all know.
Note: I have 12 000 devices in stock with that code. :)
@Khalid7777777 what wifi router did you use? Did you tried disabling WMM?
@Khalid7777777 you do not mention the last lib version you tested with or are running on these devices.
The current dev branch seems to "hold" the wifi connection much better than when I last commented 23 days ago - however, OTA updates take 5+ minutes compared to tens of seconds - so there's still something odd going on
Hi Thanks for responding: the router that we are currently testing with and can reproduce is BT Hub6. lib 2.42. however, I am currently trying using version 2.5 and still having the same problem.
the bellow fix made no change. WiFi.persistent(false); WiFi.disconnect(true); WiFi.begin(ssid, password);
to save the day I put a retry if the connection fails with bt hub however the failure is still current but more reliable. As for the root cause we are still waiting :)
The problem is with DHCP. The only way to fix the problem was with static settings
IPAddress ip(192, 168, 29, 15); IPAddress gateway(192, 168, 29, 1); IPAddress subnet(255, 255, 255, 0); IPAddress dns(8,8,8,8); WiFi.config(ip, dns, gateway, subnet) WiFi.begin(ssid, password);
I can connect my nodemcu ESP 12E dev board to my android device access point but not to my (new) home router (I belive the old router worked). Suggestions above to fix connection has not helped.
check the mode your ESP is set to and make sure it is using n,g or b modes. hope that helps
WiFi.setPhyMode( WIFI_PHY_MODE_11B ); // WIFI_PHY_MODE_11G / WIFI_PHY_MODE_11N / It returns the correct integer for the variables above when calling: WiFi.getPhyMode()
So i assume it sets the mode correctly, but I does not help. Should I try this in combination with some of the fixes previously mentioned? Any particular?
I can connect my nodemcu ESP 12E dev board to my android device access point but not to my (new) home router (I belive the old router worked).
So, what is the new router? There's some that have an issue with ESP's and the like (see my previous comments)
None of the fixes here have any effect if you have one of the routers mentioned
Please ignore my previous post. Now Wifi client code works, without any changes to the helloserver sketch, and on my new Arris router. 👍
check the mode your ESP is set to and make sure it is using n,g or b modes. hope that helps
I have ASUS router. i changed every setting mentioned above still couldn't connect to it. while i can connect to TP-LInk and netgear router. is there any new trick or setting i can use?
I was having the same symptoms. I believe my issue may have been a simpler one to fix, but I haven't seen anyone comment on this potential cause here. I will add this in hopes that it may help someone else coming across this thread as I had.
Some routers are setup to take hexadecimal values as the "password" and others are setup to take a password of characters. https://www.arduino.cc/en/Reference/WiFiBegin shows that the begin function is overloaded. You call different versions of it depending upon what type of security settings are configured on your router. All of the examples I have seen online only use one version of this function call making it appear, at a cursory glance, that there is only one version of the function.
Syntax WiFi.begin(); WiFi.begin(ssid); WiFi.begin(ssid, pass); WiFi.begin(ssid, keyIndex, key);
Parameters ssid: the SSID (Service Set Identifier) is the name of the WiFi network you want to connect to. keyIndex: WEP encrypted networks can hold up to 4 different keys. This identifies which key you are going to use. key: a hexadecimal string used as a security code for WEP encrypted networks. pass: WPA encrypted networks use a password in the form of a string for security.
My ESP8266 could see my router and my phone's hotspot with the scan code above, but could only connect to the phone until I used a different version of the begin function. Now I have gotten everything to work!
My ESP8266 could see my router and my phone's hotspot with the scan code above, but could only connect to the phone until I used a different version of the begin function. Now I have gotten everything to work!
What version do you now use?
This seems like a very specific result, and probably not related to most of this issue.
Hardware
Hardware: ESP-01 Flash Size: 512KB CPU Frequency: 80Mhz Core Version: 2.3.0 (assuming this is the version of the Arduino framework for the esp8266)
Description
I'm just doing a simple thing, namely connection to an access point, which used to work fine when using lua/nodemcu with this access point, but refuses to work using this framework. The strange thing is, it does work when I connect to my phone's Wi-Fi hotspot, but doesn't work when connecting to my regular access point (a Asus WL-500gP running Tomato).
I tried everything I could think of on the access point:
But none of them fixed the problem
Sketch
I've simplified it to just the basic steps/example code. Added the network scan so it shows that the SSID does exist and is found by the esp8266. So at the very least the debug message
no SimonAP found, reconnect after 1s
is wrong.Debug Messages