Skip to content

Commit 30f3244

Browse files
authored
Add Wi-Fi scan readiness check and apply country code before connection (#2093)
Signed-off-by: Markus Schraufstetter <[email protected]>
1 parent b1d4c14 commit 30f3244

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

build-image/first-boot.bash

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ if is_trixie || is_bookworm && is_pi; then # attention no brackets => left-assoc
107107
systemctl enable --now NetworkManager
108108
nmcli g
109109
nmcli r wifi on
110+
111+
# Wait until Wi-Fi scan results become available
112+
echo "$(timestamp) [openHABian] Waiting for Wi-Fi scan readiness..."
113+
tryUntil "nmcli -t -f SSID dev wifi | grep -q ." 10 3
114+
115+
# Apply Wi-Fi country code once Wi-Fi subsystem is ready
116+
if [[ -n "$wifi_country" ]]; then
117+
raspi-config nonint do_wifi_country "$wifi_country"
118+
fi
110119

111120
if [[ -n $wifiSSID ]]; then
112121
# Setup WiFi via NetworkManager

0 commit comments

Comments
 (0)