IoTaWatt won't reconnect to wifi after power outage

I had a power outage a few days ago and today I noticed that I don’t have any new power readings from my IoTaWatt. The last readings are immediately before the power outage. The led on the device is a solid red. I have an access point around 30 ft away. I tried following the troubleshooting instructions, but it’s not broadcasting an AP and my network shows it as offline. What do I need to check next?

Cycle power and notice the led sequences as it starts.

The LED didn’t have a sequence. It was constantly red from the time I powered it up. I solved it by flashing firmware from the GitHub. Thank you.

I’m happy that you are connected again, but wanted to follow up as others will read this post and determine that flashing their unit is the solution to whatever ails them. To them I want to say that flashing the unit is only a last resort when recommended after other diagnostic efforts fail. I’ve never actually recommended it. If it came to that I would supply a replacement PCB because a unit that requires flashing is defective.

1 Like

When I looked at the logs it looks like it was updating to the latest firmware when I lost power. If it would help troubleshooting what caused the issue I’d be more than happy to provide whatever you need. I’ve had the device for around a year now and this was my first issue.

We’ll never know. The firmware update is an atomic operation. There are two flash areas for firmware and the new firmware is written to the inactive area, the hash of the new firmware is verified, then a pointer to the new area is updated before restarting. At no time should there be a window where the pointer points to a partial or otherwise corrupt firmware.

That said, I would be curious about a few things in the message log both right before the update and the complete restart after the reflash.

I had a similar issue. It looks like the iotawatt reconnect to the wifi before the DHCP server was up, so it got/used a self-assigned IP address, which it never invalidated and refreshed. The top part of the log (attached) was from after the power came back, and I needed to power-cycle the iotawatt to get a real IP address.

As it happens, my other iotawatt is also having a (different) problem. After the power came back, it seems to have an IP address, but is very slow responding, and looks like it’s getting an incomplete page in the web-ui, which means buttons etc don’t work, so I can’t see the logs (without going out there and rebooting it too). See second attachment for page-load (too many seconds), then attempting to click.

Do iotawatt just not deal with unexpected power cycling very well?

It does sound like you have some problems, but I’m not going for the DHCP server not up so it used a self-assigned IP address explanation without something more substantial in the way of evidence. From what I can see, in the space of one minute, the Wifi disconnected then reconnected with IP 169.254.201.34. Then two seconds later disconnected and connected with IP 192.168.30.205, then a few seconds later disconnected and reconnected with IP 169.254.201.34 again. If it’s the DHCP server, it is going down and up and down again in the space of a minute. Fifteen hours later when it restarted after a power cycle, the log shows it was running and logging right up until the power cycle, and it appears to have restarted and connected fine. Prior to the restart, it had that bogus IP address so you probably couldn’t access it.

Given that you are also having problems with another IoTaWatt unit, it seems more likely that the problem is with the WiFi.

Yes, something crazy with the IP addresses. The router + DHCP server were stuck for ~30 minutes after the power came back (different issue), so the 168.254.* addresses are link-local IPs, normally used when a device can’t get to the DHCP server. I think the reason for the “stuck” was that the device hadn’t refreshed the IP address from the DHCP server. Likely a problem with iotawatt firmware? (none of my other devices had this issue, they all came back over the course of an hour or two).

I think the problem with the second iotawatt is likely that it’s connected to the wrong AP (there’s a close one, and a far one), and hasn’t moved for some reason.

I’m having a similar issue since the latest minor update, it seems like MDNS is not responding. Forcing a wifi reconnect seems to bring the .local address back up, I can connect directly to the IP address. Uploads appear unimpaired.

