Doesn't connect/startup after power failure

This is unfortunately our life in South Africa there we have power failures.

SO the IOTAWatt connect to a range extender that’s connected to the main router. Now after power failures and not every one I need to restart the IOTAWATT to work. Not sure if it’s the network that isn’t up by the time it boots or what it is. 05h15 was when it started up from the power failure and 07h15 was when I manually restarted. So it doesn’t look like it tried to restart after an hour.

** Restart **

SD initialized.
2/10/21 05:15:59z Real Time Clock is running. Unix time 1612934159
2/10/21 05:15:59z Power failure detected.
2/10/21 05:15:59z Reset reason: External System
2/10/21 05:15:59z ESP8266 ChipID: 12676588
2/10/21 05:15:59z IoTaWatt 5.0, Firmware version 02_05_12
2/10/21 05:15:59z SPIFFS mounted.
2/10/21 07:15:59 Local time zone: +2:00
2/10/21 07:15:59 device name: IotaWatt
2/10/21 07:16:02 Connecting with WiFiManager.
2/10/21 07:16:05 HTTP server started
2/10/21 07:16:06 WiFi connected. SSID=bulky@home, IP=192.168.0.136, channel=4, RSSI -86db
2/10/21 07:16:06 MDNS responder started for hostname IotaWatt
2/10/21 07:16:06 LLMNR responder started for hostname IotaWatt
2/10/21 07:16:06 timeSync: service started.
2/10/21 07:16:09 statService: started.
2/10/21 07:16:09 Updater: service started. Auto-update class is BETA
2/10/21 07:16:09 dataLog: service started.
2/10/21 07:16:09 dataLog: Last log entry 02/10/21 02:00:10
2/10/21 07:16:10 EmonService: started. url=HTTP://192.168.0.247/emoncms, node=IotaWatt, interval=10
2/10/21 07:16:10 Updater: Auto-update is current for class BETA.
2/10/21 07:16:11 EmonService: Start posting at 02/04/21 08:10:15
2/10/21 07:17:10 historyLog: service started.
2/10/21 07:17:10 historyLog: Last log entry 02/10/21 02:00:00

Some Info and Firmware version I am running


Thank Rudolph

When IoTaWatt first starts, it reads its RTC and initialized its internal clock. The RTC is always maintained in UTC or GMT as it was previously known. It timestamps messages in the log with that time but doesn’t yet know the local time offset, so it appends a ‘Z’ to the time stamp to indicate UTC.

When it processes the configuration file, the local time offset is learned and subsequently the timestamps are in local time, and there is no ‘Z’ appended.

In your +2 time zone, 05:15:59z is the same as 07:15:59.

The WiFi connection occurred at 07:16:06, 7 seconds after restart from the power failure.

That explains a lot. Maybe the other question.

Can the IOTAWatt not have logged the failed attempt at starting after the power failure ?
Or could something like the SD card be corrupted and only fix itself when I restart it again?
Unfortunately like I real user I didn’t notice what’s happening to the light. But will when it happens again.

As you can see we only had 2h30 power outage but only came online at 07h15

And here’s the log of the last 2 restarts. It should have tried to start at 04h30 or 02h30z:
** Restart **

SD initialized.
2/09/21 14:16:24z Real Time Clock is running. Unix time 1612880184
2/09/21 14:16:24z Reset reason: Software/System restart
2/09/21 14:16:24z Trace: 1:3, 1:4, 1:5[3], 3:0, 3:11, 1:6, 1:1[8], 1:2[9], 9:0[9], 9:0, 9:1, 8:4, 8:6, 8:8, 8:9, 9:3, 9:5, 9:9, 1:2, 1:3, 1:4, 1:5[3], 3:0, 3:11, 1:6, 1:3, 1:4, 1:5[21], 21:0, 21:1, 21:10, 21:10
2/09/21 14:16:24z ESP8266 ChipID: 12676588
2/09/21 14:16:24z IoTaWatt 5.0, Firmware version 02_05_12
2/09/21 14:16:24z SPIFFS mounted.
2/09/21 16:16:24 Local time zone: +2:00
2/09/21 16:16:24 device name: IotaWatt
2/09/21 16:16:24 HTTP server started
2/09/21 16:16:24 timeSync: service started.
2/09/21 16:16:24 statService: started.
2/09/21 16:16:25 dataLog: service started.
2/09/21 16:16:25 dataLog: Last log entry 02/09/21 16:16:20
2/09/21 16:16:29 EmonService: started. url=HTTP://192.168.0.247/emoncms, node=IotaWatt, interval=10
2/09/21 16:17:25 historyLog: service started.
2/09/21 16:17:25 historyLog: Last log entry 02/09/21 16:16:00
2/09/21 16:19:07 Updater: service started. Auto-update class is BETA
2/09/21 16:19:07 WiFi connected. SSID=bulky@home, IP=192.168.0.136, channel=5, RSSI -87db
2/09/21 16:19:07 MDNS responder started for hostname IotaWatt
2/09/21 16:19:07 LLMNR responder started for hostname IotaWatt
2/09/21 16:19:08 EmonService: Start posting at 02/09/21 16:15:50
2/09/21 16:19:08 Updater: Auto-update is current for class BETA.
2/09/21 21:35:21 WiFi disconnected.
2/09/21 21:37:38 WiFi connected. SSID=bulky@home, IP=192.168.0.136, channel=4, RSSI -87db

