Skip to content

Commit 8d34d1b

Browse files
committed
network/tasks/main.yml: WARN if WiFi firmware crashed since boot
1 parent 70515bb commit 8d34d1b

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# 2025-03-31: WiFi firmware was crashing OFTEN in roles/network/tasks/NM-debian.yml
2+
# so let's help everyone better monitor in future, on RPi or elsewhere.
3+
# Extensive March 2025 testing summarized in roles/network/tasks/main.yml
4+
# (just below NM-debian.yml) and at https://github.com/iiab/iiab/pull/3965
5+
6+
7+
- name: Did WiFi firmware crash since boot? Run 'ls /sys/class/ieee80211/ | head -1' to check
8+
shell: ls /sys/class/ieee80211/ | head -1
9+
register: phyname
10+
failed_when: False # Stronger than 'ignore_errors: yes' (defer red errors until below!)
11+
12+
- name: Did WiFi firmware crash since boot? Run '! dmesg | grep "Firmware has halted or crashed"' to check
13+
shell: '! dmesg | grep "Firmware has halted or crashed"'
14+
register: dmesg_fw_crash
15+
failed_when: False
16+
17+
18+
- name: WARN if WiFi firmware appears to have crashed since boot (intentionally show red error)
19+
fail:
20+
msg: "WARNING: /sys/class/ieee80211/{{ phyname.stdout }} (normally phy0) SUGGESTS YOUR WIFI FIRMWARE CRASHED SINCE BOOT."
21+
when: phyname.stdout != "phy0"
22+
ignore_errors: yes
23+
24+
- name: WARN if WiFi firmware appears to have crashed since boot (intentionally show red error)
25+
fail:
26+
msg: "WARNING: dmesg SHOWS WIFI FIRMWARE CRASH(ES) SINCE BOOT... {{ dmesg_fw_crash.stdout }}"
27+
when: dmesg_fw_crash.rc != 0
28+
ignore_errors: yes
29+
30+
31+
- fail: # Also intentionally red, with a 1 minute pause below, for extra emphasis
32+
msg: "PLEASE CONSIDER: (1) adding 'brcmfmac.debug=0x100000' to /boot/firmware/cmdline.txt (and then reboot) to provide much more logging, (2) running 'sudo iiab-diagnostics' to submit a bug report, (3) reading https://github.com/iiab/iiab/pull/3965 to learn more."
33+
when: phyname.stdout != "phy0" or dmesg_fw_crash.rc != 0
34+
ignore_errors: yes
35+
36+
- pause:
37+
minutes: 1
38+
when: phyname.stdout != "phy0" or dmesg_fw_crash.rc != 0

roles/network/tasks/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@
110110
name: firmware
111111
when: rpi_model != "none"
112112

113+
- name: "2025-03-31: WiFi firmware was crashing OFTEN in NM-debian.yml above, so let's help everyone better monitor in future, on RPi or elsewhere"
114+
include_tasks: roles/firmware/tasks/warn_fw_crash.yml
115+
113116

114117
- name: Create {{ iiab_etc_path }}/install-flags/iiab-network-complete on second pass of network role
115118
file:

0 commit comments

Comments
 (0)