The last main feature we will discuss in this guide is Fota (firmware over the air), used to update your device’s firmware remotely.
Important: In order to perform the FOTA of a device you need to create a Virtual machine with the “Fota Enable” feature.
To enable fota using your device you have to uplink the ‘fota.py’ firmware on your device, upload a firmware to the ZDM and then send the fota command to your device.
Let’s upload a firmware to the ZDM using the ZDM fota commands, for example one of the firmwares in ‘examples’ directory.
At first upload the new firmware to the ZDM using
Then link the firmware for the bytecode slot 0 and bytecode slot 1
Using your Virtual Machine UID using ztc command
Now use the zdm prepare command to upload your firmware in ZDM.
Each firmware belongs to a workspace, and it’s identified by the couple <workspaceId, version>.
then launch fota command:
You can check the firmware update using the command fota check on ZDM, or check the device’s console in Zerynth studio to see if the device downloaded the new firmware correctly.
If this operation succeeds, you will see that the device will restart and run the downloaded firmware.