5 Replies Latest reply on Sep 6, 2020 2:06 PM by DheerajP_41

    Restart Mesh Device

    LUAB_4724786

      Hi There,

       

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

       

      Best Regards,

      LUTHFI AD

        • 1. Re: Restart Mesh Device
          DheerajP_41

          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

          • 2. Re: Restart Mesh Device
            LUAB_4724786

            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.

            • 3. Re: Restart Mesh Device
              DheerajP_41

              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

              1 of 1 people found this helpful
              • 4. Re: Restart Mesh Device
                LUAB_4724786

                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

                • 5. Re: Restart Mesh Device
                  DheerajP_41

                  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