Software for Pi Zero 2 W

waking up the dead…

So…

  • I understand, as of now, there is no OpenWRT image for the Raspberry Zero 2, because the proprietary Wifi blob for the Zero 2 has not been open sourced by Raspberry Pi foundation yet, and for very unknown reasons the foundation so far shows zero interest, to do so (unlike for all other Raspberry Pi types), just because they can.
  • I can furthermore see that there is so far no prebuild image in OpenWRT releases or main generated for this reason. The device seems to be there prepared in the repo, but I guess as source-only?

But: could the OpenWRT image maybe be activated to generate images without that damn WiFi blob??

As OpenWRT has quite some other devices, where uses either have to live without the builtin proprietary WiFi or where users have to manually copy around some proprietary blob files afterwards, to enable the builtin WiFi (as described in the git Url mentioned in the previous posts)

Couldn‘t we treat the zero 2 device with the same No-Wifi-image-compromise? Or am i not seeing another important problem here?

1 Like

I run the normal rPi 3 image on zero2w and its what you talked about, a no-wifi image.

Now the real questions is for @stintel . I have followed the discussions over the years but I dont remember what was the trick to make wifi work after installing openwrt. I never really needed the build-in wifi.

@stintel if you have 5 mins to spare can you let us know how we can get the wifi working from an latest stable image?

Instructions are in the commit message. https://git.openwrt.org/e9f9cd14cc71826957877999fd063dd080de4751

1 Like

much appreciated!

EDIT: Ill answer my silly question :slight_smile: zero2w is a 2.4g only RF :slight_smile:
I also added some links (ln- s)

-rw-r--r--    1 root     root        416101 Oct 18 13:31 brcmfmac43436-sdio.bin
-rw-r--r--    1 root     root         11209 Oct 18 14:04 brcmfmac43436-sdio.clm_blob
lrwxrwxrwx    1 root     root            22 Oct 18 13:57 brcmfmac43436-sdio.raspberrypi,model-zero-2-w.bin -> brcmfmac43436-sdio.bin
lrwxrwxrwx    1 root     root            27 Oct 18 14:05 brcmfmac43436-sdio.raspberrypi,model-zero-2-w.clm_blob -> brcmfmac43436-sdio.clm_blob
lrwxrwxrwx    1 root     root            22 Oct 18 13:58 brcmfmac43436-sdio.raspberrypi,model-zero-2-w.txt -> brcmfmac43436-sdio.txt
-rw-r--r--    1 root     root          1706 Oct 18 13:31 brcmfmac43436-sdio.txt

/ / / / /

I've got a 2.4 only "Cypress CYW43455 802.11b/g/n" after coping the 4 files. Is this what is expected?
I seem to get some error on boot and no 5ghz.

