02_03_13 now ALPHA, BETA, MINOR auto-update

As previously posted, the 02_03_xx series is the culmination of the past six months development and most of the features have been running in various APLHA class releases for months. The lingering problems dealt with memory leaks and communications problems which have been largely resolved in this release. The only known problem is a minor memory leak when authorization passwords are used.

This release also reverts to an officially released ESP8266 core (2.4.1). Some of the previous ALPHAs used the development core.

With success of this release, the hope is that it can go MAJOR auto-update soon. There are no known incompatibilities with previous releases. The auto-update process is secure with a digitally signed update package. The update will also replace the configuration app to support the new features and install a new table file to add menu picks for new VTs and CTs.

Hi there. I am trying to update from an older alpha to this new minor version and received the following:

8/22/18 22:55:33z Updater: Update from 02_03_07 to 02_03_13
8/22/18 22:55:33z Updater: download 02_03_13
8/22/18 22:55:34z influxDB: started.
8/22/18 22:56:52z Updater: Release downloaded 79277ms, size 599096
8/22/18 22:57:00z Update file format error.
8/22/18 23:00:34z Updater: Update from 02_03_07 to 02_03_13
8/22/18 23:00:34z Updater: download 02_03_13
8/22/18 23:01:55z Updater: Release downloaded 80792ms, size 599096
8/22/18 23:02:02z Update file format error.

I then tried with an update class of alpha instead of minor and now the device is not responding on HTTP. The LED is solid green and is still responding to pings. I left it for over 10 minutes and then power cycled. Same symptoms. I guess it’s time to pull the unit out and re-flash it again manually. (This is why I had automatic updates disabled.)

I’m not convinced you need to re-flash. Here’s what I see:

It’s taking 79-80 seconds to download 600K, that’s very slow. Typical download lime for this release is 5-6 seconds. In the process there is some corruption of the file.

There have been some changes to release download since June when 02_03_07 came out, but you won’t get them until you can actually download the new release - catch-22. Also, even though it seems to be working much better now, you seem to have a very bad connection so not sure what will happen going forward.

About your symptoms:

Because ALPHA and MINOR are currently the same release, there is no difference between trying to download with auto-update set to one or the other.

The response to pinging is a knee-jerk reaction for the ESP8266. It’s done in very low level code that is more or less reflexive and does not vary from release to release. In fact, it’s probably the same in just about every other IoT application using the ESP. It does not indicate anything useful about the state of the firmware, only that the ESP has not burned up.

I’m curious what the led does when you power it back up after a cycle. By that I mean what changes it goes through before going to solid green. Does it appear on your router device list?

With the device powered down, could you read the SDcard and copy out the iotawatt/iotamsgs.txt file?

With the unit open and running in the solid green state, could you press the reset button to the left of the USB plug, let it get back to solid green, do it again, then after it goes to solid green again power it down. Then remove the SDcard and copy off iotawatt/iotamsgs.txt and post it for me?

That log should provide me with more information about what is happening. It’s possible it’s stuck just trying to download the new release with a hopelessly slow connection. I should be able to tell and advise what to do.

Serial console reveals it’s still on 02_03_07 and the data log is now corrupt:

8/22/18 23:30:21z dataLog: service started.
Datalog inconsistent: size:

A short while after, more serial output:


HTTP seems unresponsive so I cannot use the deletelog commands. Disk Utility on the SD card said:

size of /IOTAWATT/IOTALOG.LOG is 347590912, should at most be 347590656

Same error message so I manually deleted IOTALOG.LOG and IOTALOG.NDX. That got it going again and now it’s attempting the update again.

I feel like this is at least the 3rd time an update has resulted in SD card corruption. The previous times this happened I erased the SD card. Looks like I might have to do that again as this is the last message from the serial console:

8/22/18 23:39:32z Updater: Release downloaded 84493ms, size 599096

5 minutes later still solid green LED, no HTTP, ping still works. Powercycled and got a “Datalog inconsistent” error again. This time fsck says HISTLOG got corrupted. I’m going to now format the SD card (with a full erase for good measure), restore 02_03_07 files, my config.txt, and try again.

Some time later I have managed to create a 2 GB FAT16 partition on the SD card. I thought I had an 8 GB FAT32 partition before but this was giving an mkdir failed: /IotaWatt error.

ALPHA update from 02_03_07 to 02_03_13 failed again:

8/23/18 00:32:45z Updater: Release downloaded 78841ms, size 599608
8/23/18 00:32:54z Updater: Signature does not verify.

Switched it to MINOR and restarted:

8/23/18 00:34:46z Updater: Release downloaded 77780ms, size 599096
8/23/18 00:34:54z Update file format error.

Switched back to ALPHA and download failed again:

8/23/18 00:39:15z Updater: Update from 02_03_07 to 02_03_13
8/23/18 00:39:15z Updater: download 02_03_13
8/23/18 00:39:17z influxDB: started.
Max samples exceeded.
Max samples exceeded.
Max samples exceeded.
Max samples exceeded.
Max samples exceeded.
Max samples exceeded.
8/23/18 00:40:35z Updater: Release downloaded 80310ms, size 598072
8/23/18 00:40:44z Update file format error.

Downloads have always been this slow. Tried again a couple of times with no success so I broke out esptool and flashed the firmware and replaced the SD card contents with the 02_03_13 files. It’s all up and running again. I guess we’ll see what happens next time there’s an update.

I would have liked to see that iotamsgs.txt file. I’m not going to get into dissecting what you describe, it got you running again, but leaves a few questions lingering for me. There are a number of things fixed between 07 and 13 that may have contributed to your problems.

But on the bright side… you have 13 running, so could you take a look at the WiFi connected message in the message log and see what the channel and RSSI is? That’s new in 13 and might help determine your connectivity problem. Do you consider your WiFi and internet to be reasonably fast?

I meant to take a copy of this before I erased the SD card but did not. Sorry.

channel 11, RSSI -68db.

The access point says it has a data rate of 65 Mb/s and an RSSI of -57 dBm.

Yes. I just ran a speed test on my phone next to the IoTaWatt after ensuring it was connected to the same access point and got a stable 89 Mbps down / 37 Mbps up. That was on 5 GHz though as I don’t have a way to force my phone to 2.4 GHz (without changing AP settings). This is very close to the line speed of my internet connection.

FYI wget http://iotawatt.com/firmware/bin/02_03_13.bin takes ~1.3 seconds on my workstation.