I am working through the ncs wi-fi samples on an nRF7002 DK board ...
I can get the shell example to work ... so I know that authentication with my access point (AP) and
DHCP is working correctly.
When I build and try to run the sta (station) example it hangs at the scanning stage ...
Output from shell example (SSSID and password crossed out) ...
Wifi scan … output
uart:~$
[00:00:00.357,086] <inf> wifi_nrf: Firmware (v1.2.8.1) booted successfully
[00:00:00.516,204] <inf> fs_nvs: 6 Sectors of 4096 bytes
[00:00:00.516,235] <inf> fs_nvs: alloc wra: 0, fe8
[00:00:00.516,235] <inf> fs_nvs: data wra: 0, 0
*** Booting Zephyr OS build v3.3.99-ncs1-1 ***
Starting nrf7002dk_nrf7001_nrf5340_cpuapp with CPU frequency: 128 MHz
[00:00:00.516,662] <inf> wpa_supp: Successfully initialized wpa_supplicant
uart:~$
uart:~$ wifi connect xxxxxxxx yyyyyyyy
Connection requested
[00:05:39.711,303] <inf> wpa_supp: wlan0: CTRL-EVENT-DSCP-POLICY clear_all
[00:05:41.388,397] <inf> wpa_supp: wlan0: SME: Trying to authenticate with e8:ad:a6:e0:81:22 (SSID='xxxxxxxxx' freq=2462 MHz)
[00:05:41.391,326] <inf> wifi_nrf: wifi_nrf_wpa_supp_authenticate:Authentication request sent successfully
[00:05:41.652,191] <inf> wpa_supp: wlan0: Trying to associate with e8:ad:a6:e0:81:22 (SSID='BTBHub6-35MR' freq=2462 MHz)
[00:05:41.657,806] <inf> wifi_nrf: wifi_nrf_wpa_supp_associate: Association request sent successfully
[00:05:41.673,492] <inf> wpa_supp: wlan0: Associated with e8:ad:a6:e0:81:22
[00:05:41.673,553] <inf> wpa_supp: wlan0: CTRL-EVENT-SUBNET-STATUS-UPDATE status=0
Connected
[00:05:42.694,183] <inf> wpa_supp: wlan0: WPA: Key negotiation completed with e8:ad:a6:e0:81:22 [PTK=CCMP GTK=CCMP]
[00:05:42.694,305] <inf> wpa_supp: wlan0: CTRL-EVENT-CONNECTED - Connection to e8:ad:a6:e0:81:22 completed [id=0 id_str=]
[00:05:49.830,993] <inf> net_dhcpv4: Received: 192.168.1.87
uart:~$ wifi status
Status: successful
==================
State: COMPLETED
Interface Mode: STATION
Link Mode: WIFI 4 (802.11n/HT)
SSID: xxxxxxxxxx
BSSID: yyyyyyyyyy
Band: 2.4GHz
Channel: 11
Security: WPA2-PSK
MFP: Optional
RSSI: -73
Beacon Interval: 100
DTIM: 3
TWT: Not supported
uart:~$ net ipv4
IPv4 support : enabled
IPv4 fragmentation support : disabled
Max number of IPv4 network interfaces in the system : 1
Max number of unicast IPv4 addresses per network interface : 1
Max number of multicast IPv4 addresses per network interface : 1
IPv4 addresses for interface 1 (0x200016a8) (Ethernet)
====================================================
Type State Lifetime (sec) Address
DHCP preferred 192.168.1.87/255.255.255.0
uart:~$
uart:~$ net dns google.com
Query for 'google.com' sent.
dns: 142.250.187.238
dns: All results received
uart:~$ net ping 142.250.187.238
PING 142.250.187.238
28 bytes from 142.250.187.238 to 192.168.1.87: icmp_seq=1 ttl=117 time=24 ms
28 bytes from 142.250.187.238 to 192.168.1.87: icmp_seq=2 ttl=117 time=16 ms
28 bytes from 142.250.187.238 to 192.168.1.87: icmp_seq=3 ttl=117 time=20 ms
uart:~$
To ping PC on WiFi network turn private firewall off (for testing purposes) … and then try to ping …
uart:~$ net ping 192.168.1.86
PING 192.168.1.86
28 bytes from 192.168.1.86 to 192.168.1.87: icmp_seq=1 ttl=128 time=14 ms
28 bytes from 192.168.1.86 to 192.168.1.87: icmp_seq=2 ttl=128 time=13 ms
28 bytes from 192.168.1.86 to 192.168.1.87: icmp_seq=3 ttl=128 time=14 ms
uart:~$
but, if private firewall is on …
uart:~$ net ping 192.168.1.86
PING 192.168.1.86
Ping timeout
uart:~$
Output from sta example
WiFi sta output :
OK
*** BooOK
OK
OK
OK
OK
OK
OK
OK
OK
ting nRF Connect SDK v2.5.0 ***
[00:00:00.560,333] K
m<inf> net_config: Initializing network
[00:00:00.560,333] <inf> net_config: Waiting interface 1 (0x20001478) to be up...
[00:00:00.560,455] <inf> net_config: IPv4 address: 192.168.1.99
[00:00:00.560,516] <inf> net_config: Running dhcpv4 client...
[00:00:00.560,791] <inf> sta: Starting nrf7002dk_nrf5340_cpuapp with CPU frequency: 64 MHz
[00:00:01.560,882] <inf> sta: QSPI Encryption disabled
[00:00:01.560,943] <inf> sta: Static IP address (overridable): 192.168.1.99/255.255.255.0 -> 192.168.1.1
[00:00:03.115,997] <inf> sta: Connection requested
[00:00:03.116,027] <inf> sta: ==================
[00:00:03.116,058] <inf> sta: State: SCANNING
[00:00:03.416,198] <inf> sta: ==================
[00:00:03.416,229] <inf> sta: State: SCANNING
[00:00:03.716,369] <inf> sta: ==================
[00:00:03.716,400] <inf> sta: State: SCANNING
[00:00:04.016,510] <inf> sta: ==================
[00:00:04.016,540] <inf> sta: State: SCANNING
[00:00:04.316,650] <inf> sta: ==================
[00:00:04.316,680] <inf> sta: State: SCANNING
[00:00:04.616,790] <inf> sta: ==================
[00:00:04.616,821] <inf> sta: State: SCANNING
[00:00:04.916,931] <inf> sta: ==================
[00:00:04.916,961] <inf> sta: State: SCANNING
[00:00:05.217,071] <inf> sta: ==================
[00:00:05.217,102] <inf> sta: State: SCANNING
[00:00:05.517,211] <inf> sta: ==================
[00:00:05.517,242] <inf> sta: State: SCANNING
Help and suggestions would be much appreciated, especially some
guidelines and advice on how to troubleshoot this problem.