RE:Sequence Number Recovery for bluetooth mesh?

Hi Amanda,
My Last Ticket  with Same Subject wrongly closed and issue not resolved So starting new

Want to know how suggestion in your last reply will resolve my sequence number mismatch issue.

I tried procedure above but not working .

also Sequence number is not part of JSON and it's backup will not help for this.

Please go throgh my case below,

1.  I have working provisioned node 0x09 and  it commuicates with gateway 0x01.
     gw_seq_num  =0x100004  node_seq_num  = 0x100002 (last pkt ).
2.  Now if my gateway bluetooth device dammged  (using using nrf52840 DK now).
3.  and Want to use new Gateway bluetooth  (nrf52840 DK new) with same JSON
4.  If i try to use this new hardware sequence number is starting from 0x000000.
5.  And as node sequence number reached at  0x100002. it will not accept packet from gateway.

In my case i am  25 node are in network. 
So what i have to do to communicate with all nodes.

Thanks and Regards,
Mital

Parents
  • Hi,

    In order to store the sequence number on the device between sessions and/or resets, you can set PERSISTENT_STORAGE=1.

    For getting the current sequence number block from the device, you can use Bluetooth Mesh Net State Get.

    For setting the sequence number block on the device, for instance for the purpose of initializing a new device as a replacement for an old damaged one, you can use Bluetooth Mesh Net State Set. Acutally starting to use sequence numbers from the new "Next Seqnum Block" of the new Net State may require a reset. It is therefore important that PERSISTENT_STORAGE=1 is set for this to work.

    Regards,
    Terje

  • Hi Terje,

    I did PERSISTENT_STORAGE=1. only. but not able to set/update sequence number getting invalid state error.

    Can u check and comment on below function from file  "nrf5_sdk_mesh/mesh/serial/src/serial_handler_mesh.c"

    I think this is not allowing me to set sequence number.  Shall i  remove this condition check? Is this create any other issue?

    static void handle_net_state_set(const serial_packet_t * p_cmd)
    {
     #if PERSISTENT_STORAGE
      serial_handler_common_cmd_rsp_nodata_on_error(p_cmd->opcode, NRF_ERROR_INVALID_STATE, NULL, 0);
    #else
        uint32_t status = net_state_iv_index_and_seqnum_block_set(
      p_cmd->payload.cmd.mesh.net_state_set.iv_index,
      p_cmd->payload.cmd.mesh.net_state_set.iv_update_in_progress,
      p_cmd->payload.cmd.mesh.net_state_set.next_seqnum_block);
      serial_handler_common_cmd_rsp_nodata_on_error(p_cmd->opcode, status, NULL, 0);
    #endif
    }

    Also i need command/function to reset provisioned node from pyaci ( I didn't find this in pyaci code) 


    Thanks and Regards,
    Mital 




Reply
  • Hi Terje,

    I did PERSISTENT_STORAGE=1. only. but not able to set/update sequence number getting invalid state error.

    Can u check and comment on below function from file  "nrf5_sdk_mesh/mesh/serial/src/serial_handler_mesh.c"

    I think this is not allowing me to set sequence number.  Shall i  remove this condition check? Is this create any other issue?

    static void handle_net_state_set(const serial_packet_t * p_cmd)
    {
     #if PERSISTENT_STORAGE
      serial_handler_common_cmd_rsp_nodata_on_error(p_cmd->opcode, NRF_ERROR_INVALID_STATE, NULL, 0);
    #else
        uint32_t status = net_state_iv_index_and_seqnum_block_set(
      p_cmd->payload.cmd.mesh.net_state_set.iv_index,
      p_cmd->payload.cmd.mesh.net_state_set.iv_update_in_progress,
      p_cmd->payload.cmd.mesh.net_state_set.next_seqnum_block);
      serial_handler_common_cmd_rsp_nodata_on_error(p_cmd->opcode, status, NULL, 0);
    #endif
    }

    Also i need command/function to reset provisioned node from pyaci ( I didn't find this in pyaci code) 


    Thanks and Regards,
    Mital 




Children
No Data
Related