esp8266 / Arduino

ESP8266 core for Arduino
GNU Lesser General Public License v2.1
16.07k stars 13.33k forks source link

wemos d1 pro mini periodic exceptions (unstable) #6520

Closed afagard closed 5 years ago

afagard commented 5 years ago

I've got an off-brand Wemos D1 mini pro off Amazon.

I made a script that works fine on a regular Arduino but results in period exceptions that are always different on the wemos. So I thought, ok, maybe my code is the problem, maybe some library I was using wasn't "compatible". I then tried various example sketches that were installed along with this repo. Notably, the "hello server" one. And am facing the same issues, although the exception is almost always 0.

Raw trace:

Exception (0):
epc1=0x4023a054 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000

>>>stack>>>

ctx: cont
sp: 3ffffa40 end: 3fffffc0 offset: 01a0
3ffffbe0:  400005e1 000188c3 40102252 00000100  
3ffffbf0:  4023a054 00000033 00000010 00000001  
3ffffc00:  4010465f 04000102 00000000 00000001  
3ffffc10:  fbf8ffff 04000002 3feffe00 00000100  
3ffffc20:  0000001a 00000018 04000102 40104640  
3ffffc30:  3fffc100 3ffee510 00000000 00000000  
3ffffc40:  400043e6 00000030 00000016 ffffffff  
3ffffc50:  400044ab 3fffc718 3ffffd40 08000000  
3ffffc60:  60000200 08000000 00000000 00000000  
3ffffc70:  0000ffff 00042035 00002035 003ff000  
3ffffc80:  4024a5d0 00000020 003ff000 00000030  
3ffffc90:  3ffe8b50 40104304 3ffef19c feefeffe  
3ffffca0:  00000001 40103527 3ffeccd0 feefeffe  
3ffffcb0:  4010398a feefeffe 4023536f 00000001  
3ffffcc0:  ffffffff 00000000 3ffe8ca1 00000008  
3ffffcd0:  402353be 3ffec2c0 3ffeed34 00000001  
3ffffce0:  40104659 40104656 3ffeed34 3ffec2c0  
3ffffcf0:  400005e1 00000000 00000020 40100f26  
3ffffd00:  4023a054 00000033 00000010 3fff01c0  
3ffffd10:  4010465f 04000102 00000000 00000001  
3ffffd20:  fbf8ffff 04000002 3feffe00 00000100  
3ffffd30:  0000001a 00000018 04000102 40104640  
3ffffd40:  3fffc100 3ffee510 00000000 00000000  
3ffffd50:  00000001 40103527 3ffecd18 3ffef0fc  
3ffffd60:  4010398a 0000002e 3ffef12f 4022a0cb  
3ffffd70:  3ffed630 40229c9c 4022c2fc 00000000  
3ffffd80:  00000005 00000000 00000020 40100f26  
3ffffd90:  3ffe8b55 4010431f 3ffec5e0 4021a050  
3ffffda0:  40101c3d 3ffec5e0 00000020 40100f26  
3ffffdb0:  ffffffdc 0044f24f 3ffecfb0 40101e12  
3ffffdc0:  3ffe93f4 00000000 00000000 00000022  
3ffffdd0:  ffffffdc 0044f24f 40102252 00000100  
3ffffde0:  7fffffff 3ffe93f4 3ffe93f4 00000001  
3ffffdf0:  40104659 40104656 0000118d 00000000  
3ffffe00:  400005e1 00040000 7fffffff 00000000  
3ffffe10:  402082cc 00000030 00000010 00000022  
3ffffe20:  40208372 3ffee510 00000000 00000001  
3ffffe30:  00004bc6 00000000 00000000 fffffffe  
3ffffe40:  00000000 3fffc6fc 00000000 3ffee4f8  
3ffffe50:  00000000 3ffee510 3ffee620 00000000  
3ffffe60:  402025eb 00000030 0000001e ffffffff  
3ffffe70:  40204284 3fffff70 4020ef38 3ffee508  
3ffffe80:  00000000 00000000 00000000 fffffffe  
3ffffe90:  ffffffff 3fffc6fc 00000025 3ffee410  
3ffffea0:  00000000 3fffdad0 3ffee620 00000030  
3ffffeb0:  3fffdab0 00000000 3fffd9d0 3ffee620  
3ffffec0:  00000000 00000000 00000001 3ffee5ec  
3ffffed0:  00000000 4bc6a7f0 5645a1ca 00000000  
3ffffee0:  00000000 00000000 4bc6a7f0 00000000  
3ffffef0:  4023cbf6 3fffff58 40100200 000011a7  
3fffff00:  00000000 4c957f2d 3fffdad0 3ffee620  
3fffff10:  0014697b 00000000 4c957f2d 5851f42d  
3fffff20:  3fffdad0 40212d4d 40212d93 3ffee620  
3fffff30:  3fffdad0 3ffee510 3ffee550 40100123  
3fffff40:  4023ddbb 3ffee510 3ffee510 4020759d  
3fffff50:  3ffeed34 40201ea8 3ffee410 4020e9fc  
3fffff60:  3fffdad0 00000000 3ffee410 3ffee620  
3fffff70:  3fffdad0 3ffee510 3ffee4f8 40208372  
3fffff80:  3fffdad0 00000000 3ffee5ec 4020655a  
3fffff90:  3fffdad0 00000000 3ffee5ec 402014da  
3fffffa0:  3fffdad0 00000000 3ffee5ec 4020cb18  
3fffffb0:  feefeffe feefeffe 3ffe8514 4010058d  
<<<stack<<<

