User avatar
with ice cream
Posts: 187
Joined: Mon Jul 30, 2012 7:25 am

Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Mon Jan 06, 2020 11:56 am

I don't know why but it seems two Raspberry Pis on my network (a 4b and a 3b) don't see each other when they are connected to different frequency bands on the same access point. In other words, it seems as if the access point wouldn't route between devices on different bands. On the other hand, I can ping both from a third Pi which goes through a network extender or from my PC which uses a LAN connection.

To bypass the situation I want to force the afflicted Pis to connect to the same band (2.4 GHz). Regrettably, the Pi 4 ignores my settings (frequencies, MAC addresses, priority, etc.) in wpa_supplicant.conf (see below).

I don't want to rename the SSIDs. I don't know if the follows the AP's steering request or if it changes by itself. I tried removing/changing the stanza related to the 5 GHz network but that doesn't seem to make a difference. The Pi keeps switching bands.

Code: Select all

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=XX
ap_scan=1
freq_list=2412 2417 2422 2427 2432 2437 2442 2452 2457 2462 2467 2472
network={
# 2.4 GHz
        ssid="abcdef"
        psk="hunter2"
        key_mgmt=WPA-PSK
        bssid=34:81:C4:XX:XX:XX
        priority=50
}

network={
# 5 GHz
        ssid="abcdef"
        psk="hunter2"
        key_mgmt=WPA-PSK
        bssid=34:81:C4:XX:XX:XY
        disabled=1
}
What else can I try?

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Mon Jan 06, 2020 8:09 pm

I've no idea myself but hopefully there is a way of disabling the 5Ghz part of the inbuilt WiFi.

One solution might be to buy a separate 2.4GHz dongle and just completely disable the internal

User avatar
with ice cream
Posts: 187
Joined: Mon Jul 30, 2012 7:25 am

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Mon Jan 06, 2020 8:26 pm

mattmiller wrote:
Mon Jan 06, 2020 8:09 pm
One solution might be to buy a separate 2.4GHz dongle and just completely disable the internal
One solution when you can't unlock your house's back door is to add another one with a working lock. : )

Edit: No snarkyness intended.
Last edited by with ice cream on Mon Jan 06, 2020 8:29 pm, edited 1 time in total.

mattmiller
Posts: 2247
Joined: Thu Feb 05, 2015 11:25 pm

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Mon Jan 06, 2020 8:29 pm

:-)
[edit]Absolutely none taken - I knew what you meant :) [/edit]
Last edited by mattmiller on Tue Jan 07, 2020 11:40 am, edited 1 time in total.

beta-tester
Posts: 1393
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Tue Jan 07, 2020 11:22 am

is your 5Ghz/2.4GHz AP a DIY one? if so, i mean in hostapd.conf is written,
that when using 5GHz and 2.4GHz at the same time these are in fact two different interfaces.
maybe you forgot to tell to "bridge" those two interfaces together...
you also can give both bands a different SSID name e.g. abc for the 2.4GHz band and abc-5g for the 5GHz band. so you can choose the bands by name, when you connect a device.
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

User avatar
with ice cream
Posts: 187
Joined: Mon Jul 30, 2012 7:25 am

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Tue Jan 07, 2020 11:41 am

beta-tester wrote:
Tue Jan 07, 2020 11:22 am
is your 5Ghz/2.4GHz AP a DIY one? [...]
you also can give both bands a different SSID name e.g. abc for the 2.4GHz band and abc-5g for the 5GHz band. so you can choose the bands by name, when you connect a device.
Thanks for the remark. The access point is a widely used commercial cable router. Also, it seems, weirdly enough, as if there would be no routing between the bands for some but not all clients. Differentiating by SSID is my last resort, I want some dumber devices to pick the best band they get with the same SSID and credentials.

The question remains: how can I disable 5G wifi on a Raspberry Pi 4 or get it to observe priority and BSSID and keep it from changing bands.

Paul Hutch
Posts: 562
Joined: Fri Aug 25, 2017 2:58 pm
Location: Blackstone River Valley, MA, USA
Contact: Website

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Tue Jan 07, 2020 1:02 pm

You can use the freq_list parameter in wpa_supplicant.conf to limit what frequency/channels the Pi will connect to.
List of channels: https://en.wikipedia.org/wiki/List_of_WLAN_channels

Examples:

Only allow North American 2.4 GHz channels:

Code: Select all

freq_list=2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462
Only allow North American 5 GHz channels:

Code: Select all

freq_list=freq_list=5180 5190 5200 5210 5220 5230 5240 5250 5260 5270 5280 5290 5300 5310 5320 5500 5510 5520 5530 5540 5550 5560 5570 5580 5590 5600 5610 5620 5630 5640 5660 5670 5680 5690 5700 5710 5720 5745 5755 5765 5775 5785 5795 5805 5825
You can even limit the Pi to one specific channel if you want.

