Cannot Kick-Start New SD Card - Red-Red-Red - resolved

Hi

I had a corrupted iotalog file (after 2 years of use) on an SD card so I have formatted a new one, 8GB FAT32 using the SD Card Formatter (labelled IOTADATA) and then copied the SD card files from github (unchanged). But I still end up with red-red-red

For some reason the iotawatt/iotalog file is not being created as I have read on various posts here that it should be in this situation. I have tried many of the things that are suggested in posts but to no avail. Actually I have tried this with 2 SD cards and a few more tests but all with the same result.

On very first boot, here is the serial capture (thanks to PuTTY)…
SPI started.

** Restart **

SD initialized.
3/16/20 03:36:47z Real Time Clock is running. Unix time 1584329807
3/16/20 03:36:47z Reset reason: External System
3/16/20 03:36:47z Trace:  0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 11:0, 11:4, 11:5, 11:5, 11:6, 11:7, 11:8, 11:9, 16:0, 11:10, 11:11, 11:12
3/16/20 03:36:47z ESP8266 ChipID: 6991551
3/16/20 03:36:47z IoTaWatt 4.x, Firmware version 02_05_04
3/16/20 03:36:47z SPIFFS mounted.
3/16/20 03:36:47z Local time zone: +0:00
3/16/20 03:36:47z device name: IotaWatt
3/16/20 03:36:47z LLMNR responder started for hostname IotaWatt
3/16/20 03:36:47z HTTP server started
3/16/20 03:36:47z timeSync: service started.
3/16/20 03:36:47z statService: started.
3/16/20 03:36:47z dataLog: service started.
mkdir failed: iotawatt
3/16/20 03:36:47z dataLog: Log file open failed. 2
3/16/20 03:36:47z Program halted.

Once I take the SD card and place it back into my Laptop, I can see that the iotawatt directory has been created but not the log file…

D:\>tree /F /A
Folder PATH listing for volume IOTA-DATA
Volume serial number is 6F73-96A8
D:.
|   cnfstyle.css
|   config.txt
|   edit.htm
|   graph.htm
|   graph.js
|   graph2.htm
|   graph2.js
|   index.htm
|   tables.txt
|
\---iotawatt
        iotamsgs.txt

Here is the content of the iotamsgs.txt file.

** Restart **

SD initialized.
3/16/20 03:36:45z Real Time Clock is running. Unix time 1584329805 
3/16/20 03:36:45z Power failure detected.
3/16/20 03:36:45z Reset reason: External System
3/16/20 03:36:45z ESP8266 ChipID: 6991551
3/16/20 03:36:45z IoTaWatt 4.x, Firmware version 02_05_04
3/16/20 03:36:45z SPIFFS mounted.
3/16/20 03:36:45z Local time zone: +0:00
3/16/20 03:36:45z device name: IotaWatt

** Restart **

SD initialized.
3/16/20 03:36:47z Real Time Clock is running. Unix time 1584329807 
3/16/20 03:36:47z Reset reason: External System
3/16/20 03:36:47z Trace:  0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 0:0, 11:0, 11:4, 11:5, 11:5, 11:6, 11:7, 11:8, 11:9, 16:0, 11:10, 11:11, 11:12
3/16/20 03:36:47z ESP8266 ChipID: 6991551
3/16/20 03:36:47z IoTaWatt 4.x, Firmware version 02_05_04
3/16/20 03:36:47z SPIFFS mounted.
3/16/20 03:36:47z Local time zone: +0:00
3/16/20 03:36:47z device name: IotaWatt
3/16/20 03:36:47z LLMNR responder started for hostname IotaWatt
3/16/20 03:36:47z HTTP server started
3/16/20 03:36:47z timeSync: service started.
3/16/20 03:36:47z statService: started.
3/16/20 03:36:47z dataLog: service started.
3/16/20 03:36:47z dataLog: Log file open failed. 2
3/16/20 03:36:47z Program halted.

Now that I know that the iotawatt directory has actually been created - I tried to boot the device again…

Here is the Serial Output for attempt number 2

SPI started.

** Restart **