[    6.145901] usbcore: registered new interface driver mt7601u
[    6.171916] PPP generic driver version 2.4.2
[    6.178022] NET: Registered PF_PPPOX protocol family
[    6.199808] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436-sdio for chip BCM43430/2
[    6.211116] usbcore: registered new interface driver brcmfmac
[    6.219119] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43436-sdio.raspberrypi,model-zero-2-w.bin failed with error -2
[    6.234337] brcmfmac mmc1:0001:1: Falling back to sysfs fallback for: brcm/brcmfmac43436-sdio.raspberrypi,model-zero-2-w.bin
[    6.282065] usb 1-1.4: reset high-speed USB device number 4 using dwc_otg
[    6.306035] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43436-sdio.clm_blob failed with error -2
[    6.319456] brcmfmac mmc1:0001:1: Falling back to sysfs fallback for: brcm/brcmfmac43436-sdio.clm_blob
[    6.431878] brcmfmac: brcmf_c_process_clm_blob: no clm_blob available (err=-2), device may have limited channels available
[    6.446776] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/2 wl0: Mar 31 2022 17:24:51 version 9.88.4.77 (g58bc5cc) FWID 01-3b307371
root@OpenWrt:/lib/firmware/brcm# ls -la
drwxr-xr-x    2 root     root          4096 Oct 18 13:31 .
drwxr-xr-x    6 root     root          4096 Oct  9 21:45 ..
-rw-r--r--    1 root     root        397312 Oct  9 21:45 brcmfmac43143.bin
-rw-r--r--    1 root     root        348160 Oct  9 21:45 brcmfmac43236b.bin
-rw-r--r--    1 root     root           875 Oct  9 21:45 brcmfmac43430-sdio.AP6212.txt
-rw-r--r--    1 root     root           928 Oct  9 21:45 brcmfmac43430-sdio.Hampoo-D2D3_Vi8A1.txt
-rw-r--r--    1 root     root           831 Oct  9 21:45 brcmfmac43430-sdio.MUR1DX.txt
lrwxrwxrwx    1 root     root            29 Oct  9 21:45 brcmfmac43430-sdio.beagle,beaglev-starlight-jh7100-a1.txt -> brcmfmac43430-sdio.AP6212.txt
lrwxrwxrwx    1 root     root            29 Oct  9 21:45 brcmfmac43430-sdio.beagle,beaglev-starlight-jh7100-r0.txt -> brcmfmac43430-sdio.AP6212.txt
lrwxrwxrwx    1 root     root            31 Oct  9 21:45 brcmfmac43430-sdio.bin -> ../cypress/cyfmac43430-sdio.bin
lrwxrwxrwx    1 root     root            36 Oct  9 21:45 brcmfmac43430-sdio.clm_blob -> ../cypress/cyfmac43430-sdio.clm_blob
lrwxrwxrwx    1 root     root            29 Oct  9 21:45 brcmfmac43430-sdio.friendlyarm,nanopi-r1.txt -> brcmfmac43430-sdio.AP6212.txt
-rw-r--r--    1 root     root           874 Oct  9 21:45 brcmfmac43430-sdio.raspberrypi,3-model-b.txt
lrwxrwxrwx    1 root     root            44 Oct  9 21:45 brcmfmac43430-sdio.raspberrypi,model-zero-2-w.txt -> brcmfmac43430-sdio.raspberrypi,3-model-b.txt
lrwxrwxrwx    1 root     root            44 Oct  9 21:45 brcmfmac43430-sdio.raspberrypi,model-zero-w.txt -> brcmfmac43430-sdio.raspberrypi,3-model-b.txt
lrwxrwxrwx    1 root     root            29 Oct  9 21:45 brcmfmac43430-sdio.sinovoip,bpi-m2-plus.txt -> brcmfmac43430-sdio.AP6212.txt
lrwxrwxrwx    1 root     root            29 Oct  9 21:45 brcmfmac43430-sdio.sinovoip,bpi-m2-ultra.txt -> brcmfmac43430-sdio.AP6212.txt
lrwxrwxrwx    1 root     root            29 Oct  9 21:45 brcmfmac43430-sdio.sinovoip,bpi-m2-zero.txt -> brcmfmac43430-sdio.AP6212.txt
lrwxrwxrwx    1 root     root            29 Oct  9 21:45 brcmfmac43430-sdio.sinovoip,bpi-m3.txt -> brcmfmac43430-sdio.AP6212.txt
lrwxrwxrwx    1 root     root            29 Oct  9 21:45 brcmfmac43430-sdio.starfive,visionfive-v1.txt -> brcmfmac43430-sdio.AP6212.txt
-rw-r--r--    1 root     root        416101 Oct 18 13:31 brcmfmac43436-sdio.bin
-rw-r--r--    1 root     root          1706 Oct 18 13:31 brcmfmac43436-sdio.txt
-rw-r--r--    1 root     root        442211 Oct 18 13:31 brcmfmac43436s-sdio.bin
-rw-r--r--    1 root     root          1185 Oct 18 13:31 brcmfmac43436s-sdio.txt
-rw-r--r--    1 root     root          1475 Oct  9 21:45 brcmfmac43455-sdio.AW-CM256SM.txt
-rw-r--r--    1 root     root          2510 Oct  9 21:45 brcmfmac43455-sdio.MINIX-NEO Z83-4.txt
lrwxrwxrwx    1 root     root            44 Oct  9 21:45 brcmfmac43455-sdio.Raspberry Pi Foundation-Raspberry Pi 4 Model B.txt -> brcmfmac43455-sdio.raspberrypi,4-model-b.txt
lrwxrwxrwx    1 root     root            44 Oct  9 21:45 brcmfmac43455-sdio.Raspberry Pi Foundation-Raspberry Pi Compute Module 4.txt -> brcmfmac43455-sdio.raspberrypi,4-model-b.txt
-rw-r--r--    1 root     root          1723 Oct  9 21:45 brcmfmac43455-sdio.acepc-t8.txt
lrwxrwxrwx    1 root     root            33 Oct  9 21:45 brcmfmac43455-sdio.beagle,am5729-beagleboneai.txt -> brcmfmac43455-sdio.AW-CM256SM.txt
lrwxrwxrwx    1 root     root            31 Oct  9 21:45 brcmfmac43455-sdio.bin -> ../cypress/cyfmac43455-sdio.bin
lrwxrwxrwx    1 root     root            36 Oct  9 21:45 brcmfmac43455-sdio.clm_blob -> ../cypress/cyfmac43455-sdio.clm_blob
lrwxrwxrwx    1 root     root            33 Oct  9 21:45 brcmfmac43455-sdio.pine64,pinebook-pro.txt -> brcmfmac43455-sdio.AW-CM256SM.txt
lrwxrwxrwx    1 root     root            33 Oct  9 21:45 brcmfmac43455-sdio.pine64,pinephone-pro.txt -> brcmfmac43455-sdio.AW-CM256SM.txt
lrwxrwxrwx    1 root     root            33 Oct  9 21:45 brcmfmac43455-sdio.pine64,quartz64-b.txt -> brcmfmac43455-sdio.AW-CM256SM.txt
lrwxrwxrwx    1 root     root            49 Oct  9 21:45 brcmfmac43455-sdio.raspberrypi,3-model-a-plus.txt -> brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt
-rw-r--r--    1 root     root          1884 Oct  9 21:45 brcmfmac43455-sdio.raspberrypi,3-model-b-plus.txt
lrwxrwxrwx    1 root     root            44 Oct  9 21:45 brcmfmac43455-sdio.raspberrypi,4-compute-module.txt -> brcmfmac43455-sdio.raspberrypi,4-model-b.txt
-rw-r--r--    1 root     root          1883 Oct  9 21:45 brcmfmac43455-sdio.raspberrypi,4-model-b.txt
root@OpenWrt:/lib/firmware/brcm#

