esp_ble_mesh health model

smart123
Posts: 22
Joined: Mon Apr 27, 2020 12:01 pm

esp_ble_mesh health model

Postby smart123 » Mon May 11, 2020 6:49 am

1、请问provisioner 的demo中 添加 health_mode 有相关的文档或者demo吗 ?
2、为什么在程序中已经ESP_BLE_MESH_MODEL_HEALTH_CLI(&health_client) 后边还是会提示 health_client。model是空的呢?
Attachments
main.c
(41.44 KiB) Downloaded 17 times

esp_liu
Posts: 30
Joined: Wed Nov 28, 2018 4:12 am

Re: esp_ble_mesh health model

Postby esp_liu » Mon May 11, 2020 7:33 am

smart123 wrote:
Mon May 11, 2020 6:49 am
1、请问provisioner 的demo中 添加 health_mode 有相关的文档或者demo吗 ?
2、为什么在程序中已经ESP_BLE_MESH_MODEL_HEALTH_CLI(&health_client) 后边还是会提示 health_client。model是空的呢?
进入 menuconfig,在 Component config ->ESP BLE Mesh Support -> Support for BLE Mesh Client Models 中勾选上 Health Client Model

smart123
Posts: 22
Joined: Mon Apr 27, 2020 12:01 pm

Re: esp_ble_mesh health model

Postby smart123 » Mon May 11, 2020 8:03 am

esp_liu wrote:
Mon May 11, 2020 7:33 am
smart123 wrote:
Mon May 11, 2020 6:49 am
1、请问provisioner 的demo中 添加 health_mode 有相关的文档或者demo吗 ?
2、为什么在程序中已经ESP_BLE_MESH_MODEL_HEALTH_CLI(&health_client) 后边还是会提示 health_client。model是空的呢?
进入 menuconfig,在 Component config ->ESP BLE Mesh Support -> Support for BLE Mesh Client Models 中勾选上 Health Client Model
非常感谢 按照您的提示已经解决了 之前的发送失败的问题 。
1、目前发送
err = example_ble_mesh_set_msg_common(&common, addr, health_client.model, ESP_BLE_MESH_MODEL_OP_HEALTH_PERIOD_GET );
get_state.fault_get.company_id = CID_NVAL;
err = esp_ble_mesh_health_client_get_state(&common, &get_state);
可以不报错了 但是为什么server node 没有反应也没有触发 health_model的回调函数呢?
2、想利用心跳包的功能来监测node是否掉线 是要在 health_model 的基础上去操作吗?还是可以没有health_model的情况下也可以实现这个功能?
3、请问 用下边的函数配置节点的pub地址为什么无效呢?难道不是用这个opcode?
执行到这里时 provisioner提示 W (12898) BLE_MESH: No matching TX context for ack
server node提示 W (5292) BLE_MESH: Got segment for already complete SDU
esp_ble_mesh_cfg_client_set_state_t set_state = {0};
printf("addr %x\n",addr);
example_ble_mesh_set_msg_common(&common, addr, config_client.model, ESP_BLE_MESH_MODEL_OP_MODEL_PUB_SET);
set_state.model_pub_set.element_addr = addr+1;//node->unicast;
set_state.model_pub_set.publish_addr = addr+10;//node->unicast+1;
set_state.model_pub_set.publish_app_idx = prov_key.app_idx;
set_state.model_pub_set.cred_flag = true;
set_state.model_pub_set.publish_ttl = 7;
set_state.model_pub_set.publish_period = 1;
set_state.model_pub_set.publish_retransmit = 1;
set_state.model_pub_set.model_id = ESP_BLE_MESH_MODEL_ID_GEN_ONOFF_SRV;
set_state.model_pub_set.company_id = CID_NVAL;
err = esp_ble_mesh_config_client_set_state(&common, &set_state);
if (err) {
ESP_LOGE(TAG, "%s: config client Set failed", __func__);return;
}

Who is online

Users browsing this forum: Baidu [Spider] and 5 guests