Raspberry Pi Zero 2 W / HAOS 8.5 -> 9.x

Hi,

I run HomeAssistant for some years, but as I had no problems, I didn’t sign up to the forum earlier.
I’m using Raspberry Pi Zero 2 W running HAOS. I know, it is strongly discouraged, but it’s perfect for my taste: strong enough to handle my automation needs for 4 HVAC devices via MQTT.

I have no issues running HAOS 8.5, but upgrading to 9.x broke the network connections. I suspect the cause is the firmware blob bundled in the OS image.

Here are some details from 8.5 (sorry for the long quotes…):

dmesg | grep brcm
[    7.615338] brcmfmac: F1 signature read @0x18000000=0x1542a9a6
[    7.634232] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436-sdio for chip BCM43430/2
[    7.641234] usbcore: registered new interface driver brcmfmac
[    7.651978] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43436-sdio.raspberrypi,model-zero-2-w.bin failed with error -2
[    7.847984] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436-sdio for chip BCM43430/2
[    7.978963] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436-sdio for chip BCM43430/2
[    8.026870] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/2 wl0: Oct  9 2020 14:44:32 version 9.88.4.65 (test) (f149b32@shgit)  (r679549) FWID 01-f40f3270
[   16.566153] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
ls -la /lib/firmware/brcm/brcmfmac4343*
lrwxrwxrwx    1 root     root            31 Aug 16 13:43 brcmfmac43430-sdio.bin -> ../cypress/cyfmac43430-sdio.bin
lrwxrwxrwx    1 root     root            36 Aug 16 13:43 brcmfmac43430-sdio.clm_blob -> ../cypress/cyfmac43430-sdio.clm_blob
lrwxrwxrwx    1 root     root            22 Aug 16 13:33 brcmfmac43430-sdio.raspberrypi,3-model-b.txt -> brcmfmac43430-sdio.txt
lrwxrwxrwx    1 root     root            44 Aug 16 13:43 brcmfmac43430-sdio.raspberrypi,model-zero-w.txt -> brcmfmac43430-sdio.raspberrypi,3-model-b.txt
-rw-r--r--    1 root     root          1121 Aug 16 13:33 brcmfmac43430-sdio.txt
-rw-r--r--    1 root     root        413934 Aug 16 13:33 brcmfmac43436-sdio.bin
-rw-r--r--    1 root     root         11209 Aug 16 13:33 brcmfmac43436-sdio.clm_blob
-rw-r--r--    1 root     root          1613 Aug 16 13:33 brcmfmac43436-sdio.txt
-rw-r--r--    1 root     root        428103 Aug 16 13:33 brcmfmac43436s-sdio.bin
-rw-r--r--    1 root     root          1092 Aug 16 13:33 brcmfmac43436s-sdio.txt
journalctl -b 0 -u NetworkManager
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.0062] device (wlan0): driver supports Access Point (AP) mode
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.0122] manager: (wlan0): new 802.11 Wi-Fi device (/org/freedesktop/NetworkManager/Devices/3)
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.0190] device (wlan0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.2703] device (wlan0): supplicant interface state: internal-starting -> disconnected
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.2707] device (wlan0): state change: unavailable -> disconnected (reason 'supplicant-available', sys-iface-state: 'managed')
Oct 29 08:04:08 homeassistant NetworkManager[353]: <warn>  [1667030648.2755] device (wlan0): wifi-scan: active scanning for networks due to profiles with wifi.hidden=yes. This makes you trackable
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.7885] policy: auto-activating connection 'rpi0-wifi' (3ecb3497-946d-302c-b7f6-da3a4dfae952)
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.7920] device (wlan0): Activation: starting connection 'rpi0-wifi' (3ecb3497-946d-302c-b7f6-da3a4dfae952)
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.7928] device (wlan0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.7956] manager: NetworkManager state is now CONNECTING
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.7983] device (wlan0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.8007] device (wlan0): Activation: (wifi) access point 'rpi0-wifi' has security, but secrets are required.
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.8009] device (wlan0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.8110] device (wlan0): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.8141] device (wlan0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.8185] device (wlan0): Activation: (wifi) connection 'rpi0-wifi' has security, and secrets exist.  No new secrets needed.
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.8196] Config: added 'ssid' value 'IOT-01011223'
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.8197] Config: added 'scan_ssid' value '1'
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.8197] Config: added 'bgscan' value 'simple:30:-70:86400'
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.8198] Config: added 'key_mgmt' value 'WPA-PSK'
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.8199] Config: added 'auth_alg' value 'OPEN'
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.8199] Config: added 'psk' value '<hidden>'
Oct 29 08:04:08 homeassistant NetworkManager[353]: <info>  [1667030648.8832] device (wlan0): supplicant interface state: disconnected -> associating
Oct 29 08:04:09 homeassistant NetworkManager[353]: <info>  [1667030649.4689] device (wlan0): supplicant interface state: associating -> 4way_handshake
Oct 29 08:04:09 homeassistant NetworkManager[353]: <info>  [1667030649.4779] device (wlan0): supplicant interface state: 4way_handshake -> completed
Oct 29 08:04:09 homeassistant NetworkManager[353]: <info>  [1667030649.4781] device (wlan0): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Connected to wireless network "IOT-01011223"
Oct 29 08:04:09 homeassistant NetworkManager[353]: <info>  [1667030649.4790] device (wlan0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Oct 29 08:04:09 homeassistant NetworkManager[353]: <info>  [1667030649.4915] dhcp4 (wlan0): activation: beginning transaction (timeout in 45 seconds)
Oct 29 08:04:09 homeassistant NetworkManager[353]: <info>  [1667030649.5135] dhcp4 (wlan0): state changed unknown -> bound, address=192.168.5.2
Oct 29 08:04:09 homeassistant NetworkManager[353]: <info>  [1667030649.5227] device (wlan0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')

And the same from 9.3:

dmesg | grep brcm
[    7.205760] brcmfmac: F1 signature read @0x18000000=0x1542a9a6
[    7.240063] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436-sdio for chip BCM43430/2
[    7.254745] usbcore: registered new interface driver brcmfmac
[    7.262279] brcmfmac mmc1:0001:1: Direct firmware load for brcm/brcmfmac43436-sdio.raspberrypi,model-zero-2-w.bin failed with error -2
[    7.462572] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436-sdio for chip BCM43430/2
[    7.469820] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43436-sdio for chip BCM43430/2
[    7.498473] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM43430/2 wl0: Mar 31 2022 17:24:51 version 9.88.4.77 (g58bc5cc) FWID 01-3b307371
[   12.140220] brcmfmac: brcmf_cfg80211_set_power_mgmt: power save enabled
[   69.595100] ieee80211 phy0: brcmf_escan_timeout: timer expired
[  126.555091] ieee80211 phy0: brcmf_escan_timeout: timer expired
ls -la /lib/firmware/brcm/brcmfmac4343*
lrwxrwxrwx    1 root     root            31 Oct 20  2022 brcmfmac43430-sdio.bin -> ../cypress/cyfmac43430-sdio.bin
lrwxrwxrwx    1 root     root            36 Oct 20  2022 brcmfmac43430-sdio.clm_blob -> ../cypress/cyfmac43430-sdio.clm_blob
lrwxrwxrwx    1 root     root            22 Oct 20  2022 brcmfmac43430-sdio.raspberrypi,3-model-b.txt -> brcmfmac43430-sdio.txt
lrwxrwxrwx    1 root     root            44 Oct 20  2022 brcmfmac43430-sdio.raspberrypi,model-zero-w.txt -> brcmfmac43430-sdio.raspberrypi,3-model-b.txt
-rw-r--r--    1 root     root          1121 Oct 20  2022 brcmfmac43430-sdio.txt
-rw-r--r--    1 root     root        416101 Oct 20  2022 brcmfmac43436-sdio.bin
-rw-r--r--    1 root     root         11209 Oct 20  2022 brcmfmac43436-sdio.clm_blob
-rw-r--r--    1 root     root          1613 Oct 20  2022 brcmfmac43436-sdio.txt
-rw-r--r--    1 root     root        436733 Oct 20  2022 brcmfmac43436s-sdio.bin
-rw-r--r--    1 root     root          1092 Oct 20  2022 brcmfmac43436s-sdio.txt
journalctl -b 0 -u NetworkManager
Jun 02 18:09:22 homeassistant NetworkManager[349]: <info>  [1654193362.4639] device (wlan0): driver supports Access Point (AP) mode
Jun 02 18:09:22 homeassistant NetworkManager[349]: <info>  [1654193362.4687] manager: (wlan0): new 802.11 Wi-Fi device (/org/freedesktop/NetworkManager/Devices/2)
Jun 02 18:09:22 homeassistant NetworkManager[349]: <info>  [1654193362.4930] device (wlan0): state change: unmanaged -> unavailable (reason 'managed', sys-iface-state: 'external')
Jun 02 18:09:22 homeassistant NetworkManager[349]: <info>  [1654193362.7462] device (wlan0): supplicant interface state: internal-starting -> disconnected
Jun 02 18:09:22 homeassistant NetworkManager[349]: <info>  [1654193362.7468] device (wlan0): state change: unavailable -> disconnected (reason 'supplicant-available', sys-iface-state: 'managed')
(...)
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6635] policy: auto-activating connection 'IOT-01011223' (5f3f190e-6ff2-4b69-b959-ffe69cb8f77b)
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6687] device (wlan0): Activation: starting connection 'IOT-01011223' (5f3f190e-6ff2-4b69-b959-ffe69cb8f77b)
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6702] device (wlan0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6730] manager: NetworkManager state is now CONNECTING
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6760] device (wlan0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6786] device (wlan0): Activation: (wifi) access point 'IOT-01011223' has security, but secrets are required.
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6789] device (wlan0): state change: config -> need-auth (reason 'none', sys-iface-state: 'managed')
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6877] device (wlan0): state change: need-auth -> prepare (reason 'none', sys-iface-state: 'managed')
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6909] device (wlan0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6940] device (wlan0): Activation: (wifi) connection 'IOT-01011223' has security, and secrets exist.  No new secrets needed.
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6943] Config: added 'ssid' value 'IOT-01011223'
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6945] Config: added 'scan_ssid' value '1'
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6945] Config: added 'bgscan' value 'simple:30:-70:86400'
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6946] Config: added 'key_mgmt' value 'WPA-PSK'
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6947] Config: added 'auth_alg' value 'OPEN'
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.6949] Config: added 'psk' value '<hidden>'
Jun 02 19:58:41 homeassistant NetworkManager[349]: <info>  [1654199921.7819] device (wlan0): supplicant interface state: disconnected -> associating
Jun 02 19:58:42 homeassistant NetworkManager[349]: <info>  [1654199922.4073] device (wlan0): supplicant interface state: associating -> completed
Jun 02 19:58:42 homeassistant NetworkManager[349]: <info>  [1654199922.4075] device (wlan0): Activation: (wifi) Stage 2 of 5 (Device Configure) successful. Connected to wireless network "IOT-01011223"
Jun 02 19:58:42 homeassistant NetworkManager[349]: <info>  [1654199922.4085] device (wlan0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Jun 02 19:58:42 homeassistant NetworkManager[349]: <info>  [1654199922.4207] dhcp4 (wlan0): activation: beginning transaction (timeout in 45 seconds)
Jun 02 19:59:27 homeassistant NetworkManager[349]: <warn>  [1654199967.8466] dhcp4 (wlan0): request timed out
Jun 02 19:59:27 homeassistant NetworkManager[349]: <info>  [1654199967.8468] dhcp4 (wlan0): state changed unknown -> timeout
Jun 02 19:59:27 homeassistant NetworkManager[349]: <info>  [1654199967.8470] device (wlan0): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
Jun 02 19:59:27 homeassistant NetworkManager[349]: <info>  [1654199967.8486] manager: NetworkManager state is now DISCONNECTED

The only difference I see is the firmware loaded. And it seems to be working (the device has been found and associated), but cannot get IP address from the AP. I cannot change the firmware file (or create link to the proper one) because the squashfs is read-only.

Could you please help me, how to fix it?

Thank you in advance!
TiceRex

According to the official Raspberry Pi sources the file brcm/brcmfmac43436-sdio or brcm/brcmfmac43436s-sdio (depending on hardware revision) should be loaded in case of Raspberry Pi Zero 2 W.
(And brcm/brcmfmac43430-sdio in case of Raspberry Pi 3+, on which the HAOS image based on.)

As far as I can see HAOS buildroot gathers the Raspberry Pi base kernel from here. It’s way beyond my knowledge to judge if it’s the error in the sources or in HAOS buildroot… :frowning:

I confirm the issue, same problem for me with Zero 2W trying to make now a fresh installation with 9.3.
I can see the Mac address of the zero 2W on my router network but HA cannot connect showing:

ieee80211 phy0: brcmf_escan_timeout: timer expired

That’s my problem. I have been suffering from it for days. I can’t find a solution. I haven’t seen the problem on other forums. Do some of us have an exceptional problem?

Thank you for the confirmation.

I guess the official way to handle this problem would be to raise an issue at the HAOS Github page, but I would not expect any answer there as the Raspberry Pi Zero 2W is not supported at all. :frowning:

We should be grateful to be able to run the Pi3+ image (up to v8.5) on Zero2W.

EDIT: I’ve raised an issue:
https://github.com/home-assistant/operating-system/issues/2220

My English is bad. Thank you for doing it. I’m really looking forward to the solution.

Hey guys! No, I didn’t give up! I don’t believe it either, but… I changed the wifi channel of the AP for another reason, and I can see that ping is working. It’s interesting that if I reset the wifi to the channel before the update, the ping doesn’t work. I’ve done the back and forth twice and the result is always the same. Then… After the third change, I get error messages. I can’t always produce the error messages, the ping simply didn’t work. I changed the channel many times, after which he finally revealed the protein in his teeth. Maybe there’s a problem here. If there is an error message, then the dice are already cast, the only option is to restart. Unfortunately, after restarting, you have to change the channel again to have a ping. After more than three weeks of trying, this is the first positive change that I can show you. I don’t know what’s going on, I’m waiting for the answer from the “smart people”! This is how it works for me now, I don’t have to reinstall! I hope this helps someone else temporarily!
The error message:


After the error message in nmcli:

Sorry, I don’t get it… Could you please share the AP settings you’ve tried?
What was the wifi channel before the changes, and what is it now?

However, I have doubts it could be the reason. The connection is established between the HA and the AP, only the IP assignment fails. The wifi channel settings are not relevant at this stage.
Besides, with HAOS v.8.5 it works on every wifi channel.

EDIT: I’ve tried all the available 2.4 GHz wifi channels (1-14), I cannot make it work. The error message is the same.

Ok Sir, I’m sorry, I stand corrected! The accidental success happens with an Aruba AP11. I tried with the other local APs (TP-LINK, MIKROTIK, ASUS) and it really, unfortunately, doesn’t work. If Aruba and the original channel are eg 6, I switch to 1, success. If I restart it, I set channel back to 6, not good. If I turn 11 then, it’s ok again. Unfortunately, it cannot be calculated. The Zero 2W really does not connect with other APs.

As HassOS 9.4 is out, I tried it.
Unfortunately there’s no change here, it still can’t connect to wifi network.

Do you know how to downgrade to 9.3? I have issues with 9.4

@Tyfoon Could you please tell me how does it relate to the bug in this thread?

You can find the current and all the previous versions here.