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

Mesh disable time vary

Dears,

I am working with mesh sdk 3.0 and 15.2 with soft device S140 nrf82840, our application using the mesh network topology for minimum amount of time then turn it on again after certain period, I tried to disable the mesh by command  nrf_mesh_disable and wait for NRF_MESH_EVT_DISABLED event but I found it takes from 10-20 second on average to disable the mesh.

What I ask for is how to decrease this time to minimum amount of time, I need this time to be 2 sec at most! and why this time is varying?

I there are generic configuration like "NEXT_CONN_PARAMS_UPDATE_DELAY" and "CONN_SUP_TIMEOUT" could help to decrease this time? 

Parents
  • Hi.

    When you say "disable the mesh", do you mean starting and stopping the advertising?

    You can use the two API'S mesh_adv_start() and mesh_adv_stop() for that.

    /**
     * Starts advertising connectable advertisements.
     *
     * @note This call will assert if the advertisement data has not been set.
     */
    void mesh_adv_start(void);
    
    /**
     * Stops the connectable advertisements.
     */
    void mesh_adv_stop(void);

    Best regards,

    Andreas

  • Thanks but I want to have minimum power consumption so I used the following commands;

    static void mesh_evt_handler(const nrf_mesh_evt_t * p_evt)
    {
        if (p_evt->type == NRF_MESH_EVT_DISABLED)
        {
          __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "----- BLE SDH OFF -----\n");
          //volatile uint8_t a=1;
          nrf_sdh_suspend();                                          //Disable Soft device
        }
    
    }

    int main(void) {
      initialize();
      m_mesh_evt_handler.evt_cb = mesh_evt_handler;
      nrf_mesh_evt_handler_add(&m_mesh_evt_handler);
      
      
      //code continue
      
      while(1){
      
      //...
      nrf_mesh_disable();
      //wait till sdh power off
      
      
      //...
      nrf_sdh_resume();              //enable Soft device   
      uint32_t err_code = nrf_mesh_enable();
      APP_ERROR_CHECK(err_code);
      
      
      }
      
     }

  • Hi.

    Sorry for the late reply, I've looked a bit more into this, can you try the following for enable/disable mesh:

    Disable mesh:

    uint32_t retval = proxy_stop();
    
                if (retval == NRF_SUCCESS)
    
                {
    
                    scanner_disable();
    
                    retval = nrf_mesh_disable();
    
                }
    
         __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Disabling mesh: status: %d\n", retval);

    Enable mesh:

     scanner_enable();
    
                uint32_t retval = proxy_enable();
    
                if (retval == NRF_SUCCESS)
    
                {
    
                    retval = proxy_start();
    
                }
    
     
    
                if (retval == NRF_SUCCESS)
    
                {
    
                    retval = nrf_mesh_enable();
    
                }
    
     
    
                __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Enabling  mesh: status: %d\n", retval);

    These two code snippets should be the proper sequence to disable/enable mesh according to an expert.

    Best regards,

    Andreas

Reply
  • Hi.

    Sorry for the late reply, I've looked a bit more into this, can you try the following for enable/disable mesh:

    Disable mesh:

    uint32_t retval = proxy_stop();
    
                if (retval == NRF_SUCCESS)
    
                {
    
                    scanner_disable();
    
                    retval = nrf_mesh_disable();
    
                }
    
         __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Disabling mesh: status: %d\n", retval);

    Enable mesh:

     scanner_enable();
    
                uint32_t retval = proxy_enable();
    
                if (retval == NRF_SUCCESS)
    
                {
    
                    retval = proxy_start();
    
                }
    
     
    
                if (retval == NRF_SUCCESS)
    
                {
    
                    retval = nrf_mesh_enable();
    
                }
    
     
    
                __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Enabling  mesh: status: %d\n", retval);

    These two code snippets should be the proper sequence to disable/enable mesh according to an expert.

    Best regards,

    Andreas

Children
Related