3/04/23 15:26:01z Updater: Installing update files for version 02_07_05
3/04/23 15:26:01z Updater: Installing GRAPH.HTM
3/04/23 15:26:01z Updater: Installing GRAPH.JS
3/04/23 15:26:01z Updater: Installing GRAPH2.HTM
3/04/23 15:26:02z Updater: Installing GRAPH2.JS
3/04/23 15:26:02z Updater: Installing INDEX.HTM
3/04/23 15:26:03z Updater: Installing TABLES.TXT
3/04/23 15:26:04z Updater: Installing CNFSTYLE.CSS
3/04/23 15:26:04z Updater: Installing EDIT.HTM
3/04/23 15:26:04z Updater: Installing FAVICON.ICO
3/04/23 15:26:05z Updater: Installation complete.
3/04/23 15:26:05z SPIFFS mounted.
3/04/23 11:26:05 Local time zone: -4:00, using DST/BST when in effect.
3/04/23 11:26:05 device name: IotaWatt
3/04/23 11:26:05 HTTP server started
3/04/23 11:26:05 emoncms: Starting, interval:10, url:http://emoncms.org
3/04/23 11:26:06 influxDB_v2: Starting, interval:10, url:http://linuxhpmini.local:8086
3/04/23 11:26:06 timeSync: service started.
3/04/23 11:26:06 statService: started.
3/04/23 11:26:06 dataLog: service started.
3/04/23 11:26:07 dataLog: Last log entry 03/04/23 11:25:30
3/04/23 11:26:10 TotalWh: Started
3/04/23 11:26:10 TotalWh: Last log entry 03/04/23 11:25:30
3/04/23 11:26:11 historyLog: service started.
3/04/23 11:26:11 historyLog: Last log entry 03/04/23 11:25:00
3/04/23 11:26:15 WiFi connected. SSID=LCF9112, IP=192.168.1.85, channel=11, RSSI -71db
3/04/23 11:26:15 MDNS responder started for hostname IotaWatt
3/04/23 11:26:15 LLMNR responder started for hostname IotaWatt
3/04/23 11:26:15 Updater: service started. Auto-update class is MINOR
3/04/23 11:26:15 emoncms: Start posting at 03/04/23 11:25:20
3/04/23 11:26:16 PVoutput: started
3/04/23 11:26:18 Updater: Update from 02_07_05 to 02_08_02
3/04/23 11:26:18 Updater: download 02_08_02
3/04/23 11:26:18 PVoutput: System MedfordHome, interval 5, donator mode
3/04/23 11:26:18 PVoutput: Reload status beginning 02/01/23 00:05:00
3/04/23 11:26:26 Updater: Release downloaded 7808ms, size 964192
3/04/23 11:26:37 Updater: signature verified
3/04/23 11:26:45 Updater: firmware upgraded to version 02_08_02
3/04/23 11:26:45 Updater: Firmware updated, restarting.

** Restart **

SD initialized.
3/04/23 15:26:55z Real Time Clock is running. Unix time 1677943615
3/04/23 15:26:55z Reset reason: Software/System restart
3/04/23 15:26:55z Trace: 18:3, 18:2, 18:3, 18:2, 18:3, 18:2, 18:3, 18:4, 18:5, 1:6[6], 1:3, 1:3, 1:6[1], 1:6[2], 1:6[2], 1:6[3], 1:5[31], 1:6[4], 31:0, 31:1, 31:2[7], 31:1, 1:6[6], 1:3, 1:3, 1:6[1], 1:6[2], 1:6[3], 1:5[5], 1:6[4], 5:0, 5:7
3/04/23 15:26:55z ESP8266 ID: 569805, RTC M41T81 (68)
3/04/23 15:26:55z IoTaWatt 5.0, Firmware version 02_08_02
3/04/23 15:26:55z Updater: Installing update files for version 02_08_02
3/04/23 15:26:55z Updater: Installing EDIT.HTM
3/04/23 15:26:55z Updater: Installing FAVICON.ICO
3/04/23 15:26:56z Updater: Installing GRAPH.HTM
3/04/23 15:26:56z Updater: Installing GRAPH.JS
3/04/23 15:26:56z Updater: Installing GRAPH2.HTM
3/04/23 15:26:56z Updater: Installing GRAPH2.JS
3/04/23 15:26:57z Updater: Installing INDEX.HTM
3/04/23 15:26:58z Updater: Installing TABLES.TXT
3/04/23 15:26:58z Updater: Installing CNFSTYLE.CSS
3/04/23 15:26:59z Updater: Installation complete.
3/04/23 15:26:59z SPIFFS mounted.
3/04/23 11:26:59 Local time zone: -4:00, using DST/BST when in effect.
3/04/23 11:26:59 device name: IotaWatt
3/04/23 11:26:59 HTTP server started
3/04/23 11:26:59 emoncms: Starting, interval:10, url:http://emoncms.org
3/04/23 11:26:59 influxDB_v2: Starting, interval:10, url:http://linuxhpmini.local:8086
3/04/23 11:26:59 timeSync: service started.
3/04/23 11:26:59 statService: started.
3/04/23 11:27:00 dataLog: service started.
3/04/23 11:27:01 dataLog: Last log entry 03/04/23 11:26:25
3/04/23 11:27:04 TotalWh: Started
3/04/23 11:27:04 TotalWh: Last log entry 03/04/23 11:26:25
3/04/23 11:27:05 historyLog: service started.
3/04/23 11:27:05 historyLog: Last log entry 03/04/23 11:26:00
3/04/23 11:27:09 PVoutput: started
3/04/23 11:27:09 Updater: service started. Auto-update class is MINOR
3/04/23 11:27:09 WiFi connected. SSID=LCF9112, IP=192.168.1.85, channel=11, RSSI -71db
3/04/23 11:27:09 emoncms: Start posting at 03/04/23 11:26:20
3/04/23 11:27:10 PVoutput: System MedfordHome, interval 5, donator mode
3/04/23 11:27:12 Updater: Update from 02_08_02 to 02_07_05
3/04/23 11:27:12 Updater: download 02_07_05
3/04/23 11:27:12 PVoutput: Reload status beginning 02/01/23 00:05:00
3/04/23 11:27:20 Updater: Release downloaded 6983ms, size 951104
3/04/23 11:27:30 Updater: signature verified
3/04/23 11:27:39 Updater: firmware upgraded to version 02_07_05
3/04/23 11:27:39 Updater: Firmware updated, restarting.

