From 6fea68f903ae2e2f26df9702e9317b8a022c3c4f Mon Sep 17 00:00:00 2001 From: Timothy Hofland Date: Sun, 15 Mar 2026 23:56:38 +0100 Subject: [PATCH] fix: force NetworkManager hotspot priority and disconnect active client wifi to ensure AP activation --- scripts/setup.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/setup.sh b/scripts/setup.sh index e9e66b1..29bba51 100644 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -142,6 +142,9 @@ rfkill unblock wlan || true if command -v nmcli > /dev/null; then echo "NetworkManager detected. Using nmcli for hotspot..." + # Disconnect current wifi to free the radio + nmcli device disconnect wlan0 2>/dev/null || true + # Clean up any existing MPVJ connection nmcli con delete MPVJ-AP 2>/dev/null || true @@ -151,8 +154,12 @@ if command -v nmcli > /dev/null; then nmcli con modify MPVJ-AP wifi-sec.key-mgmt wpa-psk nmcli con modify MPVJ-AP wifi-sec.psk "$WIFI_PASS" nmcli con modify MPVJ-AP ipv4.addresses 192.168.4.1/24 + nmcli con modify MPVJ-AP connection.autoconnect-priority 100 - # Ensure hostapd/dnsmasq are disabled to prevent conflict + # Bring it up immediately + nmcli con up MPVJ-AP || true + + # Ensure hostapd/dnsmasq are disabled systemctl stop hostapd dnsmasq 2>/dev/null || true systemctl disable hostapd dnsmasq 2>/dev/null || true systemctl mask hostapd dnsmasq 2>/dev/null || true