ble mesh : issue provisioning a light bulb

ludodef
Posts: 2
Joined: Fri Jun 06, 2025 2:29 am

ble mesh : issue provisioning a light bulb

Postby ludodef » Fri Jun 06, 2025 3:11 am

Hello !

I'm new to the esp32 world, I have been going through some tutorials and I'm now trying to work on my actual project. My goal is to use an esp32 to control ble mesh light bulbs and expose them to HomeAssistant using MQTT. I have ble mesh Sengled bulbs and I couldn't find anything that already does what I want, so I'm doing it !

I'm using esp-idf 5.5.0 with VSCode
My board is a Freenove esp32 wroom, chip esp32-dowd-v3
The light bulb is Sengled B11-N1E, with a Telink chipset. I found that out by reverse engineering their android app and looking into the code.
I can perfectly connect to the bulb with the NRF mesh app, using the NO OOB method. After checking the app code I'm 98% sure it also uses NO OOB method. Through NRF Mesh app there also is the option for a static oob but I couldn't find anything relevant in the Sengled app to use.

I'm using the Provisioner example as a starting point : https://github.com/espressif/esp-idf/tr ... rovisioner

Before going to the logs I have a few questions :

When I have errors like that this one below, where can I find what they mean?

Code: Select all

BLE_MESH: Error 0x03
Same questions for these codes

Code: Select all

W (7270) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x16
I (7270) EXAMPLE: PB-GATT link close, reason 0x16
W (7300) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x16 dev_find 1

Next, I have mentionned that the NO OOB option works because in the logs I can see EXAMPLE: oob info: 2, bearer: PB-ADV and BLE_MESH: OOB Type: 0x01 which make think that maybe it's trying something else than NO OOB. If that's the case, how can I force no oob ?

Before asking the question, I've tried to change options from the sample configuration, in the ESP BLE Mesh support section but nothing helped. From the example's recv_unprov_adv_pkt function, I changed add_dev.oob_info = oob_info; to add_dev.oob_info =0; hoping to force no oob instead the value "2" returned by the light

Thank you for reading me and hopefully giving me directions to progress.

