Iotawatt has stopped working and keeps restarting - Resolved

Hi,

Today I realized that my IoTaWatt stopped working after a few years - I’m not sure how long ago. After a little debugging, I came to the conclusion that SD card is corrupted. This is the last thing I’m able to see in the iotamsgs.txt file - endless loop of these:

** Restart **

SD initialized.
5/10/21 16:30:46z Real Time Clock is running. Unix time 1620664246 
5/10/21 16:30:46z Reset reason: Exception
5/10/21 16:30:46z Trace:  0:0, 0:0, 0:0, 0:0, 11:0, 11:4, 11:5, 11:5, 11:10, 11:15, 11:20, 11:20[1], 11:20[2], 11:20[3], 11:21, 11:22, 11:21, 11:22, 11:20[4], 11:20[5], 11:20[6], 11:20[7], 11:25, 11:30, 11:31, 11:30, 11:31, 11:32, 11:31, 31:100, 31:100, 31:100
5/10/21 16:30:47z ESP8266 ChipID: 2518092
5/10/21 16:30:48z IoTaWatt 4.x, Firmware version 02_06_00
5/10/21 16:30:48z SPIFFS mounted.

I tried to find in the log file when it started, but trying to read anything other than the start and end of file throws a “read error”.

I tried to copy content of the SD card to the computer, but on most of the files got “read error”. Thankfully, I was able to copy config.txt file.

I managed to find a spare SD card lying around, formatted it using FAT32 filesystem (I assume that “defaults” from Windows tool should be OK?), put files from the github to the card (just in case, for the correct firmware version and with the default config.txt file), put SD card in the iotawatt again and… It still keeps restarting. With the same error:

** Restart **

SD initialized.
5/10/21 17:16:04z Real Time Clock is running. Unix time 1620666964
5/10/21 17:16:04z Reset reason: Exception
5/10/21 17:16:04z Trace:  0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 11:0, 11:4, 11:5, 11:5, 11:10, 11:15, 11:20, 11:20[1], 11:20[2], 11:20[3], 11:21, 11:22, 11:20[4], 11:20[5], 11:20[6], 11:20[7], 11:25, 11:30, 11:31, 11:30, 11:31, 11:32, 11:31, 31:100, 31:100, 31:100
5/10/21 17:16:04z ESP8266 ChipID: 2518092
5/10/21 17:16:04z IoTaWatt 4.x, Firmware version 02_06_00
5/10/21 17:16:04z SPIFFS mounted.

It’s from the iotamsgs.txt file, so I see it managed to create the directory and file in the directory.
Using serial terminal I got the following log:

 ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 3584, room 16
tail 0
chksum 0xb0
csum 0xb0
v2843a5ac
~ld

SPI started.

** Restart **

SD initialized.
5/10/21 17:16:05z Real Time Clock is running. Unix time 1620666965
5/10/21 17:16:05z Reset reason: Exception
5/10/21 17:16:05z Trace:  0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 11:0, 11:4, 11:5, 11:5, 11:10, 11:15, 11:20, 11:20[1], 11:20[2], 11:20[3], 11:21, 11:22, 11:20[4], 11:20[5], 11:20[6], 11:20[7], 11:25, 11:30, 11:31, 11:30, 11:31, 11:32, 11:31, 31:100, 31:100, 31:100
5/10/21 17:16:05z ESP8266 ChipID: 2518092
5/10/21 17:16:05z IoTaWatt 4.x, Firmware version 02_06_00
5/10/21 17:16:05z SPIFFS mounted.

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

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

>>>stack>>>