SD initialized.
3/16/20 07:30:47z Real Time Clock is running. Unix time 1584343847
3/16/20 07:30:47z Reset reason: External System
3/16/20 07:30:47z Trace:  8:2, 8:2, 1:2, 1:3, 1:4, 1:5[18], 18:0, 18:1, 1:6, 1:1                         , 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[5], 5:0, 5:1, 1:6, 1:1, 1:2, 9:0,                          9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[19]
3/16/20 07:30:47z ESP8266 ChipID: 6991551
3/16/20 07:30:47z IoTaWatt 4.x, Firmware version 02_05_04
3/16/20 07:30:47z SPIFFS mounted.
3/16/20 07:30:47z Local time zone: +0:00
3/16/20 07:30:47z device name: IotaWatt
3/16/20 07:30:47z HTTP server started
3/16/20 07:30:47z timeSync: service started.
3/16/20 07:30:47z statService: started.
3/16/20 07:30:47z dataLog: service started.
mkdir failed: iotawatt
3/16/20 07:30:47z dataLog: Log file open failed. 2
3/16/20 07:30:47z Program halted.

The following has been appended to the iotamsg log (with the above content at the head of the file). This time the Wifi connects but ultimately it fails as it cannot find the

** Restart **

SD initialized.
3/16/20 07:30:38z Real Time Clock is running. Unix time 1584343838 
3/16/20 07:30:38z Power failure detected.
3/16/20 07:30:38z Reset reason: External System
3/16/20 07:30:38z ESP8266 ChipID: 6991551
3/16/20 07:30:38z IoTaWatt 4.x, Firmware version 02_05_04
3/16/20 07:30:38z SPIFFS mounted.
3/16/20 07:30:38z Local time zone: +0:00
3/16/20 07:30:38z device name: IotaWatt
3/16/20 07:30:41z MDNS responder started for hostname IotaWatt
3/16/20 07:30:41z LLMNR responder started for hostname IotaWatt
3/16/20 07:30:41z HTTP server started
3/16/20 07:30:41z WiFi connected. SSID=NFC, IP=192.168.0.103, channel=5, RSSI -58db
3/16/20 07:30:41z timeSync: service started.
3/16/20 07:30:42z statService: started.
3/16/20 07:30:42z Updater: service started. Auto-update class is MINOR
3/16/20 07:30:42z dataLog: service started.
3/16/20 07:30:42z dataLog: Log file open failed. 2
3/16/20 07:30:42z Program halted.

** Restart **

SD initialized.
3/16/20 07:30:47z Real Time Clock is running. Unix time 1584343847 
3/16/20 07:30:47z Reset reason: External System
3/16/20 07:30:47z Trace:  8:2, 8:2, 1:2, 1:3, 1:4, 1:5[18], 18:0, 18:1, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[5], 5:0, 5:1, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[19]
3/16/20 07:30:47z ESP8266 ChipID: 6991551
3/16/20 07:30:47z IoTaWatt 4.x, Firmware version 02_05_04
3/16/20 07:30:47z SPIFFS mounted.
3/16/20 07:30:47z Local time zone: +0:00
3/16/20 07:30:47z device name: IotaWatt
3/16/20 07:30:47z HTTP server started
3/16/20 07:30:47z timeSync: service started.
3/16/20 07:30:47z statService: started.
3/16/20 07:30:47z dataLog: service started.
3/16/20 07:30:47z dataLog: Log file open failed. 2
3/16/20 07:30:47z Program halted.

So I am at a bit of road block as to how the log file gets created in this situation.

Hello @slender,

This is a known problem for that interim ALPHA release, and it has a simple solution.

Like the current release, 02_05_05, that ALPHA only release uses a new version of the ESP8266/Arduino core. That version is a huge improvement in many areas, but it introduced a layer to handle the SDfile system. That method is mostly compatible but has a subtle difference in the failure mode when creating directories. Specifically, the old core would indicate success when attempting to create a directory that already exists, while this newer core returns failure.

That’s the problem here. The /iotawatt directory already exists when the firmware tries to create the /iotawatt/iotalog.log file and /iotalog/histlog.log files.

The solution is to create those two files on the SD as empty files using another computer.

The IoTaWatt should start up and run normally after that. I recommend setting auto-update to BETA or ALPHA after that to load the latest release where this issue is fixed.

