Bluetooth Mesh Light CTL (color tuned light) sample

Is there a sample app that uses the Zephyr Light CTL Bluetooth Mesh model?  I've tried to add that model to the light_ctrl sample app, but get a crash during configuration so I must be doing something wrong. 

The onoff_level_lighting_vnd app claims to support that model but it doesn't seem to be using the Zephyr lighting models. 

Thanks

  • I see.

    Could you try debugging and figure out where it fails, and exactly what is returning  bt_mesh_adv_ext: Advertising failed: err -12?

    Regards,

    Elfving

  • Call stack when the error occurs:

    [The error occurs due to a message received at this level.  The debugger didn't help me trace it further] 

    bt_hci_cmd_send_sync(uint16_t opcode, struct net_buf * buf, struct net_buf ** rsp) (/home/user/ncs/v2.8.0/zephyr/subsys/bluetooth/host/hci_core.c:440)
    bt_le_adv_set_enable_ext(struct bt_le_ext_adv * adv, _Bool enable, const struct bt_le_ext_adv_start_param * param) (/home/user/ncs/v2.8.0/zephyr/subsys/bluetooth/host/adv.c:371)
    [this is where the error is printed]
    bt_le_ext_adv_start(struct bt_le_ext_adv * adv, const struct bt_le_ext_adv_start_param * param) (/home/user/ncs/v2.8.0/zephyr/subsys/bluetooth/host/adv.c:1656)
    adv_start(struct bt_mesh_ext_adv * ext_adv, const struct bt_le_adv_param * param, struct bt_le_ext_adv_start_param * start, const struct bt_data * ad, size_t ad_len, const struct bt_data * sd, size_t sd_len) (/home/user/ncs/v2.8.0/zephyr/subsys/bluetooth/mesh/adv_ext.c:203)
    bt_mesh_adv_gatt_start(const struct bt_le_adv_param * param, int32_t duration, const struct bt_data * ad, size_t ad_len, const struct bt_data * sd, size_t sd_len) (/home/user/ncs/v2.8.0/zephyr/subsys/bluetooth/mesh/adv_ext.c:603)
    bt_mesh_pb_gatt_srv_adv_start() (/home/user/ncs/v2.8.0/zephyr/subsys/bluetooth/mesh/pb_gatt_srv.c:308)
    bt_mesh_adv_gatt_send() (/home/user/ncs/v2.8.0/zephyr/subsys/bluetooth/mesh/adv.c:301)
    send_pending_adv(struct k_work * work) (/home/user/ncs/v2.8.0/zephyr/subsys/bluetooth/mesh/adv_ext.c:359)
    work_queue_main(void * workq_ptr, void * p2, void * p3) (/home/user/ncs/v2.8.0/zephyr/kernel/work.c:688)
    z_thread_entry(k_thread_entry_t entry, void * p1, void * p2, void * p3) (/home/user/ncs/v2.8.0/zephyr/lib/os/thread_entry.c:48)
    z_thread_entry(k_thread_entry_t entry, void * p1, void * p2, void * p3) (/home/user/ncs/v2.8.0/zephyr/lib/os/thread_entry.c:48)
    [Unknown code] (Unknown Source:0)



    The error seems to arise here:
    In bt_hci_cmd_send_sync()
    (/home/user/ncs/v2.8.0/zephyr/subsys/bluetooth/host/hci_core.c:440)

    ...

    case BT_HCI_ERR_INSUFFICIENT_RESOURCES:
    return -ENOMEM; (-12)

    When there a command
    This error code gets returned back up the chain to:

    In bt_le_ext_adv_start()
    (/home/user/ncs/v2.8.0/zephyr/subsys/bluetooth/host/adv.c:1657)
    The error is printed:
    ...
    err = bt_le_adv_set_enable_ext(adv, true, param);
    if (err) {
    LOG_ERR("Failed to start advertiser");
    if (IS_ENABLED(CONFIG_BT_PERIPHERAL) && conn) {
    bt_conn_set_state(conn, BT_CONN_DISCONNECTED);
    bt_conn_unref(conn);
    }

    return err;
    }

    I guess it's something down in the Bluetooth controller.

    I tried to turn on some logging and am getting

    [00:08:20.424,499] <wrn> bt_hci_core: opcode 0x2039 status 0x0d
    [00:08:20.424,560] <err> bt_adv: Failed to start advertiser
    [00:08:20.424,591] <err> bt_mesh_adv_ext: Advertising failed: err -12

    I think status 0x0d is BT_HCI_ERR_INSUFFICIENT_RESOURCES above, so that's at least consistent.
  • Could you send me the .config file you get generated for the build?

    Regards,

    Elfving

  • By the way, I previously said the error wasn't catastrophic, however, today when I try the issue again, it does sometimes crash after several seconds.

    There was one .config in project\build\zephyr and one in project\build\project\, both are included.

    .config light_ctrl_sample-build-light_ctrl_sample-zephyr.zip

Related