scanNetworks() on WifiNINA.h disconnect from Wifi

Hi everyone !

It is my first post with you, I hope I will be clear.

I use 'Arduino Nano 33 IOT' for my project asociated with WiFiNINA.h library.

#include <WiFiNINA.h>
void setup() { 
NOT USEFUL HERE I don't left it
}

void loop() 
{
  // scan for existing networks:
  Serial.println("Scanning available networks...");
  listNetworks();
  WiFiconnexion();
  delay(10000);
}

I put here my code the problem come with the listNetworks() use..

void listNetworks() 
{
  // scan for nearby networks:
  Serial.println("** Scan Networks **");
  int numSsid = WiFi.scanNetworks();
  //HERE IT DISCONNECT FROM THE NETWORK I WAS CONNECTED TO BECAUSE OF WiFi.scanNetworks()
[...]}

But I have to scan available WiFi every 10 sec to see If a closest and strongest (dBm) WiFi is available. If so I have to change my connection. But most of the time I have to stay connected to the same WiFI.

Do you know if another library or fonction can scan for network without disconnecting from the network we are connected with ?

Hope to be clear .
Have a nice day :wink:

You only have one radio in the WiFi module. When you scan for other WiFi networks the radio must change frequency and then look for any WiFi network sending out beacon frames. During this time, your module can no longer send alive messages or answer any request from the network access point.

I guess you need to figure out whether this can be solved by firmware only or whether you need a WiFi module that has this as an additional feature e.g. dual channel support or something like that.

Have a look at the u-blox website. They have a large range of modules.