.. Since this is the recommended setting and well supported by the
RainMaker SDK, to ensure that OTA upgrades do not break the device
and ensure that the MQTT connection works fine with the new firmware.
- Mark new app firmware as valid only if MQTT connection is successful.
- Report OTA success to RainMaker backend only after successful
connection after booting into new firmware.
- If the new firmware cannot connect to MQTT within specified time
(Default 90 seconds, configuratble), it will roll back into older
firmware. Even if the timer logic fails for some reason, a reboot
will also trigger the rollback.
It was already the default for esp32s2. So, only esp32 will have
assisted claiming as default. This change was made because RainMaker
now supports admin roles even for Self Claimed nodes. Please check
CHANGES.md for details
- OTA using topics is now enabled in all examples
- esp_rmaker_ota_enable_default() is the simplified API that enables
OTA using Topics with the default server certificates
Instead of using 1 or 2 certificates for server authentication, use a
bundle of commonly used server certificates, so that even if the server
moves to a different signing authority, the device connection is not
affected.
This change has been done for claiming, OTA and MQTT certificates.
Earlier example used a local certificate just for demo purposes.
However, since the RainMaker OTA server is the default server anyways,
it's better to use that same default certificate.
Earlier, a reset and reboot were required if wrong Wi-Fi credentials
were given during provisioning. With this change, based on some
configured number of reconnection attempts, the firmware will go back into
provisioning mode.
- Provide an option of provisioning without PoP pin (use with caution).
- Config option for provisioning timeout (set to 30 min by default).
Useful especially when there is no PoP, and so you want to keep the device
in provisioning mode only for a few minutes after boot up.
- Expose some internal APIs
- External OTA callbacks can now call the internal function to manage OTA
- Applications can explicitly send the OTA fetch publish message to check
if OTA is available in case of OTA using Topics
- Handle network connectivity loss using keep-alive
- Send "rejected" as OTA status for project/version mismatch, instead of
"failed".
Node info:
- project_name: The name of the project as configured in CMakeLists.txt.
"model" was earlier being used for this and will continue to be used
for backward compatibility, but now it would be ok to override model
using the esp_rmaker_node_add_model() API.
- platformm: Read from CONFIG_IDF_TARGET, tells the platform being used
(esp32, esp32s2, esp32c3,....)
Device
- model (optional)
Even when an explicit user reset was triggered by the firmware,
the RMAKER_EVENT_USER_NODE_MAPPING_DONE event was getting generated,
which was misleading and causing issues while integrating other
frameworks. A new event RMAKER_EVENT_USER_NODE_MAPPING_RESET has
been added to distinguish this event.
The esp_rmaker_user_node_mapping_get_state() has also been exposed
for applications to use. Note that the CONFIG_ESP_RMAKER_USER_ID_CHECK
config option should be enabled to get correct state.