We are using SDK v2.6.1 for our application and would like to search for nearby Wi-Fi networks using the nRF7002-DK.
Could you please assist us with this? If any reference code is available, we would greatly appreciate it.
We are using SDK v2.6.1 for our application and would like to search for nearby Wi-Fi networks using the nRF7002-DK.
Could you please assist us with this? If any reference code is available, we would greatly appreciate it.
Hi
Please check out the Wi-Fi: Scan sample available in nRF Connect SDK to see how to do scanning with the nRF7002 DK. Alternatively, we also have the Wi-Fi Shell sample if you want some more runtime configurables using a shell. It also has scanning capabilities.
Best regards,
Simon
thank you for your support,
I used SDK v2.6.2 for the Wi-Fi scan sample.
Currently, I can read the scan data only once. How can I modify the code to read the data at regular intervals? Below are the logs for your reference.
Scan requested
Num | SSID (len) | Chan | RSSI | Security | BSSID
1 | realme 123 10 | 6 | -56 | WPA2-PSK | 72:09:DE:FB:74:41
2 | 0 | 6 | -70 | WPA2-PSK | F4:92:BF:2D:A3:70
3 | TG 2 | 6 | -75 | WPA2-PSK | FA:92:BF:2D:A3:70
Scan request done
Scan requested
Scan request done
Scan requested
Scan request done
Scan requested
Scan request done
Scan requested
Scan request done
Scan requested
Hi
The wifi_scan(); function is only called once in the main() loop, so you'll need to change how it is called by for example repeating the function every X seconds or so.
Best regards,
Simon
I thought the wifi_scan()
function in the Wi-Fi scan sample code was being called at regular intervals because the message 'Scan requested' is printed inside the wifi_scan()
function.
However, the NET_EVENT_WIFI_SCAN_RESULT
event is triggered only once. How can I ensure that the callback enters the NET_EVENT_WIFI_SCAN_RESULT
case repeatedly?
Hi
Ah, okay. Sorry about the misunderstanding. Yes, this is handled in the wifi_mgmt_event_handler() and it will return the scan_result or scan_done event depending on the callback. I guess you can change it to always return the scan results instead of the "DONE" message if you'd like, or to add results to the handle_wifi_scan_done() function.
Best regards,
Simon