Going back to your initial problem that caused you to get a new SD card, that is a residual problem where some very old datalogs were corrupted a long time ago by an issue that was fixed more than a year ago. There were about six incidences of the problem back then, and one of these latent incidences was discovered a few weeks ago. The circumstances aren’t fully known, but involve more than just having used that release. It seems to be related to other issues at the time causing restarts.

Let me know if creating the new empty files resolves this for you.

Hi @overeasy
Thanks for the quick & great explanation.

I did as you suggested and “touched” both /iotawatt/iotalog.log file and /iotalog/histlog.log (using bash shell on windows) but as you can see from the logs below, it complained that the iotalog file was damaged and therefore deleted it…

Creating the files /iotawatt/iotalog.log file and /iotalog/histlog.log …

slender:~$ ls /mnt/d/iotawatt/ -lh
total 32K
-rwxrwxrwx 1 root root 3.1K Jan  1  2000 iotamsgs.txt
slender:~$
slender:~$
slender:~$ cd  /mnt/d/iotawatt/
slender:/mnt/d/iotawatt$ sudo touch iotalog.log
slender:/mnt/d/iotawatt$ sudo touch histlog.log
slender:/mnt/d/iotawatt$
slender:/mnt/d/iotawatt$
slender:/mnt/d/iotawatt$ ls /mnt/d/iotawatt/ -lh
total 32K
-rwxrwxrwx 1 root root    0 Mar 18 11:05 histlog.log
-rwxrwxrwx 1 root root    0 Mar 18 11:05 iotalog.log
-rwxrwxrwx 1 root root 3.1K Jan  1  2000 iotamsgs.txt
slender:/mnt/d/iotawatt$

Here is the serial output during boot…

SPI started.

** Restart **

SD initialized.
3/18/20 01:08:16z Real Time Clock is running. Unix time 1584493696
3/18/20 01:08:16z Reset reason: Software/System restart
3/18/20 01:08:16z Trace:  8:9, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[18], 18:0, 18:1, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[5], 5:0, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[19]
3/18/20 01:08:16z ESP8266 ChipID: 6991551
3/18/20 01:08:16z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 01:08:16z SPIFFS mounted.
3/18/20 01:08:16z Local time zone: +0:00
3/18/20 01:08:16z device name: IotaWatt
3/18/20 01:08:16z LLMNR responder started for hostname IotaWatt
3/18/20 01:08:16z HTTP server started
3/18/20 01:08:16z timeSync: service started.
3/18/20 01:08:16z statService: started.
3/18/20 01:08:16z dataLog: service started.
mkdir failed: iotawatt
3/18/20 01:08:16z dataLog: Log file open failed. 2
3/18/20 01:08:16z Program halted.

And here is what is appended to the log file…

** Restart **

SD initialized.
3/18/20 01:08:05z Real Time Clock is running. Unix time 1584493685 
3/18/20 01:08:05z Power failure detected.
3/18/20 01:08:05z Reset reason: External System
3/18/20 01:08:05z ESP8266 ChipID: 6991551
3/18/20 01:08:05z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 01:08:05z SPIFFS mounted.
3/18/20 01:08:05z Local time zone: +0:00
3/18/20 01:08:05z device name: IotaWatt
3/18/20 01:08:08z MDNS responder started for hostname IotaWatt
3/18/20 01:08:08z LLMNR responder started for hostname IotaWatt
3/18/20 01:08:08z HTTP server started
3/18/20 01:08:08z WiFi connected. SSID=NFC, IP=192.168.0.103, channel=5, RSSI -62db
3/18/20 01:08:08z timeSync: service started.
3/18/20 01:08:08z statService: started.
3/18/20 01:08:08z Updater: service started. Auto-update class is MINOR
3/18/20 01:08:08z dataLog: service started.
3/18/20 01:08:08z dataLog: New current log created.
3/18/20 01:08:10z Updater: Update from 02_05_04 to 02_05_02
3/18/20 01:08:10z Updater: download 02_05_02

** Restart **

