6

I read in the post that RPi 3 could not manage to operate on both bands simultaneously. Can RPi4 do that? We are planning to create mesh network with Rpi nodes. With single band operation, the throughput drops drastically, as the node count increases.

  • 1
    Devices with one radio only operate on one band at a time. Dual-band APs have two (or more) independent radios. – hobbs Sep 24 at 2:54
12

Beforehand the answer:
Yes, it is possible to run a RPi 4B simultaneously on dual band (WiFi 2.4GHz / 5GHz), but only with predefined interface combinations given by the hardware. If one interface is used as access point (AP) you can only use one band.

First to clarify: you are talking about RPi 3B, the link you have given is talking about a RPi 3B+. This is an important difference. RPi 3B only supports the 2.4 GHz band so there is no question if it can also use a 5 GHz band. It can't. RPi 3B+ supports dual band. The RPi 4B uses the same on-board wifi chip than RPi 3B+ so it also supports dual band.

With iw list on RPi 4B you will find:

--- snip ---
valid interface combinations:
     * #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,
       total <= 3, #channels <= 2
     * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
       total <= 4, #channels <= 1
--- snip ---

This tells you what combinations are possible. For example you can make in total 3 connections, maybe managed, P2P-client and P2P-GO on two channels (one on 2.4 GHz and one on 5 GHz). But with an access point (AP) you can have 4 connections in total but only on one channel.

A channel is a frequency (range), for example channel 1 (2412 MHz on 2.4 GHz band) and channel 36 (5180 MHz on 5 GHz band). Because with an AP you can only use one channel it implies that you can only use one band. You may consider to create a peer-to-peer group owner (P2P-GO) instead of an access point. It behalves similar to it. Then according to the "valid interface combinations" it should be possible to create a second managed client connection on another band.

If you do not find a possible combination you always can use an additional USB/WiFi dongle.

UPDATE:
Because of the extended discussion about this issue I have made a test to get some facts. I tried to use the default dhcpcd networking environment but wasn't able to get a stable environment. Sometimes it works, sometimes not with a crashed wifi driver brcmfmac. I suppose dhcpcd has to much constraints with using its hooks in /lib/dhcpcd/dhcpcd-hooks/. So I used systemd-networkd that provides a clean environment. First I switched to systemd-networkd and setup a client connection to my internet router on the 2.4 GHz band, doing this on a Raspberry Pi 4B with a fresh flashed Raspbian Buster Lite 2019-07-10:

# disable debian networking and dhcpcd
rpi ~$ sudo -Es
rpi ~# systemctl mask networking.service dhcpcd.service
rpi ~# sudo mv /etc/network/interfaces /etc/network/interfaces~
rpi ~# sed -i '1i resolvconf=NO' /etc/resolvconf.conf

# enable systemd-networkd
rpi ~# systemctl enable systemd-networkd.service systemd-resolved.service
rpi ~# ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf

Create the managed client uplink connection:

rpi ~# cat > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf <<EOF
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=DE

network={
    freq_list=2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 2467 2472
    # freq_list=5170 5180 5190 5200 5210 5220 5230 5240 5260 5280 5300 5320 5500 5520 5540 5560 5580 5600 5620 5640 5660 5680 5700
    ssid="wlan@hoeft-online.de"
    psk="verySecretPassword"
}
EOF

rpi ~# chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
rpi ~# systemctl disable wpa_supplicant.service
rpi ~# systemctl enable wpa_supplicant@wlan0.service

After a reboot then define the autonomous peer-to-peer group owner P2P-GO with wpa_cli:

rpi ~$ wpa_cli
--- snip ---
Interactive mode

> p2p_group_add freq=5
OK
<3>P2P-GROUP-STARTED p2p-wlan0-0 GO ssid="DIRECT-Vv" freq=5220 passphrase="i9rEDnPw" go_dev_addr=a6:78:e7:1f:37:2f
> quit

If you want a frequency on the 2.4 band you can use parameter freq=2 instead. You should find now the GO with your cell phone as DIRECT-Vv (or what ssid p2p_group_add returned to you) like any other wifi hotspot. Look what setup you have with:

