Formula to calculate app-hash

Guys,
Basically I would like to check if the app firmware has
been flashed properly. According to docs the app-hash
seems to be a good fit. However, the formula to calculate
the app-hash is nowhere to be found. Anybody can point
me to the right direction?

https://docs.particle.io/reference/api/#app-hash


/G

@gkujawsk, the system firmware does all this work for you and won’t flash a non-valid image. Any reason you want to double check?

1 Like

I wondered what’s the purpose of app-hash published by the cloud after the successful flashing.
One of my ideas was that it somehow relates to the binary and can be used for verification.

Documentation says that “this hash can help confirm a flash succeeded and your new app is running, and also help you track exactly which version of which app is running on your device.”

How can app-hash actually confirm that a flash succeeded and help track version/app?


/G

Ping @Dave

1 Like

AFAIK, the comfirmation is the fact that you get that app-hash event published. If the flash didn’t succeede, the event would not occure.

Heya!

The App hash is stored in the firmware metadata (you can read that using the BVR https://github.com/spark/binary-version-reader ).

The cloud saves the hash of the firmware running on your device, and publishes an event when that hash changes, signifying that your device is running a new version of firmware. This can be a helpful way to confirm that multiple devices of yours are running a particular version of firmware. It also can be used to ensure the firmware arrived intact on the device before being run.

You could imagine a flash succeeding, but the platform being incorrect for that device, so the device might reject the new firmware. In this case the app hash wouldn’t change, and you could see your device was running a version other than what you sent, etc.

I hope that helps!

Thanks,
David

1 Like