User avatar
with ice cream
Posts: 187
Joined: Mon Jul 30, 2012 7:25 am

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Tue Jan 07, 2020 1:22 pm

Paul Hutch wrote:
Tue Jan 07, 2020 1:02 pm
You can use the freq_list parameter in wpa_supplicant.conf to limit what frequency/channels the Pi will connect to.
Thanks, but I trying that already (see above). It is not working. When I check, it initially connects to 34:81:C4:XX:XX:XX but soon switches to 34:81:C4:XX:XX:XY.

Paul Hutch
Posts: 562
Joined: Fri Aug 25, 2017 2:58 pm
Location: Blackstone River Valley, MA, USA
Contact: Website

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Tue Jan 07, 2020 1:37 pm

I missed that you'd tried it outside of the network block. I use this successfully but from inside the network block on Raspbian Stretch.

Code: Select all

network={
    ssid="FAKESSID"
    psk="fakepassphrase"
    key_mgmt=WPA-PSK
    freq_list=2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462
}
When you use freq_list outside a network block it limits scanning only not the actual network connections.


beta-tester
Posts: 1393
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Tue Jan 07, 2020 3:53 pm

if freq_list=... is not working, maybe scan_freq=... to only scan the given frequencies.
or non_pref_chan=... to define non prefered channels in multi band operation
Last edited by beta-tester on Tue Jan 07, 2020 4:28 pm, edited 1 time in total.
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

beta-tester
Posts: 1393
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Tue Jan 07, 2020 4:25 pm

i also found that there is a bssid white list and black list... see here

Code: Select all

# Example configuration blacklisting two APs - these will be ignored
# for this network.
network={
	ssid="example"
	psk="very secret passphrase"
	bssid_blacklist=02:11:22:33:44:55 02:22:aa:44:55:66
}

# Example configuration limiting AP selection to a specific set of APs;
# any other AP not matching the masked address will be ignored.
network={
	ssid="example"
	psk="very secret passphrase"
	bssid_whitelist=02:55:ae:bc:00:00/ff:ff:ff:ff:00:00 00:00:77:66:55:44/00:00:ff:ff:ff:ff
}
to me, the documentation for wpa_... is a bit stange.
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

User avatar
with ice cream
Posts: 187
Joined: Mon Jul 30, 2012 7:25 am

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Thu Jan 09, 2020 9:49 pm

beta-tester wrote:
Tue Jan 07, 2020 3:53 pm
if freq_list=... is not working, maybe scan_freq=... to only scan the given frequencies.
or non_pref_chan=... to define non prefered channels in multi band operation
It wasn't working- I have the suspicion that the access point's steering is overriding the client's settings (which shouldn't happen, IMHO). I'll try the other options.

User avatar
with ice cream
Posts: 187
Joined: Mon Jul 30, 2012 7:25 am

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Wed Jan 29, 2020 3:37 pm

Whitelisting the desired MAC, blacklisting the unwanted MAC of the AP and limiting the frequencies didn't help. Every once in a while the Raspberry ends up in the 5 GHz network. : (

beta-tester
Posts: 1393
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Wed Jan 29, 2020 10:17 pm

is it possible to tell the wlan interface to change the channel while it is connected to 5G band?

Code: Select all

sudo iw dev wlan0 set channel <channel>
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

User avatar
with ice cream
Posts: 187
Joined: Mon Jul 30, 2012 7:25 am

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Thu Jan 30, 2020 2:33 am

beta-tester wrote:
Wed Jan 29, 2020 10:17 pm
is it possible to tell the wlan interface to change the channel while it is connected to 5G band?
Thanks for the suggestion but I don't think changing the channel would solve the original issue. I also think one has to select the channel the access Point is broadcasting on.

The issue is twofold. It seems that one Raspberry Pi gets steered to the other frequency and this cannot be prevented. When this happens another Raspberry Pi on the same network suddenly can no longer reach the first one. The access point uses the same SSID and password on both bands so that phones and tablets can roam and get steered.

beta-tester
Posts: 1393
Joined: Fri Jan 04, 2013 1:57 pm
Location: de_DE

Re: Odd routing, cannot force 4b Pi to 2.4 GHz wifi (wpa_supplicant)

Thu Jan 30, 2020 7:06 am

strange that there is no possibility to force a client to use only a specific band...
what are all those configuration options good for, when they do not work...
(i guess it should work since 2015 - commit & test)

maybe you can ask the wpa_supplicant maintainer directly - https://w1.fi/wpa_supplicant/ use its mailing list to ask them for a solution...

... would be interesting to see what the issue is. (bug in RPi's WLAN driver?)
{ I only give negative feedback }
RPi B (256MB), B (512MB), B+, ZeroW; 2B; 3B, 3B+; 4B (4GB)

Return to “Advanced users”