Decoded trace:

Exception 0: Illegal instruction
PC: 0x4023a054
EXCVADDR: 0x00000000

Decoding stack results
0x4021a050: ethernet_output at netif/ethernet.c line 312
0x402082cc: esp8266::MDNSImplementation::MDNSResponder::_checkServiceQueryCache() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Control.cpp line 1697
0x40208372: esp8266::MDNSImplementation::MDNSResponder::_process(bool) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Control.cpp line 84
0x402025eb: WiFiClient::~WiFiClient() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\WiFiClient.cpp line 96
0x40204284: ESP8266WebServer::handleClient() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WebServer\src\ESP8266WebServer.cpp line 280
0x40100200: millis() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\core_esp8266_wiring.cpp line 186
0x40212d4d: rand at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdlib/rand.c line 89
0x40212d93: rand at /home/earle/src/esp-quick-toolchain/repo/newlib/newlib/libc/stdlib/rand.c line 91
0x40100123: esp8266::polledTimeout::timeoutTemplate   >::expiredOneShot() const at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266/PolledTimeout.h line 216
0x4020759d: esp8266::MDNSImplementation::MDNSResponder::_updateProbeStatus() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Control.cpp line 1049
0x40201ea8: ESP8266WiFiSTAClass::status() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\ESP8266WiFiSTA.cpp line 613
0x4020e9fc: WiFiClient::operator bool() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\WiFiClient.cpp line 350
0x40208372: esp8266::MDNSImplementation::MDNSResponder::_process(bool) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Control.cpp line 84
0x4020655a: esp8266::MDNSImplementation::MDNSResponder::update() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS.cpp line 1124
0x402014da: loop() at C:\Users\Alex\AppData\Local\Temp\arduino_modified_sketch_669353/HelloServer.ino line 79
0x4020cb18: loop_wrapper() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\core_esp8266_main.cpp line 125

Here is another decoded trace that happened almost immediately after:

Exception 0: Illegal instruction
PC: 0x4020de7f: umm_assimilate_up(unsigned short) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 1179
EXCVADDR: 0x00000000