ctx: cont
sp: 3fff2170 end: 3fff2590 offset: 0190
3fff2300:  00000000 40215e9f 00000020 40100cf6
3fff2310:  00000001 3fff40e0 3fff403c 00000000
3fff2320:  3fff2c54 3fff40e0 3fff403c 00000000
3fff2330:  3fff2c54 3fff40e0 3fff403c 40215eec
3fff2340:  3fff2350 3fff32b3 3fff2350 0000000a <
3fff2350:  4023a9d0 0000000f 3fff40d4 00000200
3fff2360:  00000007 402167d3 00000020 40100cf6
3fff2370:  bffe8fee 00000001 00000010 00000000
3fff2380:  3fff32a4 40212ea3 00000008 3fff3134
3fff2390:  00000007 3ffe8fef 00000000 ffffffff
3fff23a0:  00000000 3ffef4a0 00000090 3fff403c
3fff23b0:  3fff32a4 3fff04a8 3fff3d28 40212ee6
3fff23c0:  4023b180 00000000 000003e8 00000000
3fff23d0:  3fff3bac 3fff3bec 00000000 00000000
3fff23e0:  3fff0dfc 4023b180 00000000 000003e8
3fff23f0:  00000000 3fff3bac 3fff3bec 00000000
3fff2400:  00000000 3fff0dfc 4023a9d0 40100cf6
3fff2410:  3fff3e2c 00000400 3fff3c94 0073007f
3fff2420:  0023b180 00000000 00000005 3fff2ccc
3fff2430:  00000000 40278ff8 00000000 40216785
3fff2440:  3fff0dfc 3fff2460 3fff0a64 00000000
3fff2450:  3fff0744 3fff0744 3fff0748 4020acc3
3fff2460:  305f3200 30305f36 80ef0000 feefeffe
3fff2470:  feefeffe feefeffe feefeffe feefeffe
3fff2480:  feefeffe feefeffe feefeffe feefeffe
3fff2490:  feefeffe feefeffe feefeffe feefeffe
3fff24a0:  feefeffe feefeffe feefeffe feefeffe
3fff24b0:  feefeffe feefeffe feefeffe feefeffe
3fff24c0:  feefeffe feefeffe feefeffe feefeffe
3fff24d0:  feefeffe feefeffe feefeffe feefeffe
3fff24e0:  feefeffe feefeffe feefeffe feefeffe
3fff24f0:  feefeffe feefeffe feefeffe feefeffe
3fff2500:  feefeffe feefeffe feefeffe feefeffe
3fff2510:  feefeffe feefeffe feefeffe feefeffe
3fff2520:  feefeffe feefeffe feefeffe 53444653
3fff2530:  fe000f00 017d7840 feef0001 feefeffe
3fff2540:  feefeffe feefeffe feefeffe feefeffe
3fff2550:  00000000 feefeffe 00000017 feefeffe
3fff2560:  feefeffe feefeffe feefeffe 3fff0fd8
3fff2570:  3fffdad0 00000000 3fff0f98 4022c0d0
3fff2580:  feefeffe feefeffe 3ffe8604 40100fb9
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Do you have any ideas what should I do next? Thanks in advance for any help with this.

Hmmm…

I’ve just updated firmware to 02_06_03 using esptool and it works again. Magic. :slight_smile:

I don’t know how you got 02_06_00. That’s not on the auto-update schedule. 02_06_02 is current. 02_06_00 was ALPHA only and was only out for a week or less because of this problem. It effects older systems and is caused by an outdated Emoncms configuration. 02_06_02 is immune to the problem and also fixes the config.

02_06_03 is not on the auto-update schedule yet but will be ALPHA probably later this week. In the meantime I’d recommend you set your auto-update to ALPHA and let it load 02_06_02 so that you have the correct SD files to match your firmware. When 02_06_03 is published, it will download with it’s SDfiles. Better to have a matched set.

If I remember correctly, I already set the auto-update class to “ALPHA” a long time ago because I wanted/needed something from the alpha release to test right now. I don’t remember, what. But of course I’m aware that then these kind of things can happen. I assume that’s why I got the 02_06_00.

I see it downgraded to the 02_06_02 already and populated SD card with the correct files. Thank you for explanation what caused the issue.