Old IoTaWatt Device Firmware unable to update Resolved


#1

Hi Bob,

This-weekend I manually re-flashed my IoTaWatt back to an older version: 02_03_15 (checkout that tag and compiled from source) and expected it to update.

I looked at the logs and it failed to update. I believe at some point you have probably made a change in the updater web service to correctly pass a null-terminator in the response with the version string for the device to use that was probably missing in earlier versions.

The old versions of the IoTaWatt are unable to use this new null-terminated string and fail to update to newer versions as they check “request->available() != 8” and with a null terminator it is not 9 characters. This is changed/fixed in new versions of the code.

This means if anyone has a device that was turned off (or offline) for a long time, there is a chance it will never update.

I would suggest changing the updater web-server to return non-null terminated version strings for older versions so they can able to be updated and keep the correct new behavior for recent client requests. I didn’t go through the history to find out where this change was made.

I was fine to work-around this problem so no need to fix it for me.


#2

Thanks Brendon, I’ll look into that.


#3

Hi Brendon,
I was just looking at this and I’m guessing that your auto update class was MAJOR. I didn’t see any changes in the code that you described, but I think you were on the right track. The auto-update server code is a simple php script that I maintain manually, and apparently when I updated MAJOR to 02_03_20 I specified the string '02_03_20 ’ (trailing blank). Could you check if that might have been the problem? I’ve just actually changed it to ‘02_03_21’.

Thanks


#4

That would be the culprit. I was on MAJOR.

I didn’t actually look at the returned result just saw that it was 1 character too long and assumed it had some null terminator included in the string. It is a bit difficult for me to re-test this again as I moved on from it and don’t want to wipe the new changes.


#5

I think that’s enough confirmation. Thanks.