Finally, here are the logs:
I (29) boot: ESP-IDF v5.5-dev-3510-gaaebc37467 2nd stage bootloader
I (29) boot: compile time Jun 5 2025 22:18:53
I (29) boot: Multicore bootloader
I (32) boot: chip revision: v3.1
I (35) boot.esp32: SPI Speed : 40MHz
I (39) boot.esp32: SPI Mode : DIO
I (42) boot.esp32: SPI Flash Size : 2MB
I (46) boot: Enabling RNG early entropy source...
I (50) boot: Partition Table:
I (53) boot: ## Label Usage Type ST Offset Length
I (59) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (66) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (72) boot: 2 factory factory app 00 00 00010000 00177000
I (79) boot: End of partition table
I (82) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=2bbb0h (179120) map
I (151) esp_image: segment 1: paddr=0003bbd8 vaddr=3ff80000 size=0001ch ( 28) load
I (151) esp_image: segment 2: paddr=0003bbfc vaddr=3ffbdb60 size=0441ch ( 17436) load
I (161) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=984f4h (623860) map
I (375) esp_image: segment 4: paddr=000d851c vaddr=3ffc1f7c size=00b38h ( 2872) load
I (377) esp_image: segment 5: paddr=000d905c vaddr=40080000 size=17f94h ( 98196) load
I (429) boot: Loaded app from partition at offset 0x10000
I (429) boot: Disabling RNG early entropy source...
I (440) cpu_start: Multicore app
I (448) cpu_start: Pro cpu start user code
I (448) cpu_start: cpu freq: 160000000 Hz
I (449) app_init: Application information:
I (449) app_init: Project name: provisioner
I (453) app_init: App version: 1
I (456) app_init: Compile time: Jun 5 2025 22:23:36
I (461) app_init: ELF file SHA256: 8b574ed11...
I (466) app_init: ESP-IDF: v5.5-dev-3510-gaaebc37467
I (471) efuse_init: Min chip rev: v0.0
I (475) efuse_init: Max chip rev: v3.99
I (479) efuse_init: Chip rev: v3.1
I (483) heap_init: Initializing. RAM available for dynamic allocation:
I (489) heap_init: At 3FFAFF10 len 000000F0 (0 KiB): DRAM
I (494) heap_init: At 3FFB6388 len 00001C78 (7 KiB): DRAM
I (499) heap_init: At 3FFB9A20 len 00004108 (16 KiB): DRAM
I (504) heap_init: At 3FFCAAD8 len 00015528 (85 KiB): DRAM
I (510) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (515) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (520) heap_init: At 40097F94 len 0000806C (32 KiB): IRAM
I (527) spi_flash: detected chip: generic
I (529) spi_flash: flash io: dio
W (532) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (545) coexist: coex firmware version: 777f317b1
I (550) main_task: Started on CPU0
I (560) main_task: Calling app_main()
I (560) EXAMPLE: Initializing...
I (570) BTDM_INIT: BT controller compile version [42e1f02]
I (570) BTDM_INIT: Bluetooth MAC: 88:13:bf:82:4a:9a
I (570) phy_init: phy_version 4860,6b7a6e5,Feb 6 2025,14:47:07
I (930) BLE_MESH(lib): Bluetooth Mesh v1.1 commit: [meshlib:80130ecdd8]
I (930) BLE_MESH: Relay not supported
I (930) BLE_MESH: GATT Proxy not supported
I (930) BLE_MESH: Friend not supported
I (1020) BLE_MESH: NetKeyIndex 0x000, NID 0x51
I (1020) BLE_MESH: NetKey 1ceb9e85900159fdc8e5af6f971fbe79
I (1020) BLE_MESH: Primary address 0x0001, element count 1
I (1030) EXAMPLE: ESP_BLE_MESH_PROVISIONER_PROV_ENABLE_COMP_EVT, err_code 0
I (1030) EXAMPLE: ESP_BLE_MESH_PROVISIONER_ADD_LOCAL_APP_KEY_COMP_EVT, err_code 0
I (1030) EXAMPLE: ESP_BLE_MESH_PROVISIONER_BIND_APP_KEY_TO_MODEL_COMP_EVT, err_code 0
I (1040) EXAMPLE: BLE Mesh Provisioner initialized
I (1050) main_task: Returned from app_main()
I (1350) EXAMPLE: ESP_BLE_MESH_PROVISIONER_RECV_UNPROV_ADV_PKT_EVT
I (1350) EXAMPLE: address: b0ce18a8ae87, address type: 0, adv type: 0
I (1350) EXAMPLE: device uuid: f4a2568b1e424af0a0b9398b0e5efe82
I (1360) EXAMPLE: oob info: 2, bearer: PB-GATT
I (1370) EXAMPLE: ESP_BLE_MESH_PROVISIONER_ADD_UNPROV_DEV_COMP_EVT, err_code 0
I (4780) EXAMPLE: PB-GATT link open
I (4830) BLE_MESH: Elements: 0x04
I (4830) BLE_MESH: Algorithms: 0x0001
I (4830) BLE_MESH: Public Key Type: 0x00
I (4830) BLE_MESH: OOB Type: 0x01
I (4840) BLE_MESH: Output OOB Size: 0x00
I (4840) BLE_MESH: Output OOB Action: 0x0000
I (4850) BLE_MESH: Input OOB Size: 0x00
I (4850) BLE_MESH: Input OOB Action: 0x0000
W (7260) BLE_MESH: Error 0x03
W (7270) BT_HCI: hci cmd send: disconnect: hdl 0x0, rsn:0x13
W (7270) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x16
I (7270) EXAMPLE: PB-GATT link close, reason 0x16
W (7300) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x16 dev_find 1
W (7400) BLE_MESH: Device in queue not support PB-ADV
I (7400) EXAMPLE: ESP_BLE_MESH_PROVISIONER_RECV_UNPROV_ADV_PKT_EVT
I (7400) EXAMPLE: address: b0ce18a8ae87, address type: 0, adv type: 3
I (7410) EXAMPLE: device uuid: f4a2568b1e424af0a0b9398b0e5efe82
I (7410) EXAMPLE: oob info: 2, bearer: PB-ADV
W (7420) BLE_MESH: Add device with only bearer updated
I (7430) EXAMPLE: PB-ADV link open
I (7430) EXAMPLE: ESP_BLE_MESH_PROVISIONER_ADD_UNPROV_DEV_COMP_EVT, err_code 0
I (7620) BLE_MESH: Link ACK is already received
I (7690) BLE_MESH: Elements: 0x04
I (7690) BLE_MESH: Algorithms: 0x0001
I (7690) BLE_MESH: Public Key Type: 0x00
I (7690) BLE_MESH: OOB Type: 0x01
I (7690) BLE_MESH: Output OOB Size: 0x00
I (7700) BLE_MESH: Output OOB Action: 0x0000
I (7700) BLE_MESH: Input OOB Size: 0x00
I (7710) BLE_MESH: Input OOB Action: 0x0000
I (7720) BLE_MESH: Resending ack
I (8630) BLE_MESH: Get Start while there are unreceived segments
I (8680) BLE_MESH: Ignore already received segment
I (8810) BLE_MESH: Resending ack
W (10720) BLE_MESH: Error 0x04
I (11580) EXAMPLE: PB-ADV link close, reason 0x02
I (15520) EXAMPLE: PB-GATT link open
I (15570) BLE_MESH: Elements: 0x04
I (15570) BLE_MESH: Algorithms: 0x0001
I (15570) BLE_MESH: Public Key Type: 0x00
I (15580) BLE_MESH: OOB Type: 0x01
I (15580) BLE_MESH: Output OOB Size: 0x00
I (15580) BLE_MESH: Output OOB Action: 0x0000
I (15590) BLE_MESH: Input OOB Size: 0x00
I (15590) BLE_MESH: Input OOB Action: 0x0000
W (18000) BLE_MESH: Error 0x03
W (18010) BT_HCI: hci cmd send: disconnect: hdl 0x0, rsn:0x13
W (18010) BT_APPL: gattc_conn_cb: if=3 st=0 id=3 rsn=0x16
I (18010) EXAMPLE: PB-GATT link close, reason 0x16
W (18210) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x16 dev_find 1

chegewara
Posts: 2505
Joined: Wed Jun 14, 2017 9:00 pm

Re: ble mesh : issue provisioning a light bulb

Postby chegewara » Tue Jun 10, 2025 9:55 am

Im not sure, but this may be relevant topic
https://github.com/espressif/esp-idf/is ... 2661881041

ludodef
Posts: 2
Joined: Fri Jun 06, 2025 2:29 am

Re: ble mesh : issue provisioning a light bulb

Postby ludodef » Wed Jun 11, 2025 4:30 am

Im not sure, but this may be relevant topic
https://github.com/espressif/esp-idf/is ... 2661881041
Hey,
thanks a lot that's definitely something similar. I've also found this bug report that is very much the same issue I have https://github.com/espressif/esp-idf/issues/14316

I've commented the code that enforce static OBB and made sure to force NO OOB and I could provision the light ! I've started to look at the code to see if this could be done properly but that's indeed not a simple task, I understand the coder why is not doing it :D

Who is online

Users browsing this forum: Bing [Bot], Semrush [Bot] and 11 guests