-
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
exception(2) with WiFi.begin(...) #1856
Comments
Post your code |
#include <ESP8266WiFi.h> const char* ssid = "xxxxx"; void setup(void) Serial.println("try to connect"); while (WiFi.status() != WL_CONNECTED) { void loop(void) Printout after Boot: WeMos D1 Board Exception (2): ctx: cont
ets Jan 8 2013,rst cause:2, boot mode:(1,6) ets Jan 8 2013,rst cause:4, boot mode:(1,6) wdt reset after decode: |
Hmm, looks ok, but try a WiFi.disconnect(); first, just in case. |
I am sure ssi and password are correct. Just in case they are not, would that cause such a reaction? With Disconnect same problem. Code (only setup): Serial.println("try to connect"); while (WiFi.status() != WL_CONNECTED) { reaction: Exception (2): ctx: cont
|
If it happens even with WiFi.disconnect();, then I guess it is either a hardware problem, or maybe that board is not properly supported? |
Who knows. I got this board from China last week, it is powered via the USB line and all the code I tried worked. Even ScanNetwork works and I can receive the transmit signal of its WIFi on my phone. I don't know how I could give different power to the board. I tried a different USB entry to my PC - same problem. |
What do You mean with 'not properly supported'? |
I don't know, I mean maybe that board does something a bit different than the other boards, who knows? I think maybe contact the manufacturer? Or see if there are forums dedicated to it? |
Thank you for your help! |
Well, maybe you should try to add a cap between +5v and ground, there might be some spikes or something. I have a supercap with a voltage booster, and when I power my MCU from it, it dies when the wifi turns on. I guess the booster can't handle the spikes. If you have an oscilloscope, it would be a good idea to see what happens with the voltage when the radio starts. |
@raduprv I added 2 caps of 100 uF to 5v and 3.3v - no change. Don't have an oscilloscope, sorry.
|
There seems to be a lot of times where the flash gets corrupted by persistent saves, maybe your flash size is set wrong in ide? Which might explain why this fixes it. There are several threads of similar problems, usually manually erasing flash via esptool before uploading fixes it. Cause is unknown. Could also be insufficient power supply. |
@tablatronix My board is rather new to me, just tested it with some blink sketches like CW blink. I don't think there was excessive use of RAM. I thought about using esptool to erase RAM but it needs a lot of additional software to run it. Using WeMos D1 board powered by USB. I am content to have a running board now, but like You, I would like to know what was the reason of the whole problem. |
There is no software, you just run esptool from the hardware/esp8266/tools/ folder I dont have the erase commands on hand bit they are posted here you can search them. Flash ram not memory ram, the ssid config gets stored in flash and can get corrupted. |
I had the almost exact same problem, and for me the solution was to add hope this helps you too source: http://forum.wemos.cc/topic/99/my-solution-to-very-unstable-wifi |
That prevents saving the config, which is what causes the corruption, possibly an undiagnosed bug. |
Tracked same issue in #1997, closing this one. |
ESP.eraseConfig(); <--- use this before begin |
This just solved the problem for me! Thanks!
|
Arduino 1.6.8
Core Version: 2.1.0
Settings in IDE
Module: WeMos D1
Flash Size: ?MB/1MB
CPU Frequency: 80Mhz
Flash Mode: ??
Flash Frequency: ??
Upload Using: SERIAL
Reset Method: ??
Hello,
I am using WeMos D1 board with Arduino 1.6.8 and Software 2.1.0.
The board works nice with blink also WiFi.ScanNetworks works and gives a good result.
But whenever I use - WiFi,begin(...,...); - I get a runtime error:
Exception (2):
epc1=0x3ffe8bfc epc2=0x00000000 epc3=0x00000000 excvaddr=0x3ffe8bfc depc=0x00000000
ctx: cont
sp: 3fff0920 end: 3fff0e00 offset: 01a0
followed by a whole stack dump.
I tried different examples with WiFi.begin to connect, always the same problem.
Changing to board software 2.0.0 same problem.
Any help?
The text was updated successfully, but these errors were encountered: