I have an ESP 32 which receives an ESP Now message from an ESP 8266 and sends the data up the mesh to the root. If the node that happens to receive the message is not root, it fails when calling esp_mesh_send. I have done a lot of debugging to try and find out the issue and have some weird results.
1. The error I receive seems to depend on the tos parameter I set as follows
MESH_TOS_P2P; I get ESP_ERR_MESH_TIMEOUT
MESH_TOS_DEF; I get ESP_ERR_MESH_ARGUMENT
MESH_TOS_E2E; I get ESP_ERR_NOT_SUPPORT
2. Sending the message using the same code outside the espnow receive call back seems to work fine.
The mesh_data_t looks like this
Code: Select all
mesh_data_t dataToRoot = {0};
dataToRoot.data = (void*) &homeiotSendMessage;
dataToRoot.size = sizeof(homeiotSendMessage);
dataToRoot.proto = MESH_PROTO_BIN;
// dataToRoot.tos = MESH_TOS_P2P; // ESP_ERR_MESH_TIMEOUT
dataToRoot.tos = MESH_TOS_DEF; // ESP_ERR_MESH_ARGUMENT
// dataToRoot.tos = MESH_TOS_E2E; // ESP_ERR_NOT_SUPPORT
Code: Select all
err = esp_mesh_send(dest_addr, data, nFlag, NULL, 0);
thanks
Lee.