Station and AP Interfaces on RPI 3B+

Hi, I am new to OpenWrt so this may be a rather basic question, but I was not able to find an answer online.

I have a Raspberry PI 3B+ and I'm using the openwrt-22.03.0-bcm27xx-bcm2710-rpi-3-ext4-factory.img. What I am trying to do is, get an access point and a station to come up together on the single radio that is available.

Using hostapd and wpa_supplicant I was able to get this functionality to work on the Raspberry PI 3B+ using the latest Raspberry PI OS installation.

However when I try the setup with OpenWrt, both wireless interfaces are UP but in a DOWN state. If I disable one wireless interface through UCI the other will work, but they do not seem to want to work together.

sta: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN qlen 1000
    link/ether b8:27:eb:ac:39:af brd ff:ff:ff:ff:ff:ff

ap: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel master br-lan state DOWN qlen 1000
    link/ether ba:27:eb:ac:39:ae brd ff:ff:ff:ff:ff:ff

I have tried the setup using the wpad package, and also with the full hostapd and wpa_supplicant pacakges installed.

If I run the following code and wait

while(true); do ip link show dev sta | grep 'state UP'; done

I will see that the station does briefly try to come up, but then goes down, this will happen every 10 seconds or so.

My question is, is this possible with OpenWrt and the RPI 3B+ or is there something in OpenWrt that is preventing the 2 wireless interfaces from coming up together?

brcmfmac can't do that, it's a hardware/ firmware limitation - you have to decide, either STA xor AP mode. Only one of the reasons why the RPi makes a terrible wireless device - and the RPi3 doesn't even excel in wired-only configuration.

I have done some digging and found that there are some "minor" changes between Raspbian and OpenWrt. The kernel for Raspbian is 5.15.61-v7+ while the kernel OpenWrt uses is 5.10.138
However I suspect the issue is the firmware being used, in OpenWrt, it is the brcm firmware, as shown below

OpenWrt
    root@OpenWrt:/# ls /lib/firmware/brcm/ -al
    drwxr-xr-x    2 root     root          4096 Sep  3 02:55 .
    drwxr-xr-x    3 root     root          4096 Sep  3 02:55 ..
    -rw-r--r--    1 root     root        397312 Sep  3 02:55 brcmfmac43143.bin
    -rw-r--r--    1 root     root        348160 Sep  3 02:55 brcmfmac43236b.bin
    -rw-r--r--    1 root     root        419798 Sep  3 02:55 brcmfmac43430-sdio.bin
    -rw-r--r--    1 root     root          4733 Sep  3 02:55 brcmfmac43430-sdio.clm_blob
    -rw-r--r--    1 root     root           873 Sep  3 02:55 brcmfmac43430-sdio.raspberrypi,3-model-b.txt
    -rw-r--r--    1 root     root        643651 Sep  3 02:55 brcmfmac43455-sdio.bin
    -rw-r--r--    1 root     root          4733 Sep  3 02:55 brcmfmac43455-sdio.clm_blob
    -rw-r--r--    1 root     root          1864 Sep  3 02:55 brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt

and in Raspbian, the brcm seems to be linked to cypress.

