OTA over MQTT
This example demonstrates how you can create an application that updates its firmware Over The Air (OTA) using the MQTT protocol. This application uses OTA Firmware Upgrade via MQTT and follows the recommended versioning principles.
ENABLE_OTA_ADVANCED the firmware data can be either without any encoding or be signed and encrypted.
There are two tools that facilitate the packiging and deployment of a new firmware.
For more information read
Firmware packaging in the documentation of the OTA Firmware Upgrade via MQTT component.
ENABLE_SSL a standard SSL/TLS can be enabled:
The communication between the application and the server will be encrypted using standard SSL.
To prove that the server is the correct one: The MQTT clients should pin the public key fingerprint on the server. OR have a list of public key fingerprints that are allowed.
ENABLE_CLIENT_CERTIFICATEthe application can send a client certificate that is signed by the server.
ENABLE_SSL is enabled (highly recommended), OTA upgrade files will be transferred securely over TLS/SSL.
This variable contains the unique application name.
Default: not set
Contains the application major and minor versions separated by comma. Example “4.2”. If not set will use the current major and minor version from Sming.
Default: not set
Contains the application patch version as integer. For stable versions you can use 0 until 255. For unstable versions the current timestamp can be used as a patch version.
Default: 0 (disabled)
Used in combination with
ENABLE_SSL. Set to 1 if the remote server requires the application to authenticate via client certificate.
Default: depends on
Url containing the location of the firmware update MQTT server.