nRF7002 cannot connect to SSID after a while

Hi,

As the title states, after a while, the nRF7002 fails to connect SSID after a while. It happens either we perform net_if_up/down or not. I suspect the nRF7002 to be in a bad state because when I measure the consumption with the ppk2, I have around 750µA instead of around 80µA idle on my system, or ~150µA when interface is Up but IDLE

During connect attemp, I have several mA spikes, but not even close to the  ~200mA spikes and ~60mA floor I am supposed to have when connecting/transmitting.

I am sorry I did not captured the trace as I wasn't expecting to post the issue here at first. As it happend after several days of working, I did not managed to attach a debug session to it yet.

Maybe you have some insight on what is going on, or what could be the issue.

Thank you for your help

Parents
  • Hi

    I'm back in office, and will try to support you on this again.

    Can you try to make sure the Wi-Fi ready is integrated properly?  When the application receives a Wi-Fi not ready event, it has to stop using Wi-Fi (don't send any traffic) and wait for Wi-Fi ready event and trigger a connection explicitly and then start using Wi-Fi on successful connection. The code just check for Wi-Fi readiness only before issue connect, this is incomplete. Please see the event loop https://github.com/nrfconnect/sdk-nrf/blob/main/samples/wifi/sta/src/main.c#L295 for reference (should be customized as per use case).

    Best regards,

    Simon

  • I will try to follow the event loop, but I have some remarks. 

    1) 

    then start using Wi-Fi on successful connection

    I am not sure to understand this. To have a successful connection, one have to use Wi-Fi first right? 

    1 (bis) 

    Wi-Fi not ready event, it has to stop using Wi-Fi (don't send any traffic)

    Do you mean I have to stop AS SOON as I receive the event? What if I was already sending something? In the sample, this case is not showed.

    2) the sta event loop is a bit unclear to me. Is there any particular reason to repeat the instructions 

    ret = k_sem_take(&wifi_ready_state_changed_sem, K_FOREVER);
    			if (ret) {
    				LOG_ERR("Failed to take semaphore: %d", ret);
    				return ret;
    			}

    from lines 325 to 329 and then goto check_wifi_ready while check_wifi_ready could also perform the k_sem_wait? A bit like following :

    check_wifi_ready:
    		LOG_INF("Waiting for Wi-Fi to be ready");
    		ret = k_sem_take(&wifi_ready_state_changed_sem, K_FOREVER);
    		if (ret) {
    			LOG_ERR("Failed to take semaphore: %d", ret);
    			return ret;
    		}
    		if (!wifi_ready_status) {
    			LOG_INF("Wi-Fi is not ready");
    			/* Perform any cleanup and stop using Wi-Fi and wait for
    			 * Wi-Fi to be ready
    			 */
    			continue;
    		}
    .
    .
    .
    
    #ifdef CONFIG_WIFI_READY_LIB
    			goto check_wifi_ready;
    #else

    This would avoid to have 2 k_sem_wait.

    I keep you in touch about my tests, thank you for your answers

Reply
  • I will try to follow the event loop, but I have some remarks. 

    1) 

    then start using Wi-Fi on successful connection

    I am not sure to understand this. To have a successful connection, one have to use Wi-Fi first right? 

    1 (bis) 

    Wi-Fi not ready event, it has to stop using Wi-Fi (don't send any traffic)

    Do you mean I have to stop AS SOON as I receive the event? What if I was already sending something? In the sample, this case is not showed.

    2) the sta event loop is a bit unclear to me. Is there any particular reason to repeat the instructions 

    ret = k_sem_take(&wifi_ready_state_changed_sem, K_FOREVER);
    			if (ret) {
    				LOG_ERR("Failed to take semaphore: %d", ret);
    				return ret;
    			}

    from lines 325 to 329 and then goto check_wifi_ready while check_wifi_ready could also perform the k_sem_wait? A bit like following :

    check_wifi_ready:
    		LOG_INF("Waiting for Wi-Fi to be ready");
    		ret = k_sem_take(&wifi_ready_state_changed_sem, K_FOREVER);
    		if (ret) {
    			LOG_ERR("Failed to take semaphore: %d", ret);
    			return ret;
    		}
    		if (!wifi_ready_status) {
    			LOG_INF("Wi-Fi is not ready");
    			/* Perform any cleanup and stop using Wi-Fi and wait for
    			 * Wi-Fi to be ready
    			 */
    			continue;
    		}
    .
    .
    .
    
    #ifdef CONFIG_WIFI_READY_LIB
    			goto check_wifi_ready;
    #else

    This would avoid to have 2 k_sem_wait.

    I keep you in touch about my tests, thank you for your answers

Children
No Data
Related