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

(Mesh)device restart,how to communicate with the previous configuration;

Board: custom board; Mesh SDK: V1.0.0; Softdevice: S132; IDE: SEGGER Embedded; BLE: nrf52832

When I test the steps specified by “Interactive PyACI”, I can Provisioning the client and server, and client can send message to server. but when i restart the board, how to communicate with the previous configuration?

Parents
  • Which firmware did you use ? Have you set PERSISTENT_STORAGE = 1 ? If you did, the configuration should be stored on flash. 

    What did you observe ? 

  • I was asking which application firmware/example did you use ? In our lightswitch example we did call dsm_flash_config_load() in main. 

    What do you mean by " if let the client and server node that has been rebooted print log by serial port" ? 

    Are you saying the subscription/publication address is missing on the client/server after reboot  ? 

  • Sorry, My description is not clear enough. I am using Serial example.

    yes, i think  the subscription/publication address is missing on the client/server after reboot.

    after reboot device, we must send this command  "send(cmd.AddrSubscriptionAdd(49218))"  to reconnfigrate the subscription address to receive the messages.

  • today, this problem solved by me .

    Adding this command in flash_load fountion.

        if(type == DSM_ENTRY_TYPE_ADDR_NONVIRTUAL)
        {
            m_addresses[index].subscription_count++;
        }

    static void flash_load(dsm_entry_type_t type, uint32_t index, const dsm_flash_entry_t * p_entry, uint16_t entry_len)
    {
        NRF_MESH_ASSERT(type < DSM_ENTRY_TYPES);
        const flash_group_t * p_group = &m_flash_groups[type];
    
        p_group->to_dsm_entry(index, p_entry, entry_len);
        bitfield_set(p_group->p_allocated_bitfield, index);
    
        //add by zhou ,to update the subscription address number , avoid adding subscription address after reboot.
        if(type == DSM_ENTRY_TYPE_ADDR_NONVIRTUAL)
        {
            m_addresses[index].subscription_count++;
        }
    }

    to update the subscription number after reboot.

    is this a bug?

  • Hi Beike, 

    Adding subscription_count increase there might not be best idea. Usually what we do is when we restore model (start by calling nrf_mesh_node_config() from main)  , restore_addresses_for_model() in access.c will be called and the subscription_count will be updated by dsm_address_subscription_add_handle() function. 

    The serial example currently demonstrates a simple serialization application, meaning all the configuration data and provisioning should be stored on the peer MCU (or PC). And be restored every time the chip reset. 

    If you are creating a standalone node, I would suggest to have a look at the light switch example. In that example the flash is handled properly. 

Reply
  • Hi Beike, 

    Adding subscription_count increase there might not be best idea. Usually what we do is when we restore model (start by calling nrf_mesh_node_config() from main)  , restore_addresses_for_model() in access.c will be called and the subscription_count will be updated by dsm_address_subscription_add_handle() function. 

    The serial example currently demonstrates a simple serialization application, meaning all the configuration data and provisioning should be stored on the peer MCU (or PC). And be restored every time the chip reset. 

    If you are creating a standalone node, I would suggest to have a look at the light switch example. In that example the flash is handled properly. 

Children
No Data
Related