This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF Connect Mesh Light/Light Switch Example unreliable

We are developing a mesh application for nRF5340 currently using the nRF5340PDK.  We have loaded one dev board with the Mesh Light example and the other with the Mesh Light Switch example (including adding the following to prj.conf: CONFIG_BT_CTLR_TX_BUFFER_SIZE=74, CONFIG_BT_CTLR_DATA_LENGTH_MAX=74).  Provisioning is succesfull for both boards and the Mesh Light is controllable through the nRF Mesh app.  However after having setup the Mesh Light Switch to publish to all address (0xFFFF) the relavent LED on the Light Switch illuminates but not on the Light when the Light Switch is pressed.  After some fiddling with publish settings on th eLight Switch it appears that increasing the retransmission count to 7 does yield some control of the Mesh Light however only ~50% of the time.  Please advise if this is expected or if there is a way to fix this.  We are reluctant to press on with custom mesh application development while the example is not working reliably.  Thanks in advance.

In addition to this issue we face Zephyr stack overflow tracing back to the log_backend_uart.c thread when enabling mesh logging for ACCESS, TRANS, NET, ADV.  This is making it very difficult to diagnose the above issue.

# Logging
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_MESH_DEBUG=y
CONFIG_BT_MESH_DEBUG_MODEL=y
CONFIG_BT_MESH_DEBUG_PROV=y
CONFIG_BT_MESH_DEBUG_BEACON=y
CONFIG_BT_MESH_DEBUG_ACCESS=y
CONFIG_BT_MESH_DEBUG_TRANS=n
CONFIG_BT_MESH_DEBUG_NET=n
CONFIG_BT_MESH_DEBUG_ADV=n

