Open Kasuhikdas opened 5 years ago
Different types of devices need to be upgraded separately, and each time only the same type of device can be upgraded.
For example, there are two types of devices in the network: Type 1 (A, B), Type (C, D), you call mupgrade_firmware_send
, just pass in the address of (A, B), wait until A, B is upgraded and then give C, D upgrade
way to set one address is like below uint8_t dest_mac_addr[] = {0x30,0xae,0xa4,0x04,0xc0,0xf4};
but there is provision of sending multiple addresses. mupgrade_firmware_send(const uint8_t dest_addrs, size_t dest_addrs_num, mupgrade_result_t result)
how to send multiple addresses?
uint8_t dest_mac_addr[] = {0x30,0xae,0xa4,0x04,0xc0,0xf4, 0x30,0xae,0xa4,0x04,0xc0,0xf3, 0x30,0xae,0xa4,0x04,0xc0,0xf2}; mupgrade_firmware_send(dest_mac_addr, sizeof(dest_mac_addr) / 6, NULL);
thanks,that worked. What about firmware version? I dont want to push same firmware version like the ota example in esp-idf. But mupgrade same firmware is getting updated. Any solution for that?
Mupgrade does not verify the firmware version of the device You need to add a version identifier at the application layer and compare it with the server version before the upgrade.
I understand that. But i have different fimwares. So,if root is different type of device then can not check roots firmware version for the upgrade and if we do the checking in node and stopes the update in node then upgrade process in root will keep sending packets and fail eventually.
Mupgrade temporarily does not support the child node to actively stop the upgrade, I will add this function as soon as possible, currently using the following two ways:
You can enable firmware type checking by make menuconfig
. You can add type identifiers to different types of device firmware. After the upgrade is completed, this flag will be checked. Only the identifier will be used for version switching.
You can also determine the firmware name (ie version) when you receive the MDF_EVENT_MUPGRADE_STARTED event, if the firmware of the device is not called mupgrade_stop()
In case root is not the device I want to upgrade then the ota is not sent to other nodes. Root type ABC Node type CDE Update for CDE is not getting sent.
How do I find the version of incoming ota binary. I have device configuration in sdkconfig??
@zhanzhaocheng
As per my understanding, to allow selective upgrade of a particular device node recommended by you in the post below, device type check should be done in the node device. Currently, the "device type" check is made in the root node as soon as the binary is downloaded from the cloud. This causes the upgrade task to terminate with error code "MDF_ERR_MUPGRADE_FIRMWARE_INVALID"
in case the root is not of the set device type.
What is your recommendation on this proposed implementation? https://github.com/espressif/esp-mdf/issues/60#issuecomment-506695476
@Kasuhikdas @rkashi
The current version is root will check CONFIG_MUPGRADE_FIRMWARE_FLAG, you can delete the root check, we will modify it in the next version. This feature is to prevent the firmware generated by this project from being upgraded to the device. For example, hello_world.bin
It is recommended to use the ota name to distinguish between device type and version checking. For example, the name can include the version number and device type. Determined in MDF_EVENT_MUPGRADE_STARTED if mupgrade_stop() is called for non-self version
@zhanzhaocheng I have network with more than 2 layers, meaning root -> Layer_1 nodes -> Layer_2 nodes. How does mupgrade handle this situation?
I have multiple esp-32 in mesh network. There are different types of firmware across the devices. In mupgrade it updated all the devices with same firmware as written in document. Is there any way to update few devices in mesh with a particular ota and others with different ota??