SD initialized.
3/18/20 01:08:15z Real Time Clock is running. Unix time 1584493695 
3/18/20 01:08:15z Reset reason: External System
3/18/20 01:08:15z Trace:  21:110, 21:110, 1:6, 1:1, 1:2, 9:0, 9:0, 8:4, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[5], 5:0, 5:5, 1:6, 1:1, 1:2, 9:0, 9:0, 8:4, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[5], 5:0, 5:6, 21:100[5], 21:101
3/18/20 01:08:15z ESP8266 ChipID: 6991551
3/18/20 01:08:15z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 01:08:15z SPIFFS mounted.
3/18/20 01:08:15z Local time zone: +0:00
3/18/20 01:08:15z device name: IotaWatt
3/18/20 01:08:15z HTTP server started
3/18/20 01:08:15z timeSync: service started.
3/18/20 01:08:15z statService: started.
3/18/20 01:08:15z dataLog: service started.
3/18/20 01:08:15z IotaLog: file damaged iotawatt/iotalog.log

3/18/20 01:08:15z IotaLog: Creating diagnostic file.
3/18/20 01:08:15z IotaLog: Deleting iotawatt/iotalog.log and restarting.


** Restart **

SD initialized.
3/18/20 01:08:16z Real Time Clock is running. Unix time 1584493696 
3/18/20 01:08:16z Reset reason: Software/System restart
3/18/20 01:08:16z Trace:  8:9, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[18], 18:0, 18:1, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[5], 5:0, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[19]
3/18/20 01:08:16z ESP8266 ChipID: 6991551
3/18/20 01:08:16z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 01:08:16z SPIFFS mounted.
3/18/20 01:08:16z Local time zone: +0:00
3/18/20 01:08:16z device name: IotaWatt
3/18/20 01:08:16z LLMNR responder started for hostname IotaWatt
3/18/20 01:08:16z HTTP server started
3/18/20 01:08:16z timeSync: service started.
3/18/20 01:08:16z statService: started.
3/18/20 01:08:16z dataLog: service started.
3/18/20 01:08:16z dataLog: Log file open failed. 2
3/18/20 01:08:16z Program halted.

It seems that it tries to check the file’s existence, but fails trying to check/open it.

Here are the contents of the newly created iotawatt/logDiag.txt file…

3/18/20 01:08:15
filesize 256, entries 0
1584493690,0,1584493690,0
End of file

Also I note that it tried to downgrade from 02_05_04 to 02_05_02 but does not succeed. There is now a download/02_05_02.bin file of Zero size.

Perhaps instead of a zero size /iotawatt/iotalog.log file would a correctly created file with zero records help? I started on the trail of trying to figure out how to do that but have not gotten anywhere.

I see you are using a unix system to make the files. I did this when the previous problem was reported and the user also did it successfully. I suspect it has something to do with the way Unix creates the FAT files. I can’t post empty files to the forum, but if you have access to a windows system, could you use it to create the two files by saving an empty file from notepad?

I used notepad to create the zero size files. Here was the result…
D:\iotawatt>dir
Volume in drive D is IOTA-DATA
Volume Serial Number is 6F73-96A8

 Directory of D:\iotawatt

01/01/2000  01:00 AM    <DIR>          .
01/01/2000  01:00 AM    <DIR>          ..
01/01/2000  01:00 AM             5,984 iotamsgs.txt
18/03/2020  12:48 PM                 0 histlog.log
01/01/2000  01:00 AM                83 logDiag.txt
18/03/2020  12:47 PM                 0 iotalog.log
               4 File(s)          6,067 bytes
               2 Dir(s)   7,959,904,256 bytes free

And then here is the serial record upon boot, alas with a “file damaged” message once more.
SPI started.

** Restart **

SD initialized.
3/18/20 02:50:06z Real Time Clock is running. Unix time 1584499806
3/18/20 02:50:06z Reset reason: External System
3/18/20 02:50:06z Trace:  5:4, 21:110, 21:110, 21:110, 1:6, 1:1, 1:2, 9:0, 9:0,                                              8:2, 8:2, 1:2, 1:3, 1:4, 1:5[5], 5:0, 5:5, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:                                             2, 1:3, 1:4, 1:5[5], 5:0, 5:6, 21:100[5], 21:101
3/18/20 02:50:06z ESP8266 ChipID: 6991551
3/18/20 02:50:06z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 02:50:06z SPIFFS mounted.
3/18/20 02:50:06z Local time zone: +0:00
3/18/20 02:50:06z device name: IotaWatt
3/18/20 02:50:06z HTTP server started
Low sample count 30
3/18/20 02:50:06z timeSync: service started.
3/18/20 02:50:06z statService: started.
3/18/20 02:50:06z dataLog: service started.
physical 256, logical 0
3/18/20 02:50:06z IotaLog: file damaged iotawatt/iotalog.log