** Restart **

SD initialized.
3/04/23 15:27:48z Real Time Clock is running. Unix time 1677943668
3/04/23 15:27:48z Reset reason: Software/System restart
3/04/23 15:27:48z Trace: 1:6[2], 1:6[2], 1:6[2], 1:6[3], 1:5[31], 1:6[4], 31:0, 31:1, 31:2[7], 31:1, 1:6[6], 1:1[2], 1:2[3], 9:0[3], 9:0, 9:1, 8:4, 8:6, 8:8, 9:3, 9:5, 9:9, 1:3, 1:3, 1:6[1], 1:6[2], 1:6[2], 1:6[3], 1:5[5], 1:6[4], 5:0, 5:7
3/04/23 15:27:48z ESP8266 ID: 569805, RTC M41T81 (68)
3/04/23 15:27:48z IoTaWatt 5.0, Firmware version 02_07_05
3/04/23 15:27:48z Updater: Installing update files for version 02_07_05
3/04/23 15:27:48z Updater: Installing GRAPH.HTM
3/04/23 15:27:48z Updater: Installing GRAPH.JS
3/04/23 15:27:48z Updater: Installing GRAPH2.HTM
3/04/23 15:27:49z Updater: Installing GRAPH2.JS
3/04/23 15:27:49z Updater: Installing INDEX.HTM
3/04/23 15:27:50z Updater: Installing TABLES.TXT
3/04/23 15:27:51z Updater: Installing CNFSTYLE.CSS
3/04/23 15:27:51z Updater: Installing EDIT.HTM
3/04/23 15:27:51z Updater: Installing FAVICON.ICO
3/04/23 15:27:52z Updater: Installation complete.
3/04/23 15:27:52z SPIFFS mounted.
3/04/23 11:27:52 Local time zone: -4:00, using DST/BST when in effect.
3/04/23 11:27:52 device name: IotaWatt
3/04/23 11:27:52 HTTP server started
3/04/23 11:27:53 emoncms: Starting, interval:10, url:http://emoncms.org
3/04/23 11:27:53 influxDB_v2: Starting, interval:10, url:http://linuxhpmini.local:8086
3/04/23 11:27:53 timeSync: service started.
3/04/23 11:27:53 statService: started.
3/04/23 11:27:53 dataLog: service started.
3/04/23 11:27:54 dataLog: Last log entry 03/04/23 11:27:20
3/04/23 11:27:58 historyLog: service started.
3/04/23 11:27:58 historyLog: Last log entry 03/04/23 11:27:00
3/04/23 11:27:58 TotalWh: Started
3/04/23 11:27:59 TotalWh: Last log entry 03/04/23 11:27:20
3/04/23 11:28:02 WiFi connected. SSID=LCF9112, IP=192.168.1.85, channel=11, RSSI -63db
3/04/23 11:28:02 MDNS responder started for hostname IotaWatt
3/04/23 11:28:02 LLMNR responder started for hostname IotaWatt
3/04/23 11:28:02 Updater: service started. Auto-update class is MINOR
3/04/23 11:28:02 emoncms: Start posting at 03/04/23 11:27:10
3/04/23 11:28:03 PVoutput: started
3/04/23 11:28:05 Updater: Auto-update is current for class MINOR.
3/04/23 11:28:05 Updater: update tables from 0.0.4 to 0.0.7
3/04/23 11:28:05 PVoutput: System MedfordHome, interval 5, donator mode
3/04/23 11:28:06 PVoutput: Reload status beginning 02/01/23 00:05:00
3/04/23 12:28:12 Updater: Update from 02_07_05 to 02_08_02
3/04/23 12:28:12 Updater: download 02_08_02
3/04/23 12:28:20 Updater: Release downloaded 7609ms, size 964192
3/04/23 12:28:30 Updater: signature verified
3/04/23 12:28:39 Updater: firmware upgraded to version 02_08_02
3/04/23 12:28:39 Updater: Firmware updated, restarting.

