How to get or set the sequence number of a mesh node using a BLE proxy device?

Hi all, I have used the nRF mesh app to provision three nodes into a mesh and verified the functionality using the mesh app. I used the export function to dump the mesh configuration data to a json file. The net key and app key were then updated in the mesh proxy client example provided in "MeshProxyDeveloperStudyGuideV2_1_2". I am trying to control the lights of a generic on off server using the client but no success in doing so. As far as I understand I need to ensure the correct sequence number (SEQ 24 bit field) and IVI (32 bit field) has to be set in order for the Mesh client code to be able to change the state of the node. Please help me understand how to get these values from the mesh node.

So far I have changed the following in the client code:

  1. NetKey (As found in json config file)
  2. AppKey (As found in json config file)
  3. Initialised SEQ to 0x000000
  4. Set IV index to 0x00000000
  5. Set SRC to 0x0001 (Address of original provisioner)
  6. Set DST to 0x000C (Unicast address of generic on/off server)

Tried sending the generic ON without acknowledgement. On Raspberry pi I get the following decrypted PDU:

I feel sequence number and IV index are the only links I am missing here and so if I can get these out of the BLE node device, it would be helpful.

Parents Reply Children
  • Hi Andreas, So I found out that light_switch example uses default sequence number of 1 for every new mesh node it receives a communication from. Also the IV index is initialized to 0x00000000 upon provisioning. Catch is that the provisioning device has already communicated multiple times with the mesh node and so a bare minimum action of adding an App Key to a light element increments the Seq_ID upto 0x000007! This is what I was able to figure out by enabling debug messages in the mesh light example program. The json file exported from nRF Mesh app doesn't seem to record sequence IDs. Thanks for the help though :)

    P.S. For anyone trying to understand the way sequence number and IV index (and also general processing of mesh PDU), enable debug messages by appending the following lines of code to your prj.conf file. This will let you print debug messages in the VCOM serial port.

    CONFIG_BT_DEBUG_LOG=y
    CONFIG_BT_MESH_DEBUG=y
    CONFIG_BT_MESH_DEBUG_ACCESS=y
    CONFIG_BT_MESH_DEBUG_MODEL=y
    CONFIG_BT_MESH_DEBUG_TRANS=y
    CONFIG_BT_MESH_DEBUG_NET=y
Related