RPI
    pi@arcpi:~ $ ls /lib/firmware/brcm -al
    total 13272
    drwxr-xr-x  2 root root    4096 Sep  6 14:49 .
    drwxr-xr-x 41 root root    4096 Sep  6 14:49 ..
    lrwxrwxrwx  1 root root      17 Jul  6 09:37 BCM-0a5c-6410.hcd -> BCM-0bb4-0306.hcd
    -rw-r--r--  1 root root   54734 Jul  6 09:37 BCM-0bb4-0306.hcd
    -rw-r--r--  1 root root   30049 Jan 28  2021 BCM43430A1.hcd
    -rw-r--r--  1 root root   44376 Jan 28  2021 BCM43430B0.hcd
    -rw-r--r--  1 root root   57622 Jan 28  2021 BCM4345C0.hcd
    -rw-r--r--  1 root root   49610 Jan 28  2021 BCM4345C5.hcd
    -rw-r--r--  1 root root   96224 Jul  6 09:37 bcm43xx-0.fw
    -rw-r--r--  1 root root     180 Jul  6 09:37 bcm43xx_hdr-0.fw
    lrwxrwxrwx  1 root root      31 Jul  6 09:37 brcmfmac43012-sdio.bin -> ../cypress/cyfmac43012-sdio.bin
    lrwxrwxrwx  1 root root      36 Jul  6 09:37 brcmfmac43012-sdio.clm_blob -> ../cypress/cyfmac43012-sdio.clm_blob
    -rw-r--r--  1 root root  397312 Jul  6 09:37 brcmfmac43143.bin
    -rw-r--r--  1 root root  385067 Jul  6 09:37 brcmfmac43143-sdio.bin
    -rw-r--r--  1 root root  348160 Jul  6 09:37 brcmfmac43236b.bin
    -rw-r--r--  1 root root  455745 Jul  6 09:37 brcmfmac43241b0-sdio.bin
    -rw-r--r--  1 root root  403855 Jul  6 09:37 brcmfmac43241b4-sdio.bin
    -rw-r--r--  1 root root  408682 Jul  6 09:37 brcmfmac43241b5-sdio.bin
    -rw-r--r--  1 root root  479232 Jul  6 09:37 brcmfmac43242a.bin
    -rw-r--r--  1 root root  253748 Jul  6 09:37 brcmfmac4329-sdio.bin
    -rw-r--r--  1 root root  222126 Jul  6 09:37 brcmfmac4330-sdio.bin
    -rw-r--r--  1 root root    1509 Jul  6 09:37 brcmfmac4330-sdio.Prowise-PT301.txt
    lrwxrwxrwx  1 root root      31 Jul  6 09:37 brcmfmac43340-sdio.bin -> ../cypress/cyfmac43340-sdio.bin
    -rw-r--r--  1 root root    1693 Jul  6 09:37 brcmfmac43340-sdio.meegopad-t08.txt
    -rw-r--r--  1 root root    1724 Jul  6 09:37 brcmfmac43340-sdio.pov-tab-p1006w-data.txt
    -rw-r--r--  1 root root  451566 Jul  6 09:37 brcmfmac4334-sdio.bin
    -rw-r--r--  1 root root  569291 Jul  6 09:37 brcmfmac4335-sdio.bin
    lrwxrwxrwx  1 root root      31 Jul  6 09:37 brcmfmac43362-sdio.bin -> ../cypress/cyfmac43362-sdio.bin
    -rw-r--r--  1 root root     803 Jul  6 09:37 brcmfmac43362-sdio.cubietech,cubietruck.txt
    lrwxrwxrwx  1 root root      43 Jul  6 09:37 brcmfmac43362-sdio.lemaker,bananapro.txt -> brcmfmac43362-sdio.cubietech,cubietruck.txt
    lrwxrwxrwx  1 root root      30 Jul  6 09:37 brcmfmac4339-sdio.bin -> ../cypress/cyfmac4339-sdio.bin
    -rw-r--r--  1 root root  382455 Jul  6 09:37 brcmfmac43430a0-sdio.bin
    -rw-r--r--  1 root root     951 Jul  6 09:37 brcmfmac43430a0-sdio.jumper-ezpad-mini3.txt
    -rw-r--r--  1 root root     875 Jul  6 09:37 brcmfmac43430-sdio.AP6212.txt
    lrwxrwxrwx  1 root root      31 Jul  6 09:37 brcmfmac43430-sdio.bin -> ../cypress/cyfmac43430-sdio.bin
    lrwxrwxrwx  1 root root      36 Jul  6 09:37 brcmfmac43430-sdio.clm_blob -> ../cypress/cyfmac43430-sdio.clm_blob
    -rw-r--r--  1 root root     928 Jul  6 09:37 brcmfmac43430-sdio.Hampoo-D2D3_Vi8A1.txt
    -rw-r--r--  1 root root     831 Jul  6 09:37 brcmfmac43430-sdio.MUR1DX.txt
    lrwxrwxrwx  1 root root      22 Jul  6 09:37 brcmfmac43430-sdio.raspberrypi,3-model-b.txt -> brcmfmac43430-sdio.txt
    lrwxrwxrwx  1 root root      22 Jul  6 09:37 brcmfmac43430-sdio.raspberrypi,model-zero-w.txt -> brcmfmac43430-sdio.txt
    lrwxrwxrwx  1 root root      29 Jul  6 09:37 brcmfmac43430-sdio.sinovoip,bpi-m2-plus.txt -> brcmfmac43430-sdio.AP6212.txt
    lrwxrwxrwx  1 root root      29 Jul  6 09:37 brcmfmac43430-sdio.sinovoip,bpi-m2-ultra.txt -> brcmfmac43430-sdio.AP6212.txt
    lrwxrwxrwx  1 root root      29 Jul  6 09:37 brcmfmac43430-sdio.sinovoip,bpi-m2-zero.txt -> brcmfmac43430-sdio.AP6212.txt
    lrwxrwxrwx  1 root root      29 Jul  6 09:37 brcmfmac43430-sdio.sinovoip,bpi-m3.txt -> brcmfmac43430-sdio.AP6212.txt
    -rw-r--r--  1 root root    1121 Jul  6 09:37 brcmfmac43430-sdio.txt    
	-rw-r--r--  1 root root  416101 Jul  6 09:37 brcmfmac43436-sdio.bin
    -rw-r--r--  1 root root   11209 Jul  6 09:37 brcmfmac43436-sdio.clm_blob
    -rw-r--r--  1 root root    1613 Jul  6 09:37 brcmfmac43436-sdio.txt
    -rw-r--r--  1 root root  436733 Jul  6 09:37 brcmfmac43436s-sdio.bin
    -rw-r--r--  1 root root    1092 Jul  6 09:37 brcmfmac43436s-sdio.txt
    lrwxrwxrwx  1 root root      31 Jul  6 09:37 brcmfmac43455-sdio.bin -> ../cypress/cyfmac43455-sdio.bin
    lrwxrwxrwx  1 root root      36 Jul  6 09:37 brcmfmac43455-sdio.clm_blob -> ../cypress/cyfmac43455-sdio.clm_blob
    lrwxrwxrwx  1 root root      22 Jul  6 09:37 brcmfmac43455-sdio.raspberrypi,3-model-a-plus.txt -> brcmfmac43455-sdio.txt
    lrwxrwxrwx  1 root root      22 Jul  6 09:37 brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt -> brcmfmac43455-sdio.txt
    lrwxrwxrwx  1 root root      22 Jul  6 09:37 brcmfmac43455-sdio.raspberrypi,4-model-b.txt -> brcmfmac43455-sdio.txt
    -rw-r--r--  1 root root    2074 Jul  6 09:37 brcmfmac43455-sdio.txt
    -rw-r--r--  1 root root  495898 Jul  6 09:37 brcmfmac43456-sdio.bin
    -rw-r--r--  1 root root    7163 Jul  6 09:37 brcmfmac43456-sdio.clm_blob
    -rw-r--r--  1 root root    2053 Jul  6 09:37 brcmfmac43456-sdio.txt
    -rw-r--r--  1 root root  623304 Jul  6 09:37 brcmfmac4350c2-pcie.bin
    -rw-r--r--  1 root root  626140 Jul  6 09:37 brcmfmac4350-pcie.bin
    lrwxrwxrwx  1 root root      30 Jul  6 09:37 brcmfmac4354-sdio.bin -> ../cypress/cyfmac4354-sdio.bin
    lrwxrwxrwx  1 root root      35 Jul  6 09:37 brcmfmac4354-sdio.clm_blob -> ../cypress/cyfmac4354-sdio.clm_blob
    -rw-r--r--  1 root root  557056 Jul  6 09:37 brcmfmac43569.bin
    lrwxrwxrwx  1 root root      30 Jul  6 09:37 brcmfmac4356-pcie.bin -> ../cypress/cyfmac4356-pcie.bin
    lrwxrwxrwx  1 root root      35 Jul  6 09:37 brcmfmac4356-pcie.clm_blob -> ../cypress/cyfmac4356-pcie.clm_blob
    -rw-r--r--  1 root root    2515 Jul  6 09:37 brcmfmac4356-pcie.gpd-win-pocket.txt
    lrwxrwxrwx  1 root root      30 Jul  6 09:37 brcmfmac4356-sdio.bin -> ../cypress/cyfmac4356-sdio.bin
    lrwxrwxrwx  1 root root      35 Jul  6 09:37 brcmfmac4356-sdio.clm_blob -> ../cypress/cyfmac4356-sdio.clm_blob
    -rw-r--r--  1 root root    2610 Jul  6 09:37 brcmfmac4356-sdio.vamrs,rock960.txt
    lrwxrwxrwx  1 root root      31 Jul  6 09:37 brcmfmac43570-pcie.bin -> ../cypress/cyfmac43570-pcie.bin
    lrwxrwxrwx  1 root root      36 Jul  6 09:37 brcmfmac43570-pcie.clm_blob -> ../cypress/cyfmac43570-pcie.clm_blob
    -rw-r--r--  1 root root  633817 Jul  6 09:37 brcmfmac4358-pcie.bin
    -rw-r--r--  1 root root  595472 Jul  6 09:37 brcmfmac43602-pcie.ap.bin
    -rw-r--r--  1 root root  635449 Jul  6 09:37 brcmfmac43602-pcie.bin
    -rw-r--r--  1 root root 1105361 Jul  6 09:37 brcmfmac4366b-pcie.bin
    -rw-r--r--  1 root root 1120971 Jul  6 09:37 brcmfmac4366c-pcie.bin
    -rw-r--r--  1 root root  623448 Jul  6 09:37 brcmfmac4371-pcie.bin
    -rw-r--r--  1 root root  479232 Jul  6 09:37 brcmfmac4373.bin
    lrwxrwxrwx  1 root root      30 Jul  6 09:37 brcmfmac4373-sdio.bin -> ../cypress/cyfmac4373-sdio.bin
    lrwxrwxrwx  1 root root      35 Jul  6 09:37 brcmfmac4373-sdio.clm_blob -> ../cypress/cyfmac4373-sdio.clm_blob
    lrwxrwxrwx  1 root root      31 Jul  6 09:37 brcmfmac54591-pcie.bin -> ../cypress/cyfmac54591-pcie.bin
    lrwxrwxrwx  1 root root      36 Jul  6 09:37 brcmfmac54591-pcie.clm_blob -> ../cypress/cyfmac54591-pcie.clm_blob