3/18/20 02:50:06z IotaLog: Creating diagnostic file.
1584499800,0,1584499800,0
3/18/20 02:50:06z IotaLog: Deleting iotawatt/iotalog.log and restarting.


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

load 0x4010f000, len 1392, room 16
tail 0
chksum 0xd0
csum 0xd0
v3d128e5c
~ld

SPI started.

** Restart **

SD initialized.
3/18/20 02:50:07z Real Time Clock is running. Unix time 1584499807
3/18/20 02:50:07z Reset reason: Software/System restart
3/18/20 02:50:07z Trace:  8:4, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[18], 18:0, 18:1, 1:6                                             , 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[5], 5:0, 1:6, 1:1, 1:2, 9:0,                                              9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[19]
3/18/20 02:50:07z ESP8266 ChipID: 6991551
3/18/20 02:50:07z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 02:50:07z SPIFFS mounted.
3/18/20 02:50:07z Local time zone: +0:00
3/18/20 02:50:07z device name: IotaWatt
3/18/20 02:50:07z LLMNR responder started for hostname IotaWatt
3/18/20 02:50:07z HTTP server started
3/18/20 02:50:07z timeSync: service started.
3/18/20 02:50:07z statService: started.
3/18/20 02:50:07z dataLog: service started.
mkdir failed: iotawatt
3/18/20 02:50:07z dataLog: Log file open failed. 2
3/18/20 02:50:07z Program halted.

And here is what was appended to the log file…

** Restart **

SD initialized.
3/18/20 02:49:54z Real Time Clock is running. Unix time 1584499794 
3/18/20 02:49:54z Power failure detected.
3/18/20 02:49:54z Reset reason: External System
3/18/20 02:49:54z ESP8266 ChipID: 6991551
3/18/20 02:49:54z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 02:49:54z SPIFFS mounted.
3/18/20 02:49:54z Local time zone: +0:00
3/18/20 02:49:54z device name: IotaWatt
3/18/20 02:49:57z MDNS responder started for hostname IotaWatt
3/18/20 02:49:57z LLMNR responder started for hostname IotaWatt
3/18/20 02:49:57z HTTP server started
3/18/20 02:49:57z WiFi connected. SSID=NFC, IP=192.168.0.103, channel=5, RSSI -65db
3/18/20 02:49:57z timeSync: service started.
3/18/20 02:49:57z statService: started.
3/18/20 02:49:57z Updater: service started. Auto-update class is MINOR
3/18/20 02:49:57z dataLog: service started.
3/18/20 02:49:57z dataLog: New current log created.
3/18/20 02:50:00z Updater: Update from 02_05_04 to 02_05_02
3/18/20 02:50:00z Updater: download 02_05_02

** Restart **

SD initialized.
3/18/20 02:50:06z Real Time Clock is running. Unix time 1584499806 
3/18/20 02:50:06z Reset reason: External System
3/18/20 02:50:06z Trace:  5:4, 21:110, 21:110, 21:110, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[5], 5:0, 5:5, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[5], 5:0, 5:6, 21:100[5], 21:101
3/18/20 02:50:06z ESP8266 ChipID: 6991551
3/18/20 02:50:06z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 02:50:06z SPIFFS mounted.
3/18/20 02:50:06z Local time zone: +0:00
3/18/20 02:50:06z device name: IotaWatt
3/18/20 02:50:06z HTTP server started
3/18/20 02:50:06z timeSync: service started.
3/18/20 02:50:06z statService: started.
3/18/20 02:50:06z dataLog: service started.
3/18/20 02:50:06z IotaLog: file damaged iotawatt/iotalog.log

