Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Mesh SDK integration issue: Mesh events not firing.

I've been trying to integrate the Mesh SDK 3.1.0 alongside the nRF5 SDK 15.2.0 on a custom board. I've integrated the light switch server example as part of the code (replacing the simple_hal with the bsp) and I'm having a touch of a problem here. The problem being that while the device shows up on the mobile mesh application properly when unprovisioned, it kind of finishes provisioning, but no event in mesh_evt_handler in mesh_provisionee.c ever fires. I added some custom logging to the mesh and this is what i get on being provisioned:

Successfully updated connection parameters
Successfully updated connection parameters
Provisionee: invite received!
Provisionee: sending capabilities
Provisionee: provisioning start message received!
Provisionee: public key message received!
Provisioning: provisioning confirmation received!
Provisionee: provisioner's random number received!
Provisionee: received provisioning data!
gatt_database_reset
bearer_handler_stop
bearer_handler_stop timeslot_trigger
BEACON TX FC:A9:E7:6F

It seems that the event is registered just fine, but after calling timeslot_trigger, the execution kind of stops. The PC at that point stays in the SoftDevice, but I assume that it's there because of sd_app_evt_wait. I'm using the app_timer implementation provided by the mesh SDK rather than the one in nRF5 SDK. I've fiddled around with some interrupt priorities (as per Mesh interrupt priority level documentation) and SOC Observers to no avail. I am hoping someone could point out to me what I have possibly overlooked because I'm not getting mesh events.

  • <t:          0>, project-mesh.c,  251, ----- BLE Mesh Light Switch Server Demo -----
    <t:      11397>, project-mesh.c,  226, Initializing and adding models
    <t:      11403>, project-mesh.c,  112, App OnOff Model Handle: 2
    <t:      11412>, project-mesh.c,  269, Init done
    <t:      11417>, project-mesh.c,  274, RTT input enable
    <t:      11423>, project-mesh.c,  276, RTT input enable done
    <t:      11428>, project-mesh.c,  289, Provisioning start
    <t:      17718>, fsm.c,  228, PB-GATT bearer: init
    <t:      17733>, prov_bearer_adv.c,  400, PB-ADV: context at 0x20005820 added to bearer
    <t:      17740>, fsm.c,  239, PB-GATT bearer: E: E_LISTEN_START
    <t:      17746>, fsm.c,  186, PB-GATT bearer: A: A_LISTEN_START
    <t:      17759>, fsm.c,  201, PB-GATT bearer: state S_IDLE -> S_LISTENING
    <t:      17765>, project-mesh.c,  291, Provisionee ready
    <t:      17771>, mesh_app_utils.c,   65, Device UUID (raw): 78051B9B42849D4F9A30DFF57063C266
    <t:      17778>, mesh_app_utils.c,   70, Device UUID : 9B1B0578-8442-4F9D-9A30-DFF57063C266
    <t:      18201>, project-mesh.c,  300, Stack started
    <t:     447050>, fsm.c,  239, PB-GATT bearer: E: E_CONNECTED
    <t:     447056>, fsm.c,  186, PB-GATT bearer: A: A_LINK_OPEN
    <t:     447061>, fsm.c,  201, PB-GATT bearer: state S_LISTENING -> S_CONNECTED
    <t:     469543>, ble_softdevice_support.c,  104, Successfully updated connection parameters
    <t:     580630>, fsm.c,  239, PB-GATT bearer: E: E_TX_READY
    <t:     580636>, fsm.c,  186, PB-GATT bearer: A: A_LINK_TIMER_START
    <t:     580642>, fsm.c,  201, PB-GATT bearer: state S_CONNECTED -> S_LINK_ACTIVE
    <t:     583826>, ble_softdevice_support.c,  104, Successfully updated connection parameters
    <t:     619212>, fsm.c,  239, PB-GATT bearer: E: E_PDU_RX
    <t:     619222>, fsm.c,  186, PB-GATT bearer: A: A_PDU_RX
    <t:     619228>, prov_provisionee.c,  317, Provisionee: invite received!
    <t:     619234>, project-mesh.c,  186, Dev ID start
    <t:     619239>, prov_provisionee.c,  110, Provisionee: sending capabilities
    <t:     619245>, fsm.c,  239, PB-GATT bearer: E: E_PDU_TX
    <t:     619250>, fsm.c,  186, PB-GATT bearer: A: A_PDU_TX
    <t:     635430>, fsm.c,  239, PB-GATT bearer: E: E_TX_COMPLETE
    <t:     635439>, fsm.c,  186, PB-GATT bearer: A: A_PDU_ACK
    <t:     692208>, fsm.c,  239, PB-GATT bearer: E: E_PDU_RX
    <t:     692215>, fsm.c,  186, PB-GATT bearer: A: A_PDU_RX
    <t:     692222>, prov_provisionee.c,  341, Provisionee: provisioning start message received!
    <t:     692243>, fsm.c,  239, PB-GATT bearer: E: E_PDU_RX
    <t:     692252>, fsm.c,  186, PB-GATT bearer: A: A_PDU_RX
    <t:     692258>, prov_provisionee.c,  369, Provisionee: public key message received!
    <t:     692265>, fsm.c,  239, PB-GATT bearer: E: E_PDU_TX
    <t:     692271>, fsm.c,  186, PB-GATT bearer: A: A_PDU_TX
    <t:     708437>, fsm.c,  239, PB-GATT bearer: E: E_TX_COMPLETE
    <t:     708443>, fsm.c,  186, PB-GATT bearer: A: A_PDU_ACK
    <t:     714647>, fsm.c,  239, PB-GATT bearer: E: E_PDU_RX
    <t:     714652>, fsm.c,  186, PB-GATT bearer: A: A_PDU_RX
    <t:     714659>, prov_provisionee.c,  392, Provisioning: provisioning confirmation received!
    <t:     714684>, fsm.c,  239, PB-GATT bearer: E: E_PDU_TX
    <t:     714690>, fsm.c,  186, PB-GATT bearer: A: A_PDU_TX
    <t:     724658>, fsm.c,  239, PB-GATT bearer: E: E_TX_COMPLETE
    <t:     724664>, fsm.c,  186, PB-GATT bearer: A: A_PDU_ACK
    <t:     724671>, fsm.c,  239, PB-GATT bearer: E: E_PDU_RX
    <t:     724677>, fsm.c,  186, PB-GATT bearer: A: A_PDU_RX
    <t:     724683>, prov_provisionee.c,  423, Provisionee: provisioner's random number received!
    <t:     724699>, fsm.c,  239, PB-GATT bearer: E: E_PDU_TX
    <t:     724704>, fsm.c,  186, PB-GATT bearer: A: A_PDU_TX
    <t:     740884>, fsm.c,  239, PB-GATT bearer: E: E_TX_COMPLETE
    <t:     740890>, fsm.c,  186, PB-GATT bearer: A: A_PDU_ACK
    <t:     740897>, fsm.c,  239, PB-GATT bearer: E: E_PDU_RX
    <t:     740903>, fsm.c,  186, PB-GATT bearer: A: A_PDU_RX
    <t:     740909>, prov_provisionee.c,  449, Provisionee: received provisioning data!
    <t:     740920>, fsm.c,  239, PB-GATT bearer: E: E_PDU_TX
    <t:     740925>, fsm.c,  186, PB-GATT bearer: A: A_PDU_TX
    <t:     757088>, fsm.c,  239, PB-GATT bearer: E: E_TX_COMPLETE
    <t:     757098>, fsm.c,  186, PB-GATT bearer: A: A_PDU_ACK
    <t:     797653>, fsm.c,  239, PB-GATT bearer: E: E_DISCONNECTED
    <t:     797659>, fsm.c,  186, PB-GATT bearer: A: A_LINK_CLOSE_NOTIFY
    <t:     797665>, mesh_provisionee.c,  171, gatt_database_reset
    <t:     797671>, bearer_handler.c,  312, bearer_handler_stop
    <t:     797676>, bearer_handler.c,  325, bearer_handler_stop timeslot_trigger
    <t:     797682>, fsm.c,  201, PB-GATT bearer: state S_LINK_ACTIVE -> S_IDLE
    <t:     946545>, net_beacon.c,  265, BEACON TX 2A:E3:11:D3

    Here's some more complete logs... What i noticed in difference to code compiled straight from the mesh SDK is that on my integration project the beacon only transmits once, whereas in the SDK it does so at an interval after provisioning has been initiated. So perhaps I'm looking at some kind of timer issue here. But it could also be only a part of the problem.

Related