All workbench notes

Project update

FieldHub — First Updates Over the Mobile Network

A FieldHub can now update itself over the mobile network. On the bench, signed releases arrived, a wrong signature and an older release were refused, an interrupted download carried on where it stopped, and a version that couldn't reach the server was undone.

The hub's update machinery, with signed releases, checked downloads and rollback, was proven on the bench in July. But no update had ever reached a hub over the mobile network, and in October publishing a release failed when a proxy in front of the backend cut off the request that carried the image. This week I got it working end to end.

Releases are now published from my computer as a plain file through a one-time link. The server checks the signature and the size before it lists the release. Seven releases, v1.0.0 to v1.0.6, went through that path, and each was downloaded back and checked byte for byte. On the dashboard, a hub's Firmware card shows its version, a one-line note on what is new and the result of the last update, and a build that was never published shows as a dev build.

On the bench hub, over the mobile network, an update installs after the readings have been uploaded, and in the hub's normal wake: 756 readings went up first, and a download that runs into the wake's time limit stops, so the hub still powers down by 274 s. A release with a wrong signature was refused after the manifest alone, and an older release was refused too. I cut the hub's power about 950 KB into a download; the next wake continued from 524,288 bytes, fetched the rest in two requests and checked the whole image before it started. A whole image of about 1.4 MB took about 150 s over three requests.

The part I care most about is what happens when a new version is wrong. A hub that reports to FieldMesh keeps a new version only after its first wake has run the card, the radio and the upload and reached the server. With the SIM taken out, the hub went back to the old version at its next wake and reported the update as undone. A restart during the trial was undone the same way, and a version undone three times is given up on.

Two things are not tested yet. The low-battery guard, which holds an update below 3.5 V, needs a bench supply I don't have. And nodes: updating them through the hub is designed and in progress.