Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OTA LAN in inverted direction? (AEGHB-796) #122

Open
Magnatto opened this issue Aug 29, 2024 · 6 comments
Open

OTA LAN in inverted direction? (AEGHB-796) #122

Magnatto opened this issue Aug 29, 2024 · 6 comments

Comments

@Magnatto
Copy link

Let's say I have 50 devices on a single mesh-lite and I want to do a LAN OTA update and only have the local network (so no external update).
If i replace the root device with an updated version it will update all others eventually through esp_mesh_lite_transmit_file_start, that's great.
But what if it's impossible or very incovenient to replace or know who is the root. Is there a way for me to replace ANY device with the updated version, so it may update the entire network, so the OTA LAN is trasmitted both ways, not just father to children?

@github-actions github-actions bot changed the title OTA LAN in inverted direction? OTA LAN in inverted direction? (AEGHB-796) Aug 29, 2024
@tswen
Copy link
Contributor

tswen commented Sep 5, 2024

@Magnatto
Copy link
Author

Magnatto commented Sep 5, 2024

https://github.com/tswen/esp-mesh-lite/blob/docs/mesh_lite_LAN_OTA/components/mesh_lite/User_Guide_CN.md#esp-mesh-lite-lan-ota

image

Thanks for the reply, I understand this logic, which relies on an external URL and ALWAYS from root to children.

What I'm asking is if it's possible to NOT to rely on an external URL (replacing one of the devices in the network with an upgraded version), and for the OTA to spread from ANY device (not just from root to children).

This way I don't need an outside network connection (for client safety reasons), but can still update all devices from any given device in the network (since the root is not easily found among many devices and strict information requirements)

@tswen
Copy link
Contributor

tswen commented Sep 11, 2024

The external URL is just a fallback OTA method used when fetching firmware from the parent node fails. If you do not wish to upgrade via an external URL, you can set extern_url_ota_cb to NULL.

For LAN OTA, each node can only retrieve firmware from its parent node. If your root node has stored the binary file required by the child nodes in a specific partition, you can use esp_mesh_lite_ota_register_file_transfer_cb to provide the binary file to the child nodes. For a simple usage example, please refer to: https://github.com/espressif/esp-mesh-lite/blob/master/components/mesh_lite/include/esp_mesh_lite_core.h#L828-L885

@Magnatto
Copy link
Author

Magnatto commented Sep 18, 2024

Thank you, I understand that what I want (LAN OTA from child to parent, instead of parent to child) is not currently possible.
@tswen would it be possible then to add it in the plan for a future feature?
In a network of 50 devices it would be amazing to start and finish the LAN upgrade in the entire network from any device, not just the root.

@tswen
Copy link
Contributor

tswen commented Sep 20, 2024

If a child node obtains a firmware and wants to upgrade all devices directly through LAN OTA, the best way is to transfer the firmware to the root node first, and then upgrade it layer by layer.

LAN OTA cannot meet the requirement of upgrading all devices from any node.

@Magnatto
Copy link
Author

If a child node obtains a firmware and wants to upgrade all devices directly through LAN OTA, the best way is to transfer the firmware to the root node first, and then upgrade it layer by layer.

LAN OTA cannot meet the requirement of upgrading all devices from any node.

Understood, will try that, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants