Restart Mesh Device

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
LUAB_4724786
Level 4
Level 4
25 replies posted 10 likes received 10 replies posted

Hi There,

Is there a function that application can call to restart the mesh device ?

Best Regards,

LUTHFI AD

0 Likes
1 Solution

Hi,

One suggestion is to use wiced_hal_wdog_reset_system(); in the application to executes a soft reset on the chip by tripping the watchdog timer. But, it does not take into consideration of disabling all the interrupts, which makes this API a helper function to assist in performing the hard reset.

Thanks,

-Dheeraj

View solution in original post

5 Replies
DheerajPK_41
Moderator
Moderator
Moderator
750 replies posted 500 likes received 500 replies posted

Hi,

Please use mesh_application_factory_reset()  API for putting the device into factory default condition. Factory reset will return the device to an un-provisioned state. Please check mesh_application.c for it's usage and definition.

void mesh_application_factory_reset(void)

{

    WICED_BT_TRACE("mesh_application_factory_reset: *************************\n");

    // uncomment following lines to delete UUID from the NV. This will change UUID on factory reset.

    // wiced_result_t result;

    // mesh_nvram_access(WICED_TRUE, NVRAM_ID_LOCAL_UUID, NULL, 0, &result);

    if (wiced_bt_mesh_app_func_table.p_mesh_app_factory_reset)

    {

        wiced_bt_mesh_app_func_table.p_mesh_app_factory_reset();

    }

    wiced_bt_mesh_core_init(NULL);

    node_authenticated = WICED_FALSE;

    pb_gatt_in_progress = WICED_FALSE;

}

Thanks,

-Dheeraj

0 Likes

Dear Dheeraj,

Yes, I tested that ... its actually, restarting and reinitialize into factory state, is there a way just to restart the device (not un-provisioned it after a reset) ? it might be applicable in some solution if I just want to do some remote restart from a mesh device.

Thanks.

0 Likes

Hi,

One suggestion is to use wiced_hal_wdog_reset_system(); in the application to executes a soft reset on the chip by tripping the watchdog timer. But, it does not take into consideration of disabling all the interrupts, which makes this API a helper function to assist in performing the hard reset.

Thanks,

-Dheeraj

Dear Dheeraj,

Many Thanks ! I tested a bit just now and it is working ! I will test more on different types, normal mesh and LPN, looks solid just now ! One more think ... during reset, is it fine that the Timer is reinit ? I have some timer in there and the watch dog function reset seems clear the ram stat as well, which is good ... just a precaution question, thanks a lot !

Best Regards,

LUTHFI AD

0 Likes

Hi,

I am not sure about how you are going to implement the logic in the application.

You can reinit the timer as far as, it is not interfering/blocking any required functionalities of the app.

Thanks,

-Dheeraj

0 Likes