Add secondary WiFi adapter (wlan1) support#907
Open
PanGalactic wants to merge 1 commit into
Open
Conversation
Add dashboard support for managing a secondary WiFi adapter (wlan1) on boards with Broadcom chips that support virtual interfaces. This enables simultaneous connections — e.g. wlan0 for home WiFi and wlan1 for a robot's point-to-point hotspot. Backend (wifi_config.py): - 5 new endpoints: GET /status2, POST /scan2, POST /connect2, POST /disconnect2, POST /create_interface - SecondaryWifiStatus Pydantic model - Helper functions for wlan1 operations using subprocess (nmcli library doesn't support ifname targeting for virtual interfaces) - All subprocess calls use timeout and exception handling matching volume.py patterns - Fix: primary status filters to wlan0 only (previously wlan1 connections could mask wlan0 state and prevent hotspot creation) - Add ip_address field to primary WifiStatus (additive, non-breaking) Frontend (wifi.html + wifi.js): - Secondary WiFi section mirroring primary UI structure - Network/IP display for both adapters - Status polling for both adapters at 1s interval - Disconnect button and Create Interface fallback for missing wlan1 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add dashboard support for managing a secondary WiFi adapter (wlan1) on boards with Broadcom chips that support virtual interfaces. This enables simultaneous connections — e.g. wlan0 for home WiFi and wlan1 for a robot's point-to-point hotspot.
Changes to existing code
Only 3 lines of existing code were modified (all in
wifi_config.py):1.
get_current_wifi_mode()— mode detectionFixes latent bug where wlan1 connection could prevent wlan0 hotspot creation.
2.
get_wifi_status()— known_networks filterHides secondary adapter connection profiles (suffixed
-wlan1) from primary UI.3.
get_wifi_status()— connected_network filterPrimary status now correctly reports only wlan0 connection.
New API endpoints
GET/wifi/status2POST/wifi/scan2POST/wifi/connect2POST/wifi/disconnect2POST/wifi/create_interfaceiwif missingDesign notes
nmcliPython library doesn't supportifnametargeting for virtual interfaces. Primary adapter continues using the nmcli library.{ssid}-wlan1to keep NM profiles distinct per interface.iw dev wlan0 interface add wlan1 type managedvia sudo. Requires passwordless sudo (standard on Reachy — daemon runs aspollenwith sudo).timeout=NMCLI_COMMAND_TIMEOUTand exception handling matchingvolume.pypatterns.Backward compatibility
GET /wifi/status— same fields + newip_address(additive, non-breaking)Test plan
🤖 Generated with Claude Code