3/18/20 02:50:06z IotaLog: Creating diagnostic file.
3/18/20 02:50:06z IotaLog: Deleting iotawatt/iotalog.log and restarting.


** Restart **

SD initialized.
3/18/20 02:50:07z Real Time Clock is running. Unix time 1584499807 
3/18/20 02:50:07z Reset reason: Software/System restart
3/18/20 02:50:07z Trace:  8:4, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[18], 18:0, 18:1, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[5], 5:0, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[19]
3/18/20 02:50:07z ESP8266 ChipID: 6991551
3/18/20 02:50:07z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 02:50:07z SPIFFS mounted.
3/18/20 02:50:07z Local time zone: +0:00
3/18/20 02:50:07z device name: IotaWatt
3/18/20 02:50:07z LLMNR responder started for hostname IotaWatt
3/18/20 02:50:07z HTTP server started
3/18/20 02:50:07z timeSync: service started.
3/18/20 02:50:07z statService: started.
3/18/20 02:50:07z dataLog: service started.
3/18/20 02:50:07z dataLog: Log file open failed. 2
3/18/20 02:50:07z Program halted.

Thanks for your help!!

Do you still have the original SD card?

I think this is being complicated by the attempt to download the MINOR release. That’s because the default configuration on the SD card has MINOR set for auto-update. The config.txt file is a json file and you will see the line
"update": "MINOR",
If you change it to
"update": "NONE",
I think it will work. The diagnostic file shows the first log file was written, but the system then took an exception while downloading the new release and never properly closed the file.

I do have the original SD card. I have reformatted and tried the same tests with the same results. I also have a ZIP backup of the data from the original SD card, which includes my config and includes the histlog.log file but not the iotalog.log file which had been corrupted.

I changed the update config variable to “NONE”, recreated a zero size iotalog.log file and here is the serial output (alas, much the same)…

SPI started.

** Restart **

SD initialized.
3/18/20 03:32:43z Real Time Clock is running. Unix time 1584502363
3/18/20 03:32:43z Reset reason: External System
3/18/20 03:32:43z Trace:  1:4, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:1, 1:2, 9:0, 9:0
3/18/20 03:32:43z ESP8266 ChipID: 6991551
3/18/20 03:32:43z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 03:32:43z SPIFFS mounted.
3/18/20 03:32:43z Local time zone: +0:00
3/18/20 03:32:43z device name: IotaWatt
3/18/20 03:32:43z HTTP server started
Low sample count 24
3/18/20 03:32:43z timeSync: service started.
3/18/20 03:32:43z statService: started.
3/18/20 03:32:43z dataLog: service started.
physical 256, logical 0
3/18/20 03:32:43z IotaLog: file damaged iotawatt/iotalog.log

3/18/20 03:32:43z IotaLog: Creating diagnostic file.
1584502360,0,1584502360,0
3/18/20 03:32:43z IotaLog: Deleting iotawatt/iotalog.log and restarting.


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

load 0x4010f000, len 1392, room 16
tail 0
chksum 0xd0
csum 0xd0
v3d128e5c
~ld

SPI started.

** Restart **

SD initialized.
3/18/20 03:32:44z Real Time Clock is running. Unix time 1584502364
3/18/20 03:32:44z Reset reason: Software/System restart
3/18/20 03:32:44z Trace:  8:6, 8:8, 8:9, 1:2, 1:3, 1:4, 1:5[18], 18:0, 18:1, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[5], 5:0, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[19]
3/18/20 03:32:44z ESP8266 ChipID: 6991551
3/18/20 03:32:44z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 03:32:44z SPIFFS mounted.
3/18/20 03:32:44z Local time zone: +0:00
3/18/20 03:32:44z device name: IotaWatt
3/18/20 03:32:44z LLMNR responder started for hostname IotaWatt
3/18/20 03:32:44z HTTP server started
3/18/20 03:32:44z timeSync: service started.
3/18/20 03:32:44z statService: started.
3/18/20 03:32:44z dataLog: service started.
mkdir failed: iotawatt
3/18/20 03:32:44z dataLog: Log file open failed. 2
3/18/20 03:32:44z Program halted.

And here is the iotamsgs file extract (interesting that it says “dataLog: New current log created” in gthe first block but ultimately claims file damaged)…