In an attempt to use the same firmware I have updated the /lib/firmware/brcm to look like below

-rw-r--r--    1 root     root  397312 Sep 27 11:45 brcmfmac43143.bin
-rw-r--r--    1 root     root  348160 Sep 27 11:45 brcmfmac43236b.bin
lrwxrwxrwx    1 root     root      31 Jul  6 09:37 brcmfmac43430-sdio.bin -> ../cypress/cyfmac43430-sdio.bin
lrwxrwxrwx    1 root     root      36 Jul  6 09:37 brcmfmac43430-sdio.clm_blob -> ../cypress/cyfmac43430-sdio.clm_blob
lrwxrwxrwx    1 root     root      22 Jul  6 09:37 brcmfmac43430-sdio.raspberrypi,3-model-b.txt -> brcmfmac43430-sdio.txt
-rw-r--r--    1 root     root    1121 Jul  6 09:37 brcmfmac43430-sdio.txt
-rw-r--r--    1 root     root  382455 Sep 27 11:45 brcmfmac43430a0-sdio.bin
lrwxrwxrwx    1 root     root      31 Jul  6 09:37 brcmfmac43455-sdio.bin -> ../cypress/cyfmac43455-sdio.bin
lrwxrwxrwx    1 root     root      36 Jul  6 09:37 brcmfmac43455-sdio.clm_blob -> ../cypress/cyfmac43455-sdio.clm_blob
lrwxrwxrwx    1 root     root      22 Jul  6 09:37 brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt -> brcmfmac43455-sdio.txt
-rw-r--r--    1 root     root    2074 Jul  6 09:37 brcmfmac43455-sdio.txt

