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

Mesh Serial example don't store sequence number

In the mesh serial example, I found that the sequence number isn't stored into persistent flash. If that is the case, if the board is power cycled, no one can communicate with it. Why it is implemented this way?

Parents Reply Children
  • No, it won't work. If you dive into the source that you find SEQ is not stored in flash at all.

  • Hello Summer, 

    For me, it works in mesh SDK v2.2.0 and also the later version.

    The SEQ won't be stored in the flash directly. Since the SEQ will keep increase whenever a node sends a mesh packet, it will cost lots of time for keeping storing SEQ into flash if a node sending mesh messages very frequently. So mesh SDK will arrange a "block" of SEQ in the flash, and will only update the block number when current SEQ is going to exceed the current block number, or when the device reset,

    The block size is defined in NETWORK_SEQNUM_FLASH_BLOCK_SIZE, the default setting value is 8192, which means:

    1. When a node is provisioned, it will send message with SEQ from 0, but will set a block with 8192 in the flash.

    2. If the node reset, the mesh stack will arrange a new block, so the SEQ will start from 8192, and if the node got reset again, the SEQ will start from  16384

    3. If the node keeps sending messages, which makes the SEQ exceed the arranged block size, then mesh stack will arrange a new block size.

    4. With the above mechanism, the mesh stack doesn't need to record every SEQ into the flash.

    Hope upon information can do help.

  • Hello,

    I am facing quite the same Issue. I am working with persistent storage = 0 for specific reason.
    I don't want to user persistent storage = 1.
    I am using the serial like in the PyACI example. So serial communicate with other mesh modules.
    The issue is when serial is reset (restart) the sequence number is 0. So msg to other modules are rejected (who have a bigger seq number ...).
    Is there a way to store seq number with persistent storage = 0 ?
    Or can we set the seq number of serial on startup ?

    I already check many posts, didn't find an answer with persistent storage = 0.

    Hope someone can help !?

    Kind regards