Decoding stack results
0x4020df68: _umm_free(void*) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 1304
0x4021b930: lwip_cyclic_timer at core/timeouts.c line 233
0x4020e390: free(void*) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\umm_malloc\umm_malloc.cpp line 1764
0x40222fb4: mem_free at core/mem.c line 237
0x4021a10a: memp_free at core/memp.c line 447
0x4021bad0: sys_check_timeouts at core/timeouts.c line 389
0x4020ca23: loop_task(ETSEvent*) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\core_esp8266_main.cpp line 133
0x4020b508: _GLOBAL__sub_I__ZN14HardwareSerialC2Ei() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\HardwareSerial.cpp line 156
0x4020c914: _GLOBAL__sub_I__ZN6StringC2EPKc() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\WString.cpp line 852
0x4020e3f0: _GLOBAL__sub_I__ZN18ScheduledFunctions18scheduledFunctionsE() at c:\users\alex\appdata\local\arduino15\packages\esp8266\tools\xtensa-lx106-elf-gcc\2.5.0-3-20ed2b9\xtensa-lx106-elf\include\c++\4.8.2\bits/stl_list.h line 388
0x40218fb0: _GLOBAL__sub_I___cxa_allocate_exception() at ../../../../../dl/gcc-xtensa/libstdc++-v3/libsupc++/eh_alloc.cc line 324
0x4020a3a0: esp8266::MDNSImplementation::MDNSResponder::_udpAppendBuffer(unsigned char const*, unsigned int) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Transfer.cpp line 1034
0x4020a3ce: esp8266::MDNSImplementation::MDNSResponder::_udpAppend8(unsigned char) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Transfer.cpp line 1046
0x4020a511: esp8266::MDNSImplementation::MDNSResponder::_write8(unsigned char, esp8266::MDNSImplementation::MDNSResponder::stcMDNSSendParameter&) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Transfer.cpp line 1174
0x4020a749: esp8266::MDNSImplementation::MDNSResponder::_writeMDNSHostDomain(char const*, bool, esp8266::MDNSImplementation::MDNSResponder::stcMDNSSendParameter&) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Transfer.cpp line 1287
0x4020a422: esp8266::MDNSImplementation::MDNSResponder::_udpAppend32(unsigned int) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Transfer.cpp line 1064
0x4020a53d: esp8266::MDNSImplementation::MDNSResponder::_write16(unsigned short, esp8266::MDNSImplementation::MDNSResponder::stcMDNSSendParameter&) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Transfer.cpp line 1184
0x4020aa1d: esp8266::MDNSImplementation::MDNSResponder::_writeMDNSAnswer_PTR_IP4(IPAddress, esp8266::MDNSImplementation::MDNSResponder::stcMDNSSendParameter&) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Transfer.cpp line 1419
0x40100200: millis() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\core_esp8266_wiring.cpp line 186
0x40100123: esp8266::polledTimeout::timeoutTemplate   >::expiredOneShot() const at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266/PolledTimeout.h line 216
0x40207618: esp8266::MDNSImplementation::MDNSResponder::_updateProbeStatus() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Control.cpp line 1073
0x40201ea8: ESP8266WiFiSTAClass::status() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\ESP8266WiFiSTA.cpp line 613
0x4020e9fc: WiFiClient::operator bool() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266WiFi\src\WiFiClient.cpp line 350
0x40208372: esp8266::MDNSImplementation::MDNSResponder::_process(bool) at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS_Control.cpp line 84
0x4020655a: esp8266::MDNSImplementation::MDNSResponder::update() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\libraries\ESP8266mDNS\src\LEAmDNS.cpp line 1124
0x4020ca89: esp_schedule() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\core_esp8266_main.cpp line 95
0x4020cb1e: loop_wrapper() at C:\Users\Alex\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.5.2\cores\esp8266\core_esp8266_main.cpp line 127

Could this be hardware related failure? I am hoping so, otherwise this ESP ecosystem is kind of a pida given the stack traces (at least to me) don't seem that informative. Especially if they have a tendency to change with the same code making it difficult to debug.

Things I've tried:

Power: My system is supplied with 12 volts from an adapter (also tried computer PSU), which is then stepped down to 5 volts and then fed in to the Wemos D1 5V in.

I ordered a LOLIN Wemos D1 mini pro off Amazon so I have something to test against but it isn't here yet.

devyte commented 5 years ago

When you opened this issue you were presented with an issue template with specific instructions and requiring specific info. You completely ignored it. Closing due to non-compliance.

BTW, you haven't tried the most important thing of all: latest git.

JAndrassy commented 5 years ago

https://github.com/esp8266/Arduino/issues/6366#issuecomment-525145409

afagard commented 5 years ago

#6366 (comment)

I read that comment, that is why I double checked my power supply. It is 12v to a 5v buck converter, then direct to the wemos board. Surely that couldn't be the issue? It isn't powered off USB or some voltage divider from a TTL adapter.

Will definitely be trying to lower the output wifi power to 16db as suggested.

Is this correct: WiFi.setOutputPower(16);?

UPDATE: Currently been running problem free for an hour. If this was indeed the problem, was it due to some sort of EMF? Noticed that in the nodemcu the esp is canned whereas in the wemos it isn't.

When you opened this issue you were presented with an issue template with specific instructions and requiring specific info. You completely ignored it. Closing due to non-compliance.

BTW, you haven't tried the most important thing of all: latest git.

Understandable. I apologize.

ChocolateFrogsNuts commented 5 years ago

This.... https://github.com/esp8266/Arduino/issues/6366#issuecomment-534337146

Basically the flash chip on the off-brand D1 can't cope with 40mhz and needs to run slower. Turns out this was the real problem I was having... RFI was just making it worse.

afagard commented 5 years ago

This.... #6366 (comment)

Basically the flash chip on the off-brand D1 can't cope with 40mhz and needs to run slower. Turns out this was the real problem I was having... RFI was just making it worse.

Yea. I returned the off-brand one and got a genuine lolin d1 mini pro and haven't had a problem since ;)