I am using ESP32 and implementing BLE mesh network and example code i.e. BLE mesh sensor Client and Sensor Server.
To do so 3 ESP32 devices are configured as sensor server and each sensor server is consists of 4 elements. I could able to provision all the devices using nRF mobile application and could able to get all the data from all three servers for respective element we get GET command is sent from nRF application.
Now I have configured one ESP32 with sensor Client with provisioner enabled on client. Sensor client is also configured with elements, and server as sensor server with 4 elements.
With this setup Sensor Client is provisioning the the server device successfully. After this when is start to send get command by button press, i could able to get data only from 1st element of sensor server, rest all GET command are working like Get descriptor, Get sensor Setting.
Its seems that key getting bound to only 1st element of server, not getting bound to rest 3 elements.
Following are code snippets
1. Sensor Server Element Definition:-
Code: Select all
static esp_ble_mesh_elem_t elements[] = {
ESP_BLE_MESH_ELEMENT(0, root_models, ESP_BLE_MESH_MODEL_NONE),
ESP_BLE_MESH_ELEMENT(0, extend_model_2, ESP_BLE_MESH_MODEL_NONE),
ESP_BLE_MESH_ELEMENT(0, extend_model_3, ESP_BLE_MESH_MODEL_NONE),
ESP_BLE_MESH_ELEMENT(0, extend_model_4, ESP_BLE_MESH_MODEL_NONE),
};
Code: Select all
static esp_ble_mesh_client_t config_client;
static esp_ble_mesh_client_t sensor_client;
static esp_ble_mesh_client_t fault;
static esp_ble_mesh_client_t config;
static esp_ble_mesh_client_t trip_log;
static esp_ble_mesh_model_t root_models[] = {
ESP_BLE_MESH_MODEL_CFG_SRV(&config_server),
ESP_BLE_MESH_MODEL_CFG_CLI(&config_client),
ESP_BLE_MESH_MODEL_SENSOR_CLI(NULL, &sensor_client),
};
static esp_ble_mesh_model_t extend_model_1[] = {
ESP_BLE_MESH_MODEL_SENSOR_CLI(NULL, &fault),
};
static esp_ble_mesh_model_t extend_model_2[] = {
ESP_BLE_MESH_MODEL_SENSOR_CLI(NULL, &config),
};
static esp_ble_mesh_model_t extend_model_3[] = {
ESP_BLE_MESH_MODEL_SENSOR_CLI(NULL, &trip_log),
};
static esp_ble_mesh_elem_t elements[] = {
ESP_BLE_MESH_ELEMENT(0, root_models, ESP_BLE_MESH_MODEL_NONE),
ESP_BLE_MESH_ELEMENT(0, extend_model_1, ESP_BLE_MESH_MODEL_NONE),
ESP_BLE_MESH_ELEMENT(0, extend_model_2, ESP_BLE_MESH_MODEL_NONE),
ESP_BLE_MESH_ELEMENT(0, extend_model_3, ESP_BLE_MESH_MODEL_NONE),
};
It would be helpful to know how to or what configuration needs to be done to make it working.
Once this is working would like to make GET command work with multiple server also.
Thanks,
RahulSS