Hi @daemonix !

I've got as far as your error in my build... so close! Can I check with you (if you remember of course) what you did to go from the scenario quoted to the folder structure in your edit (i.e. "where does the clm_blob file come from"?) ? Sorry for the noob-y question... I'm just so close to completing this project and this is the last piece in the puzzle!

i search all the filenames on GitHub. all the files missing are there.

check and if you need anything more post back.

1 Like

Thanks @daemonix - I was suspicious of it being that simple (i.e. that I needed to do / be aware of something else)... but no, you were spot on. I copied the 43436 clm_blob into the right place and boom - fixed.

I assume given your post you cleaned up the other drivers in /lib/firmware/brcm without any issue?

i left all files there as per my post. I dont think I did anything more.
I have an issue with the second wifi on the USB HAT.

I use the buildin wifi as AP and the USB wifi a Wifi-WAN but its slow.

I observed on pi zero that the CPU governor could impact on the network performance, check that the cpu governor is set to performance.

1 Like

Just tested with performance. I think its more stable in speedtests but I still get nothing (1-2mbit and sometimes nothing) then trying to use the build-in wifi as AP and a USB wifi as wwan. routing data from AP to WWAN is horrible.

Any ideas?

root@OpenWrt:~# lsusb
Bus 001 Device 004: ID 0bda:8152 Realtek USB 10/100 LAN
Bus 001 Device 003: ID 148f:5370 Ralink 802.11 n WLAN
Bus 001 Device 002: ID 1a40:0101  USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux 5.15.134 dwc_otg_hcd DWC OTG Controller
root@OpenWrt:~# iw phy1-sta0 info
Interface phy1-sta0
	ifindex 6
	wdev 0x100000002
	addr 2c:3f:4e:f3:b4:01
	ssid TestW
	type managed
	wiphy 1
	channel 1 (2412 MHz), width: 20 MHz, center1: 2412 MHz
	txpower 10.00 dBm
	multicast TXQ:
		qsz-byt	qsz-pkt	flows	drops	marks	overlmt	hashcol	tx-bytes	tx-packets
		0	0	0	0	0	0	0	0		0