** Restart **

SD initialized.
2/10/21 05:15:59z Real Time Clock is running. Unix time 1612934159
2/10/21 05:15:59z Power failure detected.
2/10/21 05:15:59z Reset reason: External System
2/10/21 05:15:59z ESP8266 ChipID: 12676588
2/10/21 05:15:59z IoTaWatt 5.0, Firmware version 02_05_12
2/10/21 05:15:59z SPIFFS mounted.
2/10/21 07:15:59 Local time zone: +2:00
2/10/21 07:15:59 device name: IotaWatt
2/10/21 07:16:02 Connecting with WiFiManager.
2/10/21 07:16:05 HTTP server started
2/10/21 07:16:06 WiFi connected. SSID=bulky@home, IP=192.168.0.136, channel=4, RSSI -86db
2/10/21 07:16:06 MDNS responder started for hostname IotaWatt
2/10/21 07:16:06 LLMNR responder started for hostname IotaWatt
2/10/21 07:16:06 timeSync: service started.
2/10/21 07:16:09 statService: started.
2/10/21 07:16:09 Updater: service started. Auto-update class is BETA
2/10/21 07:16:09 dataLog: service started.
2/10/21 07:16:09 dataLog: Last log entry 02/10/21 02:00:10
2/10/21 07:16:10 EmonService: started. url=HTTP://192.168.0.247/emoncms, node=IotaWatt, interval=10
2/10/21 07:16:10 Updater: Auto-update is current for class BETA.
2/10/21 07:16:11 EmonService: Start posting at 02/04/21 08:10:15
2/10/21 07:17:10 historyLog: service started.
2/10/21 07:17:10 historyLog: Last log entry 02/10/21 02:00:00

Is there maybe any other logs I can look at or in some way enable debug mode ?

Thanks Rudolph

The power to the IoTaWatt went off at 02:00:10 and came back on at 07:15:59.

You may have observed something different, but the IoTaWatt power was restored as logged.

I think that’s the problem. I was strangely awake and don’t ask why, at 04h30 when the power went on.

When I went and looked at 07h00 it didn’t power on but it had power. Will check when it happens which lights might be flashing.

So I had power from 04h30 till 07h00 when and notice the IOTAWatt wasn’t online and I did the restart.

Yes definitely observe any LED indications. The WiFi is a red-herring because IoTaWatt will record offline until WIFI is restored. Also, it’s unusual, and would be too coincidental, but it is possible for only one or two phases to be active. I see that your phase A had no load this morning, and so if it was out, you could see power in the phase C circuits that seem to be the only things active, but the IoTaWatt powered on phase A would still be off.

Solid red light. That’s all I saw on the IOTAWatt when the power came on.

And to fix it all I did was pull out the plug and plug it in again.

Can it be that the IOTAWatt boots faster than my WIFI network when the power comes on and then doesn’t retry or see that the network comes up later ?

This is where I plugged in the plug and it started fine.
2/10/21 18:04:23 WiFi disconnected.
2/10/21 18:04:33 WiFi connected. SSID=bulky@home, IP=192.168.0.136, channel=10, RSSI -83db

** Restart **

