
The new value of firmware version passes through Attributes Updated link in the rule chain as server attribute lastTargetFwVer. After the user save the new OTA configuration in the widget.The new value of firmware version is sent by ESP32 after restarting (as client attribute currentFwVer) and pass through Post attributes link in the rule chain. After flashing ESP32 by a new firmware through OTA.Such rule configuration allows to compare received firmware version after it was updated in the next cases: From Save Attributes with link type Success.From Message Type Switch with link type Attributes Updated.To the added node should be connected two links: Open Root Rule Chain, drag and drop from nodes list rule chain node and select Check is ESP32 firmware synced from dropdown list.

Add the imported rule chain Check is ESP32 firmware synced to Root Rule Chain.Save ‘fwStateIsSynced’ attribute - saves the updated attribute fwStateIsSynced.

#DOWNLOAD FETCH OTA UPDATE#
Update server attribute ‘fwStateIsSynced’ - compares for the equality attributes currentFwVer and lastTargetFwVer and assign the comparison result to fwStateIsSynced attribute.Add attributes to metadata - adds client attribute currentFwVer and server attribute lastTargetFwVer to metadata.The attribute type is boolean and it will be used to show on the dashboard is firmware synced or not.ĭownload, import Check is ESP32 firmware synced rule chain into ThingsBoard and save it: The specified device type will be used later in the rule chains and in the dashboard.Īdd the new rule chain that will update the device’s server attribute fwStateIsSynced.
#DOWNLOAD FETCH OTA HOW TO#
We need to say that this sample works well with both CE and PE, but we use PE cloud since it has more features and in the next sample we will show how to do mass firmware updates for multiple devices simultaneously.Ĭreate a new device, name it as ESP32 and set it’s type as ESP32_OTA. You can use your own instance or ThingsBoard Cloud

Refer to ESP-IDF Get Started document to set up the software environment.īefore continuing, please make sure that you can successfully build and flash some example from ESP-IDF, for instance Hello World.įor the sample ESP-IDF version v3.3-beta1-328-gabea9e4c0 was used.
