Force RPi 4 to 2.4Ghz WiFi only

Hi,

We are looking for a way to forge the RPi 4 to 2.4Ghz band only (bg only, no a).

We tried using the NM connection setup for band and channels but it does not seem to make any difference - the device keeps connecting to 5Ghz channels. We also tried configuring the NM connection to specific BSSID but it appears NM or wpa_supplicant ignores this as well. We’re not sure why this is ignored.

Note that the SSID we are testing with has BSSID on both 2.4 and 5Ghz - the signal strength on 2.4Ghz is stronger and we set the band=bg in the NM connection profile under the [wifi] section.

Any ideas or advice on how to achieve this?

Thank you! :wink:

Hi @n42,

Welcome to the forums! I think this thread will provide you with the answer you need for forcing connection to the 2.4Ghz band only. In short, open a terminal into the HostOS, and edit the wifi config file located in /mnt/boot/system-connections by adding:

[802-11-wireless]
band=bg

or

[wifi]
band=bg

Let us know how you make out.

John

1 Like

Thank you for the quick response. I will test it shortly.

BTW, is there a way to force the entire interface to only use 2.4Ghz? (ie., avoid scanning 5Ghz altogether) – on NM? wpa_supplicant or driver level? (this is RPi4)

Hi Rani,

According to that thread, it can be pretty difficult to disable a band on the device, but according to this you can do it with wpa-supplicant by explicitly setting the frequencies. I imagine it would take some trial and error, but it’s theoretically doable.

John

Hi,

This setting is how NM forces wpa_supplicant to use 2.4g - it just provides it with a list of frequencies.

I have tested the band=bg and while initially it looked promising, it does not seem to work reliably.

I have booted the unit a couple of times to make sure configuration loads from scratch and it’s configured properly.

I have the following NM connection setup:

[connection]
id=MyNet
uuid=280e2b37-b8e0-4a41-b40c-caf9188f33b0
type=wifi
interface-name=wlan0
permissions=

[wifi]
band=bg
mac-address-blacklist=
mode=infrastructure
ssid=MyNet

[wifi-security]
key-mgmt=wpa-psk
psk=MyPSK

[ipv4]
dns-search=
method=auto

[ipv6]
addr-gen-mode=stable-privacy
dns-search=
method=auto

[proxy]

Running ‘nmcli d w’ (list wifi connections), after the unit is on for a few minutes I get:

IN-USE SSID MODE CHAN RATE SIGNAL BARS SECURITY
MyNet Infra 9 130 Mbit/s 92 **** WPA2
xyz1 Infra 1 130 Mbit/s 89 **** WPA2
xyz2 Infra 40 540 Mbit/s 85 **** WPA2

  •   MyNet               Infra  36    270 Mbit/s  77      ***   WPA2        
      MyNet               Infra  9     130 Mbit/s  72      ***   WPA2        
      --                     Infra  157   270 Mbit/s  70      ***   WPA2        
      MyNet               Infra  36    270 Mbit/s  42      **    WPA2        
      XFINITY                Infra  157   540 Mbit/s  35      **    WPA2 802.1X 
      KO                     Infra  157   540 Mbit/s  34      **    WPA2        
      DIRECT-CY-FireTV_c53c  Infra  157   130 Mbit/s  34      **    WPA2        
    

Note that the strongest signal for the SSID is on 2.4g (channel 9) and yet the Balena RPi4 connects to BSSID on channel 36.

Any idea how to get around this?

I very much appreciate your help and support.

Thank you :wink:

Reading the logs it appears it initially connects to the 2.4ghz channel 9 and then decides to roam to 5ghz channel 36.

Any idea what triggers the roaming? is it the driver? wpa_supplicant? NetworkManager?

If possible, you could setup a 2.4ghz only ssid network in your wifi-settings on the network controller/router - but that require you to have access to those settings.

I did solve the 2.4ghz issue in my environment by making a hidden IoT-only ssid/wifi-lan, running on only the 2.4ghz radios. That can also be used for a lot of other tweaks and security settings for your units as well.

We have no control on where the device is deployed - so having a 2.4Ghz only SSID is not an option. We need to limit to 2.4Ghz only on the RPi side.

It’s just a shame there is no way to configure NM, wpa_supplicant (under NM control) or RPi driver to bg (2.4Ghz) only mode - if anyone knows of a way, please let me know.

1 Like

Hey there

Are you able to create two separate networks for each band - ie with different ssids?

Seems like the band=bg option is dependent on the device driver as suggested here

This setting depends on specific driver capability and may not work with all drivers.

No, we cannot setup separate SSIDs. These devices are deployed in the field with customers. We have no control over the wifi setup.

It’s amazing that such a trivial use case, which historically was always supported with pretty much all WiFi NICs is so hard to achieve. I’m not sure if it’s NM, wpa_supplicant or the driver that’s allowing the roaming to a 5Ghz network when wpa_supplicant is specifically configured (by NM, due to band=bg) to only use 2.4Ghz frequencies. I wonder if this is a wpa_supplicant bug (ie, not adhering to freq_list) or a driver issue where it is not even aware of this restriction.

The reason for wanting to stay on 2.4 is because of the inherently stronger signal over 5 ? If that’s the case then maybe our question to answer is how can we make the device always use the strongest signal. I am making this assumption because of:

Note that the strongest signal for the SSID is on 2.4g (channel 9) and yet the Balena RPi4 connects to BSSID on channel 36.

Is this the goal ? If not why do you want to stay on 2.4 ? Then we can try some other solutions to meet that.

Also, above you mentioned that after modifying your configuration to use band=bg in /mnt/boot/system-connections it appeared the device remained on 2.4 but after rebooting it switches back. Is this the case ? Can you explain more what steps you did to undo this working solution ? Maybe there’s an issue with system-connections settings persisting after a reboot.