Not able to restore model publication state after reboot using sensor_server example in bluetooth mesh

Hi, 

As queried before in this link, I am not able to restore the model publication state after reboot. Am using sensor server example to write my application on top of it. The SDK am using is "nrf5 sdk for mesh v 5.0.0". Is this a bug or am I missing any steps in development? A workaround for this issue would be really helpful for me.

Regards,

Hariharan D

  • Hi Hariharan, 

    If you are using nRF5 Mesh SDK v5.0.0, you can try enable this setting: 

    ACCESS_MODEL_PUBLISH_PERIOD_RESTORE inside nrf_mesh_config_core.h , it will enable store and restoring the publish period for the model.

    Note that by default the mesh spec doesn't enforce that the publish period is to be restored after reset ( dynamic behavior )

  • It worked!! Thanks a lot Hung Bui. But why is it not enabled by default? And also am facing another issue in setting the model publish period through model configuration. If I set the publish period to 5seconds, it should send data every 5 seconds, right? But its not behaving in the expected way. It is publishing data at a much faster rate (less than 5 seconds). When I change the publishing period too, I am seeing the same kind of behavior. Any workaround for this issue?

  • Hi Hariharan,

    You can have a look at my answer a few year back here regarding why we don't store it in the first place. 

    Could you let me know how you tested the issue on wrong publishing rate? Did you try to test on an example in the SDK ?  Did you test with Mesh app on mobile ? Which version did you test ? 

    Which exact rate of publishing  you are seeing ? 

  • Yeah sure, I will have a look into it Hung Bui.

    I am using ESP32 as my provisioner. And I am giving the model publication state to be set to the provisioner through UART. Then ESP32 does the model configuration in my nRF device which is acting as a sensor server node. Yes, I did test it on the example SDK. 

    Referring to the mesh documentation, I am setting the publish period as per the required format. Screenshot of the reference attached below.

Related