scottjgibson / esp8266Switch

Alternate firmware for EcoPlug embedded wifi switch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Crash?

brahmafear opened this issue · comments

Hi Scott,

Awesome code. I'm trying to replicate some of your work but am seeing my unit generate exceptions and stack overflows to serial console. I can successfully upload simple blink sketches as well as more complicated MQTT sketches, but every time I attempt using the code here, I get a dump.

I'm familiar with Arduino and ESP8266 but new to some of the JSON and EEPROM libraries you are using.

Any thoughts on things I can check next? Thanks in advance.

Can you copy/paste the serial console crash output here and relevant lines of your program. My guess would be its getting all of the libraries squared away.

Sorry, just getting back to this now. Here's is a dump of the crash I'm seeing after uploading the code. Seems to be some sort of exception (29?) generated during the connect phase. Any ideas?

mounted file system
*WM: Adding parameter
*WM: devicename
*WM: Adding parameter
*WM: server
*WM: Adding parameter
*WM: port
*WM:
*WM: AutoConnect
Exception (29):
epc1=0x4000e1c3 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000018 depc=0x00000000

ctx: cont
sp: 3fff1a30 end: 3fff1e30 offset: 01a0

stack>>>
3fff1bd0: 3fff2970 00000001 00000001 ffffff80
3fff1be0: 4023a48a 40222fc0 00000018 3fff3950
3fff1bf0: 00000001 3fff2908 3fff2908 4023a670
3fff1c00: 3fff2908 3fff3950 3fff0b00 00000000
3fff1c10: 3ffef524 3ffef338 f42f199f 3fff0b00
3fff1c20: 402467e8 00000064 02782b3a fffeffff
3fff1c30: 00000018 0000ffff 00000000 00000001
3fff1c40: 3fff1c58 40236c20 3ffef2b4 3fff3950
3fff1c50: 02782b3a 3fff6246 00000000 00000000
3fff1c60: 00000000 00000000 00000000 00000000
3fff1c70: 00000000 00000000 00000000 00000000
3fff1c80: 00000000 00000000 40237917 3fff3950
3fff1c90: 3fff0b00 3fff3950 3fff3950 4023795f
3fff1ca0: 00000000 3ffef338 3ffea1dc 00000000
3fff1cb0: 4021bdf9 00000002 3fff0b00 3fff0b00
3fff1cc0: 4021bf11 00000002 00000002 4020f48d
3fff1cd0: 00000001 4021bf6a 00000002 3fff0b00
3fff1ce0: 40207818 3fff0b00 3ffe836a 3fff0b00
3fff1cf0: 40207846 3ffe836a 3fff0b00 4020786c
3fff1d00: 00000002 00000000 3fff00d4 4020ba2d
3fff1d10: 3ffe8725 00000000 3fff00d4 4020c5ab
3fff1d20: 4021bd92 3fff0b00 3fff1d60 40211baa
3fff1d30: 40107158 3fff00d4 3fff1d60 40211bf8
3fff1d40: 3ffe8725 40245791 3fff0d3c 00000000
3fff1d50: 00000000 3ffe836a 3fff00d4 4020c72d
3fff1d60: 3fff3970 0000000f 00000000 3fff3950
3fff1d70: 0000000f 00000000 3fff0d3c 4020b00e
3fff1d80: 0001c200 3fff1dc8 3fff00d4 3ffe8364
3fff1d90: 3fff00d4 3ffe836a 3fff0d3c 40207396
3fff1da0: 00000000 00000000 00000000 00000000
3fff1db0: 00000000 00000000 00000000 00000000
3fff1dc0: 00000000 00000000 3ffe8926 3ffe8921
3fff1dd0: 3fff3938 00000005 3ffe891a 3ffe8915
3fff1de0: 3fff38f8 00000028 3ffe88fe 3ffe8909
3fff1df0: 3fff38b8 00000028 00000000 00000000
3fff1e00: 00000000 00000000 00000000 3fff0e00
3fff1e10: 3fffdc20 00000000 3fff0df9 4020f9ea
3fff1e20: 00000000 00000000 3fff0e10 40100114
<<<stack<<<

Think I have a clue on this -- if the saved JSON file does not have the same IDs as what the sketch tries to extract, the module resets. Ie, if I run the program, save a JSON file, alter the program and add new JSON fields, upload to module, run -- module will crash. Workaround is to format spiffs or change the JSON file name whenever changing the JSON format.