SD initialized.
2/10/21 18:11:17z Real Time Clock is running. Unix time 1612980677
2/10/21 18:11:17z Power failure detected.
2/10/21 18:11:17z Reset reason: Power on
2/10/21 18:11:17z ESP8266 ChipID: 12676588
2/10/21 18:11:17z IoTaWatt 5.0, Firmware version 02_05_12
2/10/21 18:11:17z SPIFFS mounted.
2/10/21 20:11:17 Local time zone: +2:00
2/10/21 20:11:17 device name: IotaWatt
2/10/21 20:11:20 Connecting with WiFiManager.
2/10/21 20:11:23 HTTP server started
2/10/21 20:11:23 WiFi connected. SSID=bulky@home, IP=192.168.0.136, channel=10, RSSI -82db
2/10/21 20:11:23 MDNS responder started for hostname IotaWatt
2/10/21 20:11:24 LLMNR responder started for hostname IotaWatt
2/10/21 20:11:24 timeSync: service started.

Please ignore my phases. It isn’t nicely balanced because the previous owners mostly used the 3 phase for a pottery kiln.

I need a context to explain these two statements.

Solid red light, like solid green, means it’s sampling and logging data. The difference is that when it’s red, there is no WiFi connection. So if you are saying it was solid red that this morning between 4:30 and 7:00am when your power was on and IoTaWatt was not logging, I have to push back on that. There would be data in the datalog.

If you are running experiments with power cycling the IoTaWatt with and without WiFi, then I think you will find that there is data for the periods when you observe it as solid red, and when reconnected to WiFi, IoTaWatt will upload that data to Emoncms.

It definitely boots faster than a router. Takes 2-3 seconds. Sometimes it doesn’t subsequently connect when the router comes up, but it is logging (solid red) and will restart after an hour with no WiFi and then fully recover any backlog to upstream servers like Emoncms.

Ok understanding a bit better everytime.

This morning it restarted and def start up before the wifi be it corrected itself and restarted the wifi to connect.

** Restart **

SD initialized.
2/11/21 02:17:41z Real Time Clock is running. Unix time 1613009861
2/11/21 02:17:41z Power failure detected.
2/11/21 02:17:41z Reset reason: Power on
2/11/21 02:17:41z ESP8266 ChipID: 12676588
2/11/21 02:17:41z IoTaWatt 5.0, Firmware version 02_05_12
2/11/21 02:17:41z SPIFFS mounted.
2/11/21 04:17:41 Local time zone: +2:00
2/11/21 04:17:41 device name: IotaWatt
2/11/21 04:17:44 Connecting with WiFiManager.
2/11/21 04:19:53 Did not connect after power-fail. Restarting to reset WiFi.

** Restart **

SD initialized.
2/11/21 02:19:55z Real Time Clock is running. Unix time 1613009995
2/11/21 02:19:55z Reset reason: Software/System restart
2/11/21 02:19:55z 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, 11:0, 11:4, 11:5, 11:5, 11:6, 11:7, 11:8, 11:9, 16:0, 16:1, 16:2, 16:3, 16:4, 16:5, 16:6, 16:7, 11:10, 11:11, 11:12, 11:12
2/11/21 02:19:55z ESP8266 ChipID: 12676588
2/11/21 02:19:55z IoTaWatt 5.0, Firmware version 02_05_12
2/11/21 02:19:55z SPIFFS mounted.
2/11/21 04:19:55 Local time zone: +2:00
2/11/21 04:19:55 device name: IotaWatt
2/11/21 04:19:55 HTTP server started
2/11/21 04:19:55 timeSync: service started.
2/11/21 04:19:55 statService: started.

But thanks for the info. Will continue montoring.

You might want to consider a UPS for your IotaWatt. I recently added this to my setup:
Amazon.com: Mini UPS Battery Backup 10000mAH Uninterruptible Power Supply for WiFi, Router, Modem, Security Camera with Input DC/USB Output USB 5V DC 5V/9V/12V 2A (5V-12V DC): Home Audio & Theater

I tried some others that are listed as power packs, but they tend to drop power when the external power switches. This one does not. It also has other voltages, which I am going to use to power my other devices in the same area. I have 2 IotaWatts hooked up to the USB output and they have been working fine. I measured the consumption of this UPS and it appears to “waste” 1W, i.e. my consumption is about 1W higher with the UPS in place. I consider this to be low enough to not worry about.

I have a lot of power fluctuations in my area and have experienced what appears to be data log corruption that might or might not have been caused by poor power quality. As a bonus you can see the outages. Here is the one we had this morning:


You can see it drop, come back, drop again, come up on generator power. There was a tree that came down on the distribution lines not too far from my house. Prime power was off for about an hour.