ble mesh provisioner sample

jiangch6
Posts: 5
Joined: Tue Nov 12, 2019 10:28 am

ble mesh provisioner sample

Postby jiangch6 » Mon Nov 18, 2019 3:52 am

Hi,

I'm developing a ble mesh gateway using esp32, based on example ble_mesh_provisioner.I can now
provision a ble mesh light, bought from market, and control its onoff. After that, I have some problems:

1, How to communite with node again after the provisioner is rebooted? I tried to save theprovisioned
node information, including dev uuid and unicast, to flash, and then poweroff, then power on again. But
when I use the unicast to send onoff message, it failed. What other steps Ineed to do after rebooting?

2. How to control the level? I have followded everything on onoff_client to add a level_client,but it
failed to send level message to the light with return code ESP_ERR_INVALID_ARG. there is the code snip:

Code: Select all

static esp_ble_mesh_client_t level_client;
..............................
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_GEN_ONOFF_CLI(NULL, &onoff_client),
    ESP_BLE_MESH_MODEL_GEN_LEVEL_CLI(NULL, &level_client),
};
..............................
            set_state.model_app_bind.element_addr = node->unicast;
            set_state.model_app_bind.model_app_idx = prov_key.app_idx;
            set_state.model_app_bind.model_id = BLE_MESH_MODEL_ID_GEN_LEVEL_SRV;
            set_state.model_app_bind.company_id = CID_NVAL;
            err = esp_ble_mesh_config_client_set_state(&common, &set_state);
..............................
        err = esp_ble_mesh_set_msg_common(&common, node, level_client.model, ESP_BLE_MESH_MODEL_OP_GEN_LEVEL_SET);
        set_state.level_set.op_en = false;
        set_state.level_set.level = atoi(argv[2]);
        set_state.level_set.tid = (g_tid += 1);
        err = esp_ble_mesh_generic_client_set_state(&common, &set_state);
        if (err) {
            ESP_LOGE(TAG, "%s: Generic Level Set failed: %d", __func__, err);
            return;
        }
Could you provide a sample about the two questions?

BRs,

jiangch6
Posts: 5
Joined: Tue Nov 12, 2019 10:28 am

Re: ble mesh provisioner sample

Postby jiangch6 » Mon Nov 18, 2019 9:25 am

The 2nd problem is fixed now, by setting project config menu: CONFIG_BLE_MESH_GENERIC_LEVEL_CLI=y

For the 1st problem, I find a config item: CONFIG_BLE_MESH_SETTING, but it says that it currently only
supports storing BLE Mesh node configuration. Any plan for provisioner configuration?

BRs,

Wangcheng
Posts: 61
Joined: Wed Mar 06, 2019 3:26 am

Re: ble mesh provisioner sample

Postby Wangcheng » Mon Nov 25, 2019 12:38 pm

jiangch6 wrote:
Mon Nov 18, 2019 9:25 am
The 2nd problem is fixed now, by setting project config menu: CONFIG_BLE_MESH_GENERIC_LEVEL_CLI=y

For the 1st problem, I find a config item: CONFIG_BLE_MESH_SETTING, but it says that it currently only
supports storing BLE Mesh node configuration. Any plan for provisioner configuration?

BRs,
Hi ,
1. The provisioner configuration store has been developed and will be available soon.
2. What kind of lamp do you buy? Can you provide a link? We need to test the compatibility.

Who is online

Users browsing this forum: Baidu [Spider], Google [Bot] and 18 guests