[00:00:29.450,592] <err> os: ***** USAGE FAULT *****
[00:00:29.450,592] <err> os:   Stack overflow (context area not valid)
[00:00:29.450,592] <err> os: r0/a1:  0x0001f0f2  r1/a2:  0x21000000  r2/a3:  0x01000000
[00:00:29.450,622] <err> os: r3/a4:  0x02000000 r12/ip:  0x04000000 r14/lr:  0x08000000
[00:00:29.450,622] <err> os:  xpsr:  0x20000000
[00:00:29.450,622] <err> os: Faulting instruction address (r15/pc): 0x10000000
[00:00:29.450,653] <err> os: >>> ZEPHYR FATyr OS build v2.3.0-rc1-ncs1  ***

  • Hi Jacob, 

    Could you clarify what you meant by "the relavent LED on the Light Switch illuminates but not on the Light when the Light Switch is pressed." I assume you meant the light on the light server didn't turn on. 
    Please be aware that the address 0xFFFFF only address all nodes, not all elements. This means this address is only consumed by the first element of each node, not all the elements of the node. So if you light switch model is on the 2nd element it won't process the address destination 0xFFFF. 

    If you configure the light server to subscribe to a group address (for example 0xC000) and you publish the command from the light switch to that group address, would it work without retransmission ? 

  • Hi Hung,

    - Correct, when pressing button one on the light switch LED 1 on the light switch illuminates but no LEDs on the light illuminate

    - That is useful to know about 0xFFFF

    - In this case it does not work it all, with/without re-transmission.  The group is controllable by the nRF mesh app when connected to the light via proxy

    The above logging issue was fixed by re-importing the project into embedded studio once the prj.conf file had been changed.  

    The following logs are generated by the light switch when button 1 is pressed (LED 1 on light does not illuminate nore are any logs printed by the light):

    [00:32:36.685,974] <dbg> bt_mesh_access.bt_mesh_model_publish:
    [00:32:36.686,004] <dbg> bt_mesh_access.bt_mesh_model_publish: Publish Retransmit Count 7 Interval 50ms
    [00:32:36.686,004] <dbg> bt_mesh_access.model_send: net_idx 0x0000 app_idx 0x0000 dst 0xc000
    [00:32:36.686,004] <dbg> bt_mesh_access.model_send: len 4: 82030148
    [00:32:36.817,993] <dbg> bt_mesh_access.publish_sent: err 0
    [00:32:36.817,993] <dbg> bt_mesh_access.publish_sent: Publishing next time in 50ms
    [00:32:36.868,103] <dbg> bt_mesh_access.mod_publish:
    [00:32:36.868,103] <dbg> bt_mesh_access.mod_publish: period 0 ms
    [00:32:36.999,664] <dbg> bt_mesh_access.publish_sent: err 0
    [00:32:36.999,664] <dbg> bt_mesh_access.publish_sent: Publishing next time in 50ms
    [00:32:37.049,774] <dbg> bt_mesh_access.mod_publish:
    [00:32:37.049,774] <dbg> bt_mesh_access.mod_publish: period 0 ms
    [00:32:37.181,152] <dbg> bt_mesh_access.publish_sent: err 0
    [00:32:37.181,182] <dbg> bt_mesh_access.publish_sent: Publishing next time in 50ms
    [00:32:37.231,262] <dbg> bt_mesh_access.mod_publish:
    [00:32:37.231,262] <dbg> bt_mesh_access.mod_publish: period 0 ms
    [00:32:37.362,823] <dbg> bt_mesh_access.publish_sent: err 0
    [00:32:37.362,823] <dbg> bt_mesh_access.publish_sent: Publishing next time in 50ms
    [00:32:37.412,933] <dbg> bt_mesh_access.mod_publish:
    [00:32:37.412,933] <dbg> bt_mesh_access.mod_publish: period 0 ms
    [00:32:37.544,525] <dbg> bt_mesh_access.publish_sent: err 0
    [00:32:37.544,555] <dbg> bt_mesh_access.publish_sent: Publishing next time in 50ms
    [00:32:37.594,635] <dbg> bt_mesh_access.mod_publish:
    [00:32:37.594,635] <dbg> bt_mesh_access.mod_publish: period 0 ms
    [00:32:37.726,470] <dbg> bt_mesh_access.publish_sent: err 0
    [00:32:37.726,501] <dbg> bt_mesh_access.publish_sent: Publishing next time in 50ms
    [00:32:37.776,580] <dbg> bt_mesh_access.mod_publish:
    [00:32:37.776,580] <dbg> bt_mesh_access.mod_publish: period 0 ms
    [00:32:37.908,172] <dbg> bt_mesh_access.publish_sent: err 0
    [00:32:37.908,203] <dbg> bt_mesh_access.publish_sent: Publishing next time in 50ms
    [00:32:37.958,282] <dbg> bt_mesh_access.mod_publish:
    [00:32:37.958,282] <dbg> bt_mesh_access.mod_publish: period 0 ms
    [00:32:38.089,874] <dbg> bt_mesh_access.publish_sent: err 0
    [00:32:41.337,615] <dbg> bt_mesh_beacon.beacon_send:
    [00:32:41.337,646] <dbg> bt_mesh_beacon.secure_beacon_send:
    [00:32:41.337,677] <dbg> bt_mesh_beacon.bt_mesh_beacon_create: net_idx 0x0000 flags 0x00 NetID c2c18b859325129b
    [00:32:41.337,707] <dbg> bt_mesh_beacon.bt_mesh_beacon_create: IV Index 0x00000000 Auth 5194e44054260785
    [00:32:41.407,714] <dbg> bt_mesh_beacon.beacon_complete: err 0

    The following logs are generated by the light when group 0xC000 is switched on via proxy (the LEDs assigned to this address do illuminate):

    D: rssi 0 net_if 2
    D: 22 bytes: 57833b0a2d7674fdef17c646c9b83978fca2de36a21f
    D:
    D: NID 0x57 net_idx 0x0000
    D: NID 0x57 net_idx 0x0000
    D: IVI 0 net->iv_index 0x00000000
    D: src 0x0001
    D: Decryption successful. Payload len 18
    D: src 0x0001 dst 0xc000 ttl 5
    D: PDU: 57050000770001c00076066f5839f3542a0c
    D: No matching LPN for address 0xc000
    D: src 0x0001 dst 0xc000 seq 0x00000077 friend_match 0
    D: Payload 76066f5839f3542a0c
    D: AFK 1 AID 0x36
    D: Waiting 5 seconds
    D: AKF 1 AID 0x36
    D: len 8: 066f5839f3542a0c
    D: app_idx 0x0000 src 0x0001 dst 0xc000
    D: len 4: 8203010a
    D: OpCode 0x00008203
    D:
    D:
    D:
    D:
    D: TTL 5 CTL 0 dst 0xc000
    D: Relaying packet. TTL is now 4
    D:
    D:
    D: src 0x0001 seq 0x000077 old_iv 0
    D: Stored RPL bt/mesh/RPL/1 value

    Any further suggestions would be much appreciated. 

  • Hi Jacob, 
    Sorry that I'm a bit confused. You meant that when you use group 0xC000 it always works. But when you use 0xFFFF no LED illuminated ? 
    Have you double check if there is any light switch server located at the primary element of the node ? 


    I wouldn't suggest to use 0xFFFF for normal operation. It should only be used for special command that you want to address all nodes regardless the configuration. 

  • Hi Hung,

    When using 0xFFFF it works ~50% of the time, when using 0xC000 it has never worked.  It seems the setup is correct when using address 0xFFFF as it sometimes does work, it is just very unreliable which doesn't seem like a problem with the address but the network itself.  Any thoughts on what could be causing the reliability issues?  Thanks

  • Hi Jacob,

    I'm testing the example here and can reproduce the issue. I will check with the developer to see what could be wrong here.
    When testing with the nRF52 instead of the nRF53 I don't see any problem, but on the nRF53 what I observed was that the light server still work normally it can receive the command from other nodes (nRF52) with no problem. But the light client doesn't work as it should I don't see other node to receive the command from the NRF53. The local light server model on the same node can receive but not the external node. 

    In addition what I observed is that when you click the button it only switches on the LED, if you want to switch off the LED you need to double click (one click - 1 second - another click). It maybe designed that way but I would need to double check.  

Related