Description
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?
Activity
raduprv commentedon Apr 4, 2016
Post your code
wkraus commentedon Apr 4, 2016
#include <ESP8266WiFi.h>
const char* ssid = "xxxxx";
const char* password = "xxxxx";
void setup(void)
{
delay(3000);
Serial.begin(115200);
Serial.println("WeMos D1 Board");
Serial.println("try to connect");
WiFi.begin(ssid,password);
Serial.print("Connecting to ");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to: ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
Serial.println("");
}
void loop(void)
{
}
Printout after Boot:
WeMos D1 Board
try to connect
Exception (2):
epc1=0x3ffe8444 epc2=0x00000000 epc3=0x00000000 excvaddr=0x3ffe8444 depc=0x00000000
ctx: cont
sp: 3ffef7d0 end: 3ffefca0 offset: 01a0
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:
Decoding 28 results
0x40107020: printf at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/libc_replacements.c line 206
0x4010031d: check_poison at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266\umm_malloc/umm_malloc.c line 817
0x40100426: check_poison_block at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266\umm_malloc/umm_malloc.c line 851
0x40100537: check_poison_all_blocks at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266\umm_malloc/umm_malloc.c line 880
0x401006f5: calloc at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266\umm_malloc/umm_malloc.c line 1667
0x4010724c: pvPortZalloc at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/heap.c line 33
0x4022427d: wifi_param_save_protect_with_check at ?? line ?
0x40105ea2: spi_flash_read at ?? line ?
0x40224365: system_param_save_with_protect at ?? line ?
0x40224754: wifi_station_ap_number_set at ?? line ?
0x402248af: wifi_station_ap_number_set at ?? line ?
0x4022493c: wifi_station_ap_number_set at ?? line ?
0x40224978: wifi_station_set_config at ?? line ?
0x402027ba: ESP8266WiFiSTAClass::begin(char const_, char const_, int, unsigned char const_, bool) at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\libraries\ESP8266WiFi\src/ESP8266WiFiSTA.cpp line 635
0x402026fa: ESP8266WiFiSTAClass::begin(char const_, char const_, int, unsigned char const_, bool) at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\libraries\ESP8266WiFi\src/ESP8266WiFiSTA.cpp line 635
0x401006d8: malloc at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266\umm_malloc/umm_malloc.c line 1658
0x402021bd: uart_init at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/uart.c line 336
0x40202d64: esp_yield at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/core_esp8266_main.cpp line 43
0x40224196: wifi_set_broadcast_if at ?? line ?
0x402035e0: Print::write(unsigned char const_, unsigned int) at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/Print.cpp line 42
0x40202cc1: Print::write(char const_) at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/Print.h line 60
0x40202cc1: Print::write(char const*) at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/Print.h line 60
0x402036b8: Print::println() at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/Print.cpp line 144
0x402010ae: delay at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/core_esp8266_wiring.c line 70
0x40202410: setup at C:\Users\Werner\AppData\Local\Temp\arduino_modified_sketch_602007/D1_DHT_Server_kurz.ino line 15
0x40202da4: loop_wrapper at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/core_esp8266_main.cpp line 43
0x40100958: cont_norm at C:\Users\Werner\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0\cores\esp8266/cont.S line 109
raduprv commentedon Apr 4, 2016
Hmm, looks ok, but try a WiFi.disconnect(); first, just in case.
Are you sure the ssid and password are correct? Did you try to connect to a different network? Like, maybe create one with your phone.
wkraus commentedon Apr 4, 2016
I am sure ssi and password are correct. Just in case they are not, would that cause such a reaction?
Didn't try a different network yet but that's an interesting idea. Will think about that.
With Disconnect same problem.
Code (only setup):
void setup(void)
{
delay(3000);
Serial.begin(115200);
Serial.println("WeMos D1 Board");
Serial.println("disconnect");
WiFi.disconnect();
Serial.println("try to connect");
WiFi.begin(ssid,password);
Serial.print("Connecting to ");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.print("Connected to: ");
Serial.println(ssid);
Serial.print("IP address: ");
Serial.println(WiFi.localIP());
Serial.println("");
}
reaction:
WeMos D1 Board
disconnect
Exception (2):
epc1=0x3ffe8450 epc2=0x00000000 epc3=0x00000000 excvaddr=0x3ffe8450 depc=0x00000000
ctx: cont
sp: 3ffef860 end: 3ffefcb0 offset: 01a0
raduprv commentedon Apr 4, 2016
If it happens even with WiFi.disconnect();, then I guess it is either a hardware problem, or maybe that board is not properly supported?
is it properly powered and everything?
wkraus commentedon Apr 4, 2016
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.
wkraus commentedon Apr 4, 2016
What do You mean with 'not properly supported'?
raduprv commentedon Apr 4, 2016
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?
wkraus commentedon Apr 4, 2016
Thank you for your help!
Seems the board is not original WeMos. I am waiting for a D1 mini I ordered directly from WeMos and hope it will work better.
raduprv commentedon Apr 7, 2016
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.
wkraus commentedon Apr 7, 2016
@raduprv I added 2 caps of 100 uF to 5v and 3.3v - no change. Don't have an oscilloscope, sorry.
But I found this post:
http://forum.wemos.cc/topic/99/my-solution-to-very-unstable-wifi
Adding
Thanks for your help.
tablatronix commentedon Apr 8, 2016
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.
wkraus commentedon Apr 8, 2016
@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.
tablatronix commentedon Apr 8, 2016
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 mean make sure you have the right flash chip size selected.
smj135 commentedon Apr 19, 2016
@wkraus
I had the almost exact same problem, and for me the solution was to add
WiFi.persistent(false);
in your setup()hope this helps you too
source: http://forum.wemos.cc/topic/99/my-solution-to-very-unstable-wifi
8 remaining items