net: swap WiFi roles — fast T3U (wlan1) hosts AP, onboard (wlan0) carries uplink
- yaris_uplink.py: PRIMARY_INTERFACE=wlan0, AP_INTERFACE=wlan1, AP_CONNECTION=Hotspot-local - install_netwatch.sh: WLAN=wlan0, WLAN_FB=wlan1, AP on wlan1 - _ap_client_count() reads the AP interface instead of hardcoded wlan0
This commit is contained in:
@@ -7,13 +7,15 @@
|
||||
# already exist (see PLAN.md Phase 6). The optional "phone-hotspot" profile is
|
||||
# created through the Settings page.
|
||||
#
|
||||
# Since Phase 23+: all WiFi traffic (hotspot AP, phone client, home client)
|
||||
# runs on wlan1 (TP-Link T3U dongle). wlan0 (onboard) is disabled.
|
||||
# Since 2026-08-12: the fast TP-Link T3U (wlan1) hosts the in-car AP
|
||||
# ("Hotspot-local"), while the onboard BCM43438 (wlan0) carries the internet
|
||||
# uplink (home-wifi / phone-hotspot).
|
||||
set -euo pipefail
|
||||
|
||||
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
WLAN=wlan1 # T3U dongle — change to wlan0 if reverting to onboard
|
||||
WLAN_FB=wlan0 # onboard fallback
|
||||
WLAN=wlan0 # onboard — internet uplink
|
||||
WLAN_FB=wlan1 # T3U — uplink fallback
|
||||
AP_IFACE=wlan1 # T3U — hosts the in-car AP
|
||||
|
||||
sudo systemctl stop yaris-uplink-wait.service 2>/dev/null || true
|
||||
sudo systemctl stop yaris-netwatch.timer yaris-netwatch.service 2>/dev/null || true
|
||||
@@ -26,10 +28,11 @@ sudo install -m 644 "$REPO_DIR/deploy/yaris-hotspot-dns.conf" \
|
||||
sudo install -m 755 "$REPO_DIR/deploy/90-yaris-uplink" \
|
||||
/etc/NetworkManager/dispatcher.d/90-yaris-uplink
|
||||
|
||||
# Bind all connections to the T3U dongle (wlan1)
|
||||
# Bind the internet uplink to the onboard radio (wlan0)
|
||||
sudo nmcli connection modify home-wifi connection.interface-name "$WLAN"
|
||||
sudo nmcli connection modify Hotspot \
|
||||
connection.interface-name "$WLAN" \
|
||||
# The in-car AP lives on the fast T3U (wlan1)
|
||||
sudo nmcli connection modify Hotspot-local \
|
||||
connection.interface-name "$AP_IFACE" \
|
||||
ipv4.method shared \
|
||||
ipv4.addresses 10.42.0.1/24
|
||||
if nmcli connection show phone-hotspot >/dev/null 2>&1; then
|
||||
@@ -40,8 +43,8 @@ if nmcli connection show phone-hotspot >/dev/null 2>&1; then
|
||||
802-11-wireless.mtu 1400
|
||||
fi
|
||||
|
||||
# Create wlan0 fallback profiles (lower autoconnect-priority so wlan1 wins)
|
||||
# home-wifi-fb: same SSID as home-wifi but on wlan0
|
||||
# Create wlan1 fallback profile (lower autoconnect-priority so wlan0 wins)
|
||||
# home-wifi-fb: same SSID as home-wifi but on wlan1 (T3U)
|
||||
HOME_SSID=$(nmcli -g 802-11-wireless.ssid connection show home-wifi 2>/dev/null || true)
|
||||
HOME_PSK=$(sudo nmcli -g 802-11-wireless-security.psk connection show --show-secrets home-wifi 2>/dev/null || true)
|
||||
if [ -n "$HOME_SSID" ] && [ -n "$HOME_PSK" ]; then
|
||||
|
||||
Reference in New Issue
Block a user