This has changed the issue, the station interface would flip-flop up and down every 10 seconds using the brcm firmware. Using the new cypress firmware both interfaces AP and STA will go into a down state, and refuse to come up. On disabling either interface using uci the other would come up and start working.

This is the information about the firmware being loaded in both setups.

OPENWRT
[    7.821337] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[    7.834432] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.bin failed with error -2
[    7.849620] brcmfmac mmc1:0001:1: Falling back to sysfs fallback for: brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.bin
[    8.058461] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[    8.077693] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Mar 30 2021 01:12:21 version 7.45.98.118 (7d96287 CY) FWID 01-32059766
[    8.116608] usbcore: registered new interface driver brcmfmac

RPI
[   11.445570] brcmfmac: F1 signature read @0x18000000=0x1541a9a6
[   11.460491] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   11.460834] usbcore: registered new interface driver brcmfmac
[   11.566878] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43430-sdio.raspberrypi,3-model-b.bin failed with error -2
[   11.900614] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   11.900819] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43430-sdio for chip BCM43430/1
[   11.914363] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/1 wl0: Jul 19 2021 03:24:18 version 7.45.98 (TOB) (56df937 CY) FWID 01-8e14b897
[   15.014655] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled

I have tried to add the cypress firmware through make menuconfig, however it is not included in the diffconfig or the final image.

How can I add the cypress firmware to the image, can I manually copy them over from RPI or do they have to be build-in to the OpenWrt image?

I have gotten this solved, by simply moving to the master branch of OpenWrt. I had tried to copy the kernel modules from a similar kernel, but it did not work 100%. I suspect because I did not copy the compat.ko module over could have been the reason,

I am trying to find out what changed, that it is working on the master branch of OpenWrt, I'm new to this so I'm not sure what terms I should be watching out for in the release notes, any ideas @slh

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