How to select better wifi channel (uno wifi rev 2 WiFiNINA)

Hi everyone, thanks for reading.

I am using an Arduino Uno WiFi Rev 2, with the WiFiNINA library.

My problem is that when i do WiFi.begin(ssid,pass) It always selects channel 1 by default, which has terrible signal. There are other channels with much better signal. Can i select a different wifi channel? I know ESP8266 has a begin() function with channel # as a param.

I scanned the available networks with example code and got this

  1. Signal: **-55 dBm Channel: 11 ** BSSID: FC:EC:DA:AA:5C:ED
    Encryption: WPA2
    SSID: mySSID

  2. Signal: -71 dBm Channel: 1 BSSID: FC:EC:DA:AA:64:94
    Encryption: WPA2
    SSID: mySSID

Can i specifically connect to channel 11? Or edit the library to ignore channel 1 somehow
something like this i edited in WiFi.cpp

int WiFiClass::begin(const char* ssid)
{
	uint8_t status = WL_IDLE_STATUS;

   if (WiFiDrv::wifiSetNetwork(ssid, strlen(ssid)) != WL_FAILURE)
   {
	   for (unsigned long start = millis(); (millis() - start) < _timeout;)
	   {
		   delay(WL_DELAY_START_CONNECTION);
		   status = WiFiDrv::getConnectionStatus();
		   if ((status != WL_IDLE_STATUS) && (status != WL_NO_SSID_AVAIL) && (status != WL_SCAN_COMPLETED)) {
		     // If WiFi.channel() == 1, keep searching
                     // If WiFi.bssid() == bssid of channel 1, keep searching
			 break;
		   }
	   }

EDIT: updated WiFiNINA firmware to 1.4.1 - still not working

Notes:
(I am in an office space where i cannot move my device closer to the router)
(Getting an extender with a different network name to specifically connect to is not ideal for other reasons in my project)

The channel is given by the access point. It should automatically select the access point with best signal if more than one is available.

pylon:
The channel is given by the access point. It should automatically select the access point with best signal if more than one is available.

The problem is that it does not select the better channel. My phone/laptop can. But the arduino uno wifi rev 2 doesn’t select a good channel, even though the hardware can find it and display it as a better channel.

You cannot influence that selection, at least you cannot without modifying the firmware of the WiFiNINA module. That uses an ESP32 internally, so theoretically you can do almost everything you can do with that processor but I'm not sure if that's worth it. The ESP32 offers an API call to set the channel but it doesn't work in every mode the module is in.

Update : used a rpi as a hotspot that is connected by ethernet to the main network. Can still send mqtt to the hotspot and the server on main network can see it

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.