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'm not sure what could be wrong, my suggestion is to take a look at the test sample at \nrf\tests\bluetooth\tester. What I can see in the project is the CTL server is initialized in the model_handler.c 

  • Hung, I've made progress using your suggestion.  I took the nrf/tests/bluetooth/tester project model_handler.c file and rused it to replace the light_ctrl example model_handler.  I then deleted several models and some tester-dependent code, and updated prj.conf and CMakeLists.txt.  The resulting code built, ran, and provisioned, but I don't yet know if it functions.  I'm trying to get a less Frankenstein version going now.


    Edit - Actually, I'm getting a different error now at the start of provisioning, but no crash.

    Thanks,
    Jack

    *** Booting Mesh Light Fixture v2.8.0-786004901682 ***
    *** Using nRF Connect SDK v2.8.0-a2386bfc8401 ***
    *** Using Zephyr OS v3.7.99-0bc3393fb112 ***
    Initializing...
    I: 8 Sectors of 4096 bytes
    I: alloc wra: 0, fe8
    I: data wra: 0, 0
    I: SoftDevice Controller build revision:
    I: fe 2c f9 6a 7f 36 22 2e |.,.j.6".
    I: a0 79 c0 40 be 2c 03 20 |.y.@.,.
    I: 40 c2 f3 32 |@..2
    I: HW Platform: Nordic Semiconductor (0x0002)
    I: HW Variant: nRF52x (0x0002)
    I: Firmware: Standard Bluetooth controller (0x00) Version 254.63788 Build 573996906
    I: No ID address. App must call settings_load()
    Bluetooth initialized
    W: Unused space in relation list: 54
    I: Identity: EC:2C:E8:3F:5C:0E (random)
    I: HCI: version 6.0 (0x0e) revision 0x104e, manufacturer 0x0059
    I: LMP: version 6.0 (0x0e) subver 0x104e
    I: Device UUID: 5c0b7b01-159d-4da6-a3f4-84feea62c259
    Mesh initialized
    W: opcode 0x2039 status 0x0d
    E: Failed to start advertiser
    E: Advertising failed: err -12

  • Hi Jack,

    Hung is away at the moment, so I'll be taking over the case in the meantime. 

    Great that you've gotten a bit further with this. If some frankenstein-type solution ended with things not crashing I assume there is a config, setting, or funtion call somewhere that is what is missing. Typically removing one feature at the time until you see where that addition is often works.

    Though now I see you have a new error, as you pointed out. -12 is ENOMEM, meaning there is a memory issue. Have a look at the suggestions in this old case. Do you have CONFIG_BT_MAX_CONN set too low, or is your advertising data too big?

    Regards,

    Elfving

  • Hi Elfving, 

    Thank you for your assistance.

    It seems like the CONFIG_BT_MAX_CONN was defaulted to 2.  I tried changing it to 5 with no improvement (still getting -12 error as soon as the device is selected, prior to the actual provisioning).  However, I then tried CONFIG_BT_MAX_CONN=1 and I no longer get an error.  Can you provide any insight? 

    I will move forward, but I'd like to know what the problem actually is.  Also, we may need more than one BT connection at a later stage of development.

    I looked at the old case and I wasn't sure how to apply the advice to my situation.  It was suggested that the advertising data was too long, but I'm not setting that in the user code as far as I know.

    There was also the comment "You can not have CONFIG_BT_MAX_CONN=1 when you call advertising_start() from the disconnected() handler. That is why it is 2 by default.", however MAX_CONN=2 (or 5) does not work for me.

    Best,

    Jack

    Current error - occurs when the device is selected from the scan page:

    ...

    I: Firmware: Standard Bluetooth controller (0x00) Version 254.63788 Build 573996906
    I: No ID address. App must call settings_load()
    Bluetooth initialized
    W: Unused space in relation list: 14
    I: Identity: EC:2C:E8:3F:5C:0E (random)
    I: HCI: version 6.0 (0x0e) revision 0x104e, manufacturer 0x0059
    I: LMP: version 6.0 (0x0e) subver 0x104e
    I: Device UUID: 5c0b7b01-159d-4da6-a3f4-84feea62c259
    Mesh initialized
    W: opcode 0x2039 status 0x0d
    E: Failed to start advertiser
    E: Advertising failed: err -12

  • Could you make sure CONFIG_LOG_MODE_MINIMAL is not set, CONFIG_LOG_BACKEND_FORMAT_TIMESTAMP is set? Could you also try increasing CONFIG_BT_BUF_CMD_TX_COUNT?

    And could you send the entire log of this error, as well as the full config file used for the build?

    Regards,

    Elfving

Related