** Restart **

SD initialized.
3/18/20 03:32:36z Real Time Clock is running. Unix time 1584502356 
3/18/20 03:32:36z Power failure detected.
3/18/20 03:32:36z Reset reason: External System
3/18/20 03:32:36z ESP8266 ChipID: 6991551
3/18/20 03:32:36z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 03:32:36z SPIFFS mounted.
3/18/20 03:32:36z Local time zone: +0:00
3/18/20 03:32:36z device name: IotaWatt
3/18/20 03:32:39z MDNS responder started for hostname IotaWatt
3/18/20 03:32:39z LLMNR responder started for hostname IotaWatt
3/18/20 03:32:39z HTTP server started
3/18/20 03:32:39z WiFi connected. SSID=NFC, IP=192.168.0.103, channel=5, RSSI -59db
3/18/20 03:32:39z timeSync: service started.
3/18/20 03:32:39z statService: started.
3/18/20 03:32:39z Updater: service started. Auto-update class is NONE
3/18/20 03:32:39z dataLog: service started.
3/18/20 03:32:39z dataLog: New current log created.

** Restart **

SD initialized.
3/18/20 03:32:43z Real Time Clock is running. Unix time 1584502363 
3/18/20 03:32:43z Reset reason: External System
3/18/20 03:32:43z Trace:  1:4, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:1, 1:2, 9:0, 9:0
3/18/20 03:32:43z ESP8266 ChipID: 6991551
3/18/20 03:32:43z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 03:32:43z SPIFFS mounted.
3/18/20 03:32:43z Local time zone: +0:00
3/18/20 03:32:43z device name: IotaWatt
3/18/20 03:32:43z HTTP server started
3/18/20 03:32:43z timeSync: service started.
3/18/20 03:32:43z statService: started.
3/18/20 03:32:43z dataLog: service started.
3/18/20 03:32:43z IotaLog: file damaged iotawatt/iotalog.log

3/18/20 03:32:43z IotaLog: Creating diagnostic file.
3/18/20 03:32:43z IotaLog: Deleting iotawatt/iotalog.log and restarting.


** Restart **

SD initialized.
3/18/20 03:32:44z Real Time Clock is running. Unix time 1584502364 
3/18/20 03:32:44z Reset reason: Software/System restart
3/18/20 03:32:44z Trace:  8:6, 8:8, 8:9, 1:2, 1:3, 1:4, 1:5[18], 18:0, 18:1, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[5], 5:0, 1:6, 1:1, 1:2, 9:0, 9:0, 8:2, 8:2, 1:2, 1:3, 1:4, 1:5[19]
3/18/20 03:32:44z ESP8266 ChipID: 6991551
3/18/20 03:32:44z IoTaWatt 4.x, Firmware version 02_05_04
3/18/20 03:32:44z SPIFFS mounted.
3/18/20 03:32:44z Local time zone: +0:00
3/18/20 03:32:44z device name: IotaWatt
3/18/20 03:32:44z LLMNR responder started for hostname IotaWatt
3/18/20 03:32:44z HTTP server started
3/18/20 03:32:44z timeSync: service started.
3/18/20 03:32:44z statService: started.
3/18/20 03:32:44z dataLog: service started.
3/18/20 03:32:44z dataLog: Log file open failed. 2
3/18/20 03:32:44z Program halted.

When you start putty, it causes a restart of the IoTaWatt in the middle of getting started, before the iotalog file is established. It will also be at least a minute before the history log file is opened.

Could you try to reset the SD with the null files and power it up without using putty, watching the leds instead.

I don’t know where you are located, but at this point I can also offer to have you simply send me the unit and I’ll reflash it with the latest release. Also, if you gave me the zip of the old SD, I could restore your config and possibly the history log if it’s not damaged.

Success!!

I avoided connecting PuTTY and, voila, it works fine. The fact that using PuTTY restarts the system was counter-intuitive to me. LEDs are Green-Green-Green and once again connected to Emoncms and PVoutput!

I have successfully reloaded both my orginal configuration and the histlog.log file.

Many, many thanks for your help - currently back in “production.”

1 Like

You might set auto-update to MINOR or BETA to get rid of that interim release.