esp-mesh-lite icon indicating copy to clipboard operation
esp-mesh-lite copied to clipboard

Raw Data Transfer between nodes and API methods? (AEGHB-979)

Open mjgci opened this issue 10 months ago • 4 comments

Checklist

  • [x] Checked the issue tracker for similar issues to ensure this is not a duplicate.
  • [x] Provided a clear description of your suggestion.
  • [x] Included any relevant context or examples.

Issue or Suggestion Description

Reference: Mesh Local Control Example

I am looking to transfer large amount of data between the root node and the child nodes.

Using ESP-NOW api such as esp_mesh_lite_espnow_send(), the data size gets limited to ~250B which is insufficient for large data transfers in one transaction. It can address my requirements to communicate with a specific node(using MAC address as a reference) however, I will need to send the chunks of data if the length is >250B in my application code. This will in turn will affect the speed of the data transfers.

The OTA mechanism to transmit a file as an example in esp_mesh_lite_core.h using esp_mesh_lite_transmit_file_start() depends on the URL and is not useful in my case. Any suggestions on how to overcome this will be helpful?

mjgci avatar Feb 07 '25 10:02 mjgci

The function esp_mesh_lite_transmit_file_start can fulfill the requirement of transmitting long data between nodes. By registering the relevant callback through esp_mesh_lite_ota_register_file_transfer_cb, child nodes can invoke esp_mesh_lite_transmit_file_start to request the corresponding file with the specified file_name from their parent node.

For further details, please refer to: https://github.com/espressif/esp-mesh-lite/blob/master/components/mesh_lite/include/esp_mesh_lite_core.h#L845-L902

tswen avatar Feb 17 '25 08:02 tswen

@tswen Thank you for your response and suggestions. The File Transfer mechanism using the APIs could have been useful however, there will be extra steps to modify OTA elements in the library as per my requirement. Understanding the library is taking time and I will keep testing if the suggestions help.

The ESP-NOW API is quite helpful. The only caveat to this is the size of bytes transferred in one transaction. Following this helped : https://github.com/espressif/esp-mesh-lite/blob/master/components/mesh_lite/User_Guide.md#espnow-usage-guide

mjgci avatar Feb 18 '25 15:02 mjgci

The ESP-NOW API is quite helpful. The only caveat to this is the size of bytes transferred in one transaction.

ESPNOW has been updated from ESP-IDF V5.4 to Ver2.0.

I (11684) ESPNOW: espnow [version: 2.0] init
I (11684) ESPNOW: Start

In ESPNOW Ver2.0, the maximum payload size has changed from 250 bytes to 1,470 bytes, but I don't know if MESH-LITE supports this.

See this.

https://github.com/espressif/esp-idf/commit/19ecb580d4a13267345c52afde4f9a9cc40f48cb

nopnop2002 avatar Apr 11 '25 14:04 nopnop2002

@nopnop2002 The latest ​master branch of ​Mesh-Lite now supports this feature. 29185cc323d199e609d1ff75fe21e5dab95c4e34

tswen avatar Apr 15 '25 02:04 tswen