Open francescogenovasi opened 2 years ago
Hi @francescogenovasi
There is something wrong in your SERVER's code.
You can have a try with modifying the code
model_ibeacon_data_t ibeacon_resp = *(model_ibeacon_data_t *) param->model_operation.model->user_data;
to model_ibeacon_data_t ibeacon_resp = *(model_ibeacon_data_t *) param->model_operation.msg;
.
Hope it can help you.
I am confused about SERVER's code, after the SERVER get data from BEACON, it call esp_ble_mesh_server_model_send_msg() to the Provisioner, the second argument ctx seems to be wrong?
ctx.addr is the beacon's address, isn't it? so the msg will send back to the BEACON instead of the Provisioner?
hi, @jiabuda , the beacon's msg's dst address seems like a group address. Dose the server subscribe that group address? provisioner maybe subscribed that group address so that it can receive successfully.
unfortunately @JiaLWang your solution doesn't work. I tried it in SERVER's code in ESP_BLE_MESH_IBEACON_MODEL_OP_GET: case and in ESP_BLE_MESH_IBEACON_MODEL_OP_BEACON: case and then the esp32 is rebooting itself unexpectedly (I think that it founds some errors) thanks anyway
@jiabuda ctx.addr is the group address in which there are the BEACON, the PROVIONER and the SERVER
@forx157
yes, in SERVER's code (after provisioning) there is the following line
esp_ble_mesh_model_subscribe_group_addr(esp_ble_mesh_get_primary_element_address(), CID_ESP,ESP_BLE_MESH_IBEACON_MODEL_ID_SERVER,ESP_BLE_MESH_GROUP_PUB_ADDR );
(obviously the ESP_BLE_MESH_GROUP_PUB_ADDR is the same)
Hi, @francescogenovasi Dose the problem solved? if not, could you provide us with some log files(beacon, server, proversioner)?
Answers checklist.
IDF version.
ESP-IDF v5.0-dev-4257-g508661b03e
Operating System used.
macOS
How did you build your project?
CLion IDE
If you are using Windows, please specify command line type.
No response
What is the expected behavior?
In my project there are:
### I want to send my model from SERVER to PROVISONER and from BEACON to SERVER
My model is:
The function
sends data from the SERVER to the PROVISONER. The data are captured in the PROVISONER with
The function
sends data from BEACON to the SERVER. The data are captured in the SERVER with
What is the actual behavior?
the communication between SERVER and PROVISONER works but the communication between BEACON and SERVER doesn't works. If I want to print the received data on the SERVER it prints zeros in all of the model's fields
Steps to reproduce.
The BEACON's code is:
The SERVER's code is:
The PROVISONER's code is:
Build or installation Logs.
No response
More Information.
I tried to do the following tests:
err = esp_ble_mesh_client_model_send_msg(ibeacon_model_client.model, &ctx, opcode, 0, NULL, 0, false, ROLE_NODE);
->err = esp_ble_mesh_client_model_send_msg(ibeacon_resp1, &ctx, opcode, 0, NULL, 0, false, ROLE_NODE);
->err = esp_ble_mesh_model_publish(ibeacon_model_client.model, opcode, 0, NULL, ROLE_NODE);
->err = esp_ble_mesh_client_model_send_msg(ibeacon_model_client.model, &ctx, opcode, sizeof(ibeacon_resp123), (uint8_t *) &ibeacon_resp123, 0, false, ROLE_NODE);
->err = esp_ble_mesh_client_model_send_msg(ibeacon_model_client.model, &ctx, opcode, sizeof(ibeacon_model_client.model), (uint8_t *) &ibeacon_resp123, 0, false, ROLE_NODE);
But I found the same results