root@OpenWrt:~# iw phy0-ap0 info
Interface phy0-ap0
	ifindex 2
	wdev 0x1
	addr e6:5f:11:25:3f:57
	ssid louk
	type AP
	wiphy 0
	channel 6 (2437 MHz), width: 20 MHz, center1: 2437 MHz
	txpower 31.00 dBm
root@OpenWrt:~#

I missed this:

The Pi Zero is not the ultimate performance solution, however I was trying to do time ago a similar thing like the one you are doing and yes, I saw similar things

On my case I was using the ubiquity wifistation ext via USB, with an USB hat, aswell the built-in wifi.

Some observations:

  • built-in + wifistation, both up, with different SSID was ok. Scope: built-in wifi as plan B as well to the domotic wifi devices I have at home (built-in wifi has @10 devices connected limitation), wifistation was used in this case as AP for the smartphones and laptops

  • Ralink wifi USB dongle, performance: confirmed to be poor.

Try other dongle, I recommend something based on atheros chip

the same ralink usb with a rPi3 (built-in AP on 5ghz and the ralink USB as WWAN) give me 20mbit up/down. Not bad. (EDIT: With cpu governor on perf I got 30mbit down routed)

Maybe its the USB/ETH hat? I remember that months ago I tested Ethernet to Ralink WWAN and it was better.

Ill test with a better Alfa wifi too.

the GPIO bus speed does not help.
I believe the RPI3 has a much better access and speed to the USB port, therefore you see an improvement there.

Are you using pi zero o pi zero 2? maybe you want to check if irqs are balanced.

pi zero 2 and I use this hat. No GPIO involved I think.

I see. So that hat does communicate via the usb port connected to the pi zero2?
Mine, is similar (if not the same) as this https://www.martview.com/rj45-network-port-usb-ethernet-hub-hat-for-raspberry-pi.html

I don't remember the original website where i bought it, but it is the same or identical too that one. But now, that i am thinking on it. I strongly believe mine communicates via the usb port too, so that could be the first bottleneck for performance.

Are you using different essid on the WiFis?
The channels are ok? I mean different enough and not interfering with other wireless around?
Are you treating 2.4ghz or 5ghz? No nat i guess, just pure routing in between wifis?
Lets see with the alfa once you test it.
Openwrt version?

openwrt 23.xx (latest). Clean 2.4ghz channels 1 and 6. I do simple NAT, its just the default openwrt setup, LAN->WAN.

Your hat is the same. v2.0 has the pins, its just link your "U" connector.

Yes, you are right.
I am on 22.03.05, without plans to do an upgrade.

I believe the lack of performance is a mix of USB bus limitation + ralink dongle.
I did nat with built-in wifi for the lan and a 2x huawei 4G dongle on the wan with mwan3 doing load balancing. The performance was acceptable for the environment here. 20mpbs up and down +-

Maybe you can win some performance with...
sysctl -w net.ipv4.tcp_slow_start_after_idle=0
sysctl -w net.ipv4.tcp_rmem='8192 131072 3530272'
sysctl -w net.ipv4.tcp_wmem='8192 131072 3530272'

I noticed that it was an improvement on my setup
Also you can also change the congestion control to bbr which should also add some extra speed
For the CPU governor be aware that you need to alter each CPU individually

echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor

wifi to ethernet is the same low performance?

just tested ETH to Ralink and its full speed. 40 down 30 up.
Ill exchange the built-in wifi with another ralink and see if that helps.
My original setup was with 2 ralink USB but I remember it was bad.

Edit: with Eth->Ralink latency is also smooth during speedtests. built-in->ralink latency was crazy...

ralink-AP to ralink-client does 20mbit down (perfect latency fluctuation) and 8mbit up with crazy latency...

Im puzzled.