Seamless Handoff between Access Points using Arduino MKR WIFI 1010

Hi,

I started working with a MKR WIFI 1010 about a few weeks ago, for a IoT project. A necessary feature for this project is the ability to make a seamless handoff between Access Points, working in the same network (same SSID and SSID password).

So far, I do not have any problem to connect the arduino board to wifi, to one specific AP. The problem arise when the prototype is "moving away" from that AP, and moving closer to another AP in the network. In this scenario I want the board to reconnect to the new (closer) AP. Now, I loose the connection from the first AP due to the distance.

I have tried to solve this problem by using an if-case and the following code, see below. My intention by doing this was to be able to re-connect to the closest AP.

if (status WL_CONNECTION_LOST){

Wifi_Connect()

}

void Wifi_Connect()
{
if (WiFi.status() == WL_NO_MODULE) { // check for the WiFi module:

Serial.println("Communication with WiFi module failed!");
while (true); // don't continue
}

while (status != WL_CONNECTED) { // attempt to connect to Wifi network:

Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
status = WiFi.begin(ssid, pass); // Connect to WPA/WPA2 network. Change this line if using open or WEP network:

// wait 10 seconds for connection:
delay(5000);
}
Serial.println("Connected to wifi");
}

Is there anyone that has been able to make a seamless handoff between APs when using the MKR 1010?

Not knowing exactly Your modules I ask If You could do different in the code

 if (WiFi.status() == WL_NO_MODULE) {                          // check for the WiFi module:
    
    Serial.println("Communication with WiFi module failed!");   
    while (true);                                              // don't continue
  }

Can You try dropping the "whiel(true)"? That definately terminates all future events.

Hi Railroader,

Thank you for replying!

I am a bit suspicious if this will allow me to make a seamless handoff between Access Points or if I just will get stuck in the while(true)-loop.

Or is there a way, that you know, how to auto reset the board without using the actual reset button?

Thank you for the help!

I have no knowledge about that chip so I can't tell if it can be reset some way.
Make a test, drop the "while(true)" and see what is happening!

Railroader:
I have no knowledge about that chip so I can't tell if it can be reset some way.
Make a test, drop the "while(true)" and see what is happening!

the while(true); is in "if NO_MODULE"

Is there any timing considerations? When the vehicle enters the area of a new AP it might take some time, need some readings to get the new AP accepted.... To set the variable NO_MODULE = false?
Does the software and/or software manage to handle the situation when both the previous and the new AP are available?

I have tried to solve this problem by using an if-case and the following code, see below. My intention by doing this was to be able to re-connect to the closest AP.

I assume this did not work, or you would not have posted. So what does happen?

Please read the forum guide in the "please read" sticky post. It will tell you how to post code correctly, and warns against basic mistakes like saying that something you tried didn't work without describing what did happen and what you wanted/expected to happen.