0

I've got a Zero 2W running up-to-date Raspian (bullseye) and homeassistant Core.

After 6 hours (give or take a minute, but pretty exactly) of runtime, the on-board wifi crashes and does not reconnect. This happens regardless of traffic, for example in the middle of the night. Does anyone have any idea what can cause this?

I have tried using a cronjob to restart the wifi on connection loss ifconfig wlan0 down and ifconfig wlan0 up, but that just returns a device not found. I can restore wifi by rebooting, however - which i currently do via a cronjob.

The system is running headless on a 2.5A power supply, and except for a zigbee stick, nothing is connected.

I see this in the syslog at the time of the crash:

Aug 14 14:45:12 raspberrypi dhcpcd[526]: wlan0: carrier lost
Aug 14 14:45:12 raspberrypi dhcpcd[526]: wlan0: deleting route to 192.168.178.0/24
Aug 14 14:45:12 raspberrypi dhcpcd[526]: wlan0: deleting default route via 192.168.178.1
Aug 14 14:45:13 raspberrypi kernel: [22195.676958] ieee80211 phy0: brcmf_fw_crashed: Firmware has halted or crashed
Aug 14 14:45:14 raspberrypi kernel: [22195.764124] ieee80211 phy0: brcmf_fil_cmd_data: bus is down. we have nothing to do.
Aug 14 14:45:14 raspberrypi kernel: [22195.764161] ieee80211 phy0: brcmf_cfg80211_get_tx_power: error (-5)
Aug 14 14:45:14 raspberrypi dhcpcd[526]: wlan0: removing interface
Aug 14 14:45:14 raspberrypi systemd[1]: Starting Load/Save RF Kill Switch Status...
Aug 14 14:45:14 raspberrypi systemd[1]: Started Load/Save RF Kill Switch Status.
Aug 14 14:45:14 raspberrypi kernel: [22196.435638] brcmfmac: brcmf_sdiod_probe: Failed to set F1 blocksize
Aug 14 14:45:14 raspberrypi kernel: [22196.435690] brcmfmac: brcmf_sdio_bus_reset: Failed to probe after sdio device reset: ret -123
Aug 14 14:45:14 raspberrypi kernel: [22196.436193] mmc1: card 0001 removed
Aug 14 14:45:14 raspberrypi dhcpcd-run-hooks[3958]: wlan0: stopping wpa_supplicant
Aug 14 14:45:14 raspberrypi kernel: [22196.512507] mmc1: queuing unknown CIS tuple 0x07 [65 c5 85 5c 0a 44 da 6d ff 0a 02 1a 37 50 00 bc 3c 80 57 18 97 e4 03 d0 25 bc 80 ff 0d ba c0 86 0c ff 6a 35 7b ff b0 7a b9 40 ff 8e b8 19 0a 80 00 f6 00 ff ff e7 00 b8 46 d5 a2 ff 27 4c f1 00] (121 bytes)
Aug 14 14:45:14 raspberrypi kernel: [22196.513929] mmc1: new high speed SDIO card at address 0001
Aug 14 14:45:19 raspberrypi systemd[1]: systemd-rfkill.service: Succeeded.

My /etc/dhcpcd.conf looks like this:

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

Inform the DHCP server of our hostname for DDNS.

hostname

Use the hardware address of the interface for the Client ID.

clientid

or

Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.

Some non-RFC compliant DHCP servers do not reply with this set.

In this case, comment out duid and enable clientid above.

#duid

Persist interface configuration when dhcpcd exits.

persistent

Rapid commit support.

Safe to enable by default because it requires the equivalent option set

on the server to actually work.

option rapid_commit

A list of options to request from the DHCP server.

option domain_name_servers, domain_name, domain_search, host_name option classless_static_routes

Respect the network MTU. This is applied to DHCP routes.

option interface_mtu

Most distributions have NTP support.

#option ntp_servers

A ServerID is required by RFC2131.

require dhcp_server_identifier

Generate SLAAC address using the Hardware Address of the interface

#slaac hwaddr

OR generate Stable Private IPv6 Addresses based from the DUID

slaac private

Example static IP configuration:

interface wlan0 static ip_address=192.168.178.56/24 #static ip6_address=fd51:42f8:caae:d92e::ff/64 static routers=192.168.178.1 static domain_name_servers=8.8.8.8

It is possible to fall back to a static IP if DHCP fails:

define static profile

#profile static_eth0 #static ip_address=192.168.1.23/24 #static routers=192.168.1.1 #static domain_name_servers=192.168.1.1

fallback to static profile on eth0

#interface eth0 #fallback static_eth0

I searched for this problem and most error messages, but nothing helpful came up. Any help will be highly appreciated!

Tim
  • 161
  • 5
  • Do you have a second sd card? If so, burn the system on that card from scratch. Download the image again, and make the changes to boot headless. If you find any differences, please edit your question to show them. – NomadMaker Aug 15 '22 at 16:42

1 Answers1

1

So, I reinstalled Raspian from scratch, and ran into a similar problem again - dhcpcd reporting wlan0: carrier lost and then crashing or failing to renew a DHCP license. I finally fixed the problem by disabling wifi power saving on startup (discussed e.g. here) by appending
/sbin/iwconfig wlan0 power off to /etc/rc.local before the line exit 0.

Tim
  • 161
  • 5