After migration NCS 2.9.0 to NCS 3.1.1, wifi WPA-PSK connection no longer works?

I am trying to migrate my project (for a custom nrf5340/nrf7002 board) from NCS2.9.0 to NCS 3.1.1, to hopefully get the wifi WPA Enterprise functionality to work.

This is an existing project, already in pre-production, that builds and works for wifi WPA2-PSK under NCS2.9.0.

My code (taken from the wifi sta sample) does this to start connection:

memset(&(ctx->cnx_params), 0, sizeof(struct wifi_connect_req_params));
	ctx->cnx_params.security = WIFI_SECURITY_TYPE_WPA_AUTO_PERSONAL;		// 1;	allows WPA/WPA2/WPA3 PSK security.

	// Note : this timeout does not seem to have any effect, the connect timeout in the WPA is always 10s (but we have a connect timer to shorten it if required)
	// But don't set it less than the 10s as the wpa_supp doesn't like being disconnected while its still trying...
	ctx->cnx_params.timeout = wvmgr_get_item_as_int("devcfg.wifi.connect_timeout_seconds", 30)* 1000;		//SYS_FOREVER_MS;

	/* Defaults */
	ctx->cnx_params.band = WIFI_FREQ_BAND_2_4_GHZ;		// WIFI_FREQ_BAND_UNKNOWN;
	ctx->cnx_params.channel = WIFI_CHANNEL_ANY;
	ctx->cnx_params.mfp = WIFI_MFP_OPTIONAL;

	/* SSID */
	// SSID, wpa2 pass can be set as specific to this network defn, or as a global AP setting
	ctx->cnx_params.ssid = ssid;
	ctx->cnx_params.ssid_length = strlen(ctx->cnx_params.ssid);

	ctx->cnx_params.psk = wpa2_pass;
	ctx->cnx_params.psk_length = strlen(ctx->cnx_params.psk);

	if ((ret=net_mgmt(NET_REQUEST_WIFI_CONNECT, ctx->iface,
		     &ctx->cnx_params, sizeof(struct wifi_connect_req_params)))!=0) {
		log_cpwrn("netwifi: Connection request WPA2-PSK failed (%d) to AP[%s][%s]; reset wifi", ret, ctx->cnx_params.ssid, ctx->cnx_params.psk);
		ctx->connect_requested = false;
		_wifi_reset(ctx);
		return false;
	}

With 3.1.1, I get a rapid response on the callback registered for wifi mgmt events:

static void _wifi_mgmt_event_handler(struct net_mgmt_event_callback *cb,
                     uint32_t mgmt_event, struct net_if *iface) {
    const struct wifi_status *status =
        (const struct wifi_status *) cb->info;
....
 
Registered by this code:
    net_mgmt_init_event_callback(&(ctx->wifi_sta_mgmt_cb),
                _wifi_mgmt_event_handler,
                // chnaged in ncs3.1.1 : _NET_WIFI_EVENT | 0xFF);
                NET_WIFI_EVENT | 0xFF);
    net_mgmt_add_event_callback(&(ctx->wifi_sta_mgmt_cb));
First I get mgmt_event = NET_EVENT_WIFI_CONNECT_RESULT and status = WIFI_STATUS_CONN_FAIL
and then mgmt_event = NET_EVENT_WIFI_CONNECT_RESULT and status = WIFI_STATUS_CONN_WRONG_PASSWORD
But the password is NOT wrong, it works when built under 2.9.0

-  there the event mgmt_event = NET_EVENT_WIFI_CONNECT_RESULT, status=WIFI_STATUS_CONN_SUCCESS

-  the connection works, I get an IP, and can then use the network connection with sockets etc.

What has changed in 3.1.1 that means the connection attempt no longer works?

Parents
  • Hi Brian
    I could not find anything and have asked the wifi team and will update when I hear from them. I recall there was a similiar issue back in NCS 2.6.x but that was fixed in NCS 2.7

    Regards

    Runar

  • Update from R&D

    1. Is it possible to get a sniffer trace so we can check if the EAPoL frame is getting lost? 

    2. Is it possible to get more information about the application so we can see if anything is missing? 

    3. Can you try to set -DCONFIG_NRF_WIFI_RX_STBC_HT=n in NCS 3.1.1 and see if it helps?

    Regards

    Runar

  • Hi,

    1. Is it possible to get a sniffer trace so we can check if the EAPoL frame is getting lost? 

    Sorry, I haven't managed to get my wireshark to do proper capture as I don't have (apparently) the right USB wifi dongle... (any recommendations that definitely work?)

    2. Is it possible to get more information about the application so we can see if anything is missing? 

    Sure : what do they want?

    3. Can you try to set -DCONFIG_NRF_WIFI_RX_STBC_HT=n in NCS 3.1.1 and see if it helps?

    I'll try this next time I have a chance : I have had to revert to 2.9.0 to be able to deliver other functionality to customers as 3.1.1 just wasn't working....

Reply
  • Hi,

    1. Is it possible to get a sniffer trace so we can check if the EAPoL frame is getting lost? 

    Sorry, I haven't managed to get my wireshark to do proper capture as I don't have (apparently) the right USB wifi dongle... (any recommendations that definitely work?)

    2. Is it possible to get more information about the application so we can see if anything is missing? 

    Sure : what do they want?

    3. Can you try to set -DCONFIG_NRF_WIFI_RX_STBC_HT=n in NCS 3.1.1 and see if it helps?

    I'll try this next time I have a chance : I have had to revert to 2.9.0 to be able to deliver other functionality to customers as 3.1.1 just wasn't working....

Children
  • BrianW said:

    Sorry, I haven't managed to get my wireshark to do proper capture as I don't have (apparently) the right USB wifi dongle... (any recommendations that definitely work?)

    In general we recommend intel based wi-fi 6 chipset, for example AX200, I would also note that the support in Windows for wifi sniffing is limited, so there is no support for monitor mode in Windows

    BrianW said:

    Sure : what do they want?

    If possible your application or something that can replicate the issue on a DK. 
    Regards

    Runar

Related