3

I have an Arduino Nano 33 IoT configured to connect to my WiFi network with a pretty straightforward code:

#include <WiFiNINA.h>

int status = WL_IDLE_STATUS; status = WiFi.status(); while (status != WL_CONNECTED) { status = WiFi.begin(ssid, pass); if (status == WL_CONNECTED) break; delay(5000); }

My problem is that in an environment with multiple access points sharing the same SSID (roaming environment) my Arduino is constantly connecting to the weakest one of the access points.

I verified with WiFi Explorer on my laptop that multiple access points are in reach at the same location where the Arduino is placed and for some reason my Arduino decides to connect to the base station with BSSD ending :CA:81, which is paradoxly the weakest one:

WiFi explorer

Is there a way to address this issue?

adamsfamily
  • 133
  • 2

1 Answers1

5

On Nano 33 IoT the WiFi network adapter is NINA esp32 module with Arduino's nina-fw. nina-fw is written with the use of ESP-IDF framework by the esp32 manufacturer Espressif.

To connect to an AP the ESP-IDF has a configuration function, which takes a structure with settings. One of the settings is wifi_scan_method and nina-fw uses WIFI_FAST_SCAN. The alternative is WIFI_ALL_CHANNEL_SCAN.

WIFI_FAST_SCAN Do fast scan, scan will end after find SSID match AP

There is no simple solution for this. I don't know why they changed the setting. If it should be configurable then the firmware and the WiFiNINA library have to change to support it.

Or you can get the sources of the firmware, change the setting, build the firmware (it is not trivial) and flash it to NINA on your Nano.

Juraj
  • 18,264
  • 4
  • 31
  • 49