How to force upgrade

Hello.
3 days ago, after a 15min long power failure, my iotawatt stopped sending data to Emoncms.
I tried to connect directly to the device but it seems like the files of the interface have been corrupted somehow, for instance, all the head block of the index.html is missing.
The system was set in OTA update on the alpha release, I can guess something went wrong with some recent upgrade.
Is there a way to force the upgrade of the system, or to access the files of the firmware through wifi? Or do I have to take the SD card and flash it with a new installation?
Thanks in advance.

1 Like

I’m assuming you are unable to run the configuration app. Without that, there is no way to force an update. If you can run the config app, let me know that and disregard everything else I’m going to tell you now.

First, is the IoTaWatt working at all? Specifically, what is the state of the LED. If it’s red, that means there is no WiFi connection. If it is a dull green, that’s good. It means it’s working and probably logging locally.

The htm files on the SDcard are available from the SD direcory in the github repo. You can power down the IoTaWatt, move the SDcard to a computer and replace all of the files found in the SD directory on gihub except CONFIG.TXT. Replace the card and restart the IoTaWatt. If it starts and you can run the config app, look at the status of the dalalogs. if the current log is not current, you can delete it with the command

iotawatt.local/command?deletelog=current

The IoTaWatt will restart and a new currentlog will be created. The historylog should be OK and will allow you to view your historical data locally.

There is a chance that your SDcard is corrupted and problems may resurface. If this doesn’t work, you may need to format a new SDcard. That’s pretty easy, and you may be able to preserve your history. I’ll give you instructions for that if it is needed.

Thanks a lot,
as you guessed, I cannot run the configuration app. The led is dull green and I assume the system is logging locally as you wrote. I’ll try to fix it as you suggested later today.
I am wondering what may have been the cause of the problem. The event to which it is associated with a power failure and my best guess is that the system was in the process of upgrading OTA. Could it be the case?
I am planning to install 100 of this devices for a research project and I need to minimize the need for assistance from the participants.

The message log (IoTaWatt/iotamsgs.txt) could answer some of these questions. You can copy it while the SD is in the computer. As far as OTA being the cause, I doubt it. The update calls was not changed in the time period you mention, and the process does SHA256 and MD5 hashes to check the integrity of file transfer, SD file creation, and firmware install. Power failure during OTA should not be cause this type of problem.

It’s not clear that the problem is not just a WiFi issue. Have you power cycled the IoTaWatt? And maybe the router? If the router is brought down, does the IoTaWatt led turn to red? Does it go green again when the router is back up? Getting it working again is one thing, and figuring out what happened is another. It will take longer, but if that’s what’s important, I’m game.

So, I finally fixed the thing.
First I replaced the .htm and .js in the SD card with the current version on github, the result was that the interface was again available, it was possible to connect to the router, but it seemed that there was no info on the emoncms settings.
I forced a restart through the app interface and the emoncms interface was again on, with all the correct settings, but the iotawatt wasn’t sending anything to emoncms.
I finally erased all the settings of emoncms and reentered again (with the same values), and it worked. It’s up again, thanks a lot for your help.