** Restart **

SD initialized.
3/04/23 16:28:49z Real Time Clock is running. Unix time 1677947329
3/04/23 16:28:49z Reset reason: Software/System restart
3/04/23 16:28:49z Trace: 1:6[3], 1:5[22], 1:6[4], 22:0, 22:1, 22:0, 22:80, 22:85, 22:2, 1:6[6], 1:3, 1:3, 1:6[1], 1:6[2], 1:6[2], 1:6[3], 1:5[31], 1:6[4], 31:0, 31:1, 31:2[7], 31:1, 1:6[6], 1:3, 1:3, 1:6[1], 1:6[2], 1:6[3], 1:5[5], 1:6[4], 5:0, 5:7
3/04/23 16:28:49z ESP8266 ID: 569805, RTC M41T81 (68)
3/04/23 16:28:49z IoTaWatt 5.0, Firmware version 02_08_02
3/04/23 16:28:49z Updater: Installing update files for version 02_08_02
3/04/23 16:28:49z Updater: Installing EDIT.HTM
3/04/23 16:28:49z Updater: Installing FAVICON.ICO
3/04/23 16:28:50z Updater: Installing GRAPH.HTM
3/04/23 16:28:50z Updater: Installing GRAPH.JS
3/04/23 16:28:50z Updater: Installing GRAPH2.HTM
3/04/23 16:28:50z Updater: Installing GRAPH2.JS
3/04/23 16:28:51z Updater: Installing INDEX.HTM
3/04/23 16:28:52z Updater: Installing TABLES.TXT
3/04/23 16:28:53z Updater: Installing CNFSTYLE.CSS
3/04/23 16:28:53z Updater: Installation complete.
3/04/23 16:28:53z SPIFFS mounted.
3/04/23 12:28:53 Local time zone: -4:00, using DST/BST when in effect.
3/04/23 12:28:53 device name: IotaWatt
3/04/23 12:28:53 HTTP server started
3/04/23 12:28:53 emoncms: Starting, interval:10, url:http://emoncms.org
3/04/23 12:28:53 influxDB_v2: Starting, interval:10, url:http://linuxhpmini.local:8086
3/04/23 12:28:53 timeSync: service started.
3/04/23 12:28:54 statService: started.
3/04/23 12:28:54 dataLog: service started.
3/04/23 12:28:55 dataLog: Last log entry 03/04/23 12:28:20
3/04/23 12:28:58 TotalWh: Started
3/04/23 12:28:58 TotalWh: Last log entry 03/04/23 12:28:20
3/04/23 12:28:59 historyLog: service started.
3/04/23 12:28:59 historyLog: Last log entry 03/04/23 12:28:00
3/04/23 12:29:03 PVoutput: started
3/04/23 12:29:03 Updater: service started. Auto-update class is MINOR
3/04/23 12:29:03 WiFi connected. SSID=LCF9112, IP=192.168.1.85, channel=11, RSSI -60db
3/04/23 12:29:03 emoncms: Start posting at 03/04/23 12:28:10
3/04/23 12:29:04 PVoutput: System MedfordHome, interval 5, donator mode
3/04/23 12:29:06 Updater: Auto-update is current for class MINOR.
3/04/23 12:29:06 PVoutput: Reload status beginning 02/01/23 00:05:00
3/13/23 18:03:17 WiFi disconnected.
3/13/23 18:03:19 WiFi connected. SSID=LCF9112, IP=192.168.1.85, channel=11, RSSI -58db