rpi ~$ iw dev
phy#0
        Interface p2p-wlan0-0
                ifindex 4
                wdev 0x3
                addr d2:3d:c9:4f:6b:fb
                type P2P-GO
                channel 36 (5180 MHz), width: 20 MHz, center1: 5180 MHz
                txpower 31.00 dBm
        Unnamed/non-netdev interface
                wdev 0x2
                addr d2:3d:c9:4f:eb:fb
                type P2P-device
                txpower 31.00 dBm
        Interface wlan0
                ifindex 3
                wdev 0x1
                addr dc:a6:32:01:db:ed
                ssid wlan@hoeft-online.de
                type managed
                channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz
                txpower 31.00 dBm

Here we have channel 1 (2412 MHz) on interface wlan0 and channel 36 (5180 MHz) on interface p2p-wlan0-0 that definitely answers the question.


references:
wpa_supplicant and Wi-Fi P2P
List of WLAN channels

  • can we use one band for Wi-Fi connection and meanwhile create a hotspot on the other band? – yekanchi Sep 24 at 5:52
  • @yekanchi Please note the sentence in the answer: "But with an access point (AP) you can have 4 connections in total but only on one channel." An access point is another name for a hotspot. A channel is a frequency (range), for example channel 1 (2412 GHz on 2.4 GHz band) and channel 36 (5180 GHz on 5 GHz band). Because with a hotspot you can only use one channel it implies that you can only use one band. What you asked in the comment is not possible. I have also updated my answer. – Ingo Sep 24 at 9:20
  • is it impossible for this chip on RPi4 or you maintain it's globally impossible with one chip? – yekanchi Sep 24 at 9:34
  • 2
    @yekanchi: the whole reason that there's an iw list command is because this varies between chips. If it would be globally impossible, there would be no need to see if it is locally possible. – MSalters Sep 24 at 9:38
5

There are very few production Wifi chips that supports concurrent dual band operation. The only one I know is SF16A18, which seems not to be in a real mass production phase.

This is because if you put dual band in a single chip that work concurrently, there will be signal interference problems since the TX/RX radio circuits are in like 2mm to each other on a single chip, and thermal problems thanks to the dual band power amplifier working concurrently, so it is hard to design.

For access points(or wireless routers) that supports concurrent dual band, often there are at least two Wifi chips on board, such as MT7620(single band 2.4G)+MT7612(dual band like the chip in the question, but works only under 5G).

So basically every dual band Wifi module in the market cannot support current dual band except for special designed modules which will be much larger and cost more.

But with complex software you can use the Wifi chip in a TDM way as if there are more than one Wifi chips, here is an example from Realtek: https://github.com/CalielOfSeptem/rtl8188cus/blob/master/document/Realtek_WiFi_concurrent_mode_Introduction.pdf, but this can only get more feature, not more bandwidth since there is only one physical Wifi link at any time.

  • But even the simple built-in chip of a Raspberry Pi 3B+/4B can use two channels simultaneously, e.g. channel 1 (2412 MHz) and channel 36 (5180 MHz). – Ingo Sep 24 at 8:36
  • @Ingo This is done by switching the Wifi chip between 2.4G and 5G in a TDM way. For example, if your cell phone support dual band Wifi, then you will see both 2.4G and 5G APs around you, because whatever band you are connecting to, the Wifi driver will switch the chip to 5G channels(and other 2.4G channels,too) hoping receiving 5G beacon packets from the AP. With complex software you may even implement the goal of the question, but this can't improve the real bandwidth easily, it may even downgrade the bandwidth. – jw_ Sep 24 at 9:32
  • @Ingo are you sure it's using them simultaneously? On my pi I need to choose to connect to either 2.4 or 5GHz. The device driver would not let me connect to both. I don't think the hardware is capable of connecting to both – slebetman Sep 24 at 9:42
  • I do not really understand what you mean. The cell phone shows two bands that it can connect to. If selected one band it will only use that. One connection on one band, so far so good. – Ingo Sep 24 at 9:52
  • 1
    The list of APs in the Wifi setting UI comes from beacon packets your phone has received. Once your phone receives a beacon packets from a new AP, it is added to the list. Your phone constantly switch the Wifi chip to each wifi band and stay for a while (very short) hoping receiving some beacon packet. For most time, the Wifi chip will stay on the band that you are currently connecting to, so it can deliver a high bandwidth on that band. – jw_ Sep 24 at 9:56
4

On the Raspberry Pi 4, wireless support is provided by the same Cypress CYW43455 chip as on the Pi 3 B+. A limitation of this chip is that it cannot do Real Simultaneous Dual Band (RSDB). You could add a USB wifi module, to have two devices, each on a different band.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.