sl-android f4e4f184ef feat: WiFi mesh handoff - seamless AP roaming (Issue #458)
Add WiFi mesh handoff infrastructure:

WiFiState.msg interface:
- SSID, signal strength (dBm), connection status
- AP address, frequency, link quality
- TX/RX rates, roaming flag
- Available APs for handoff decision

WiFi Monitor Node:
- Signal monitoring via iwconfig/nmcli
- Auto-roam at -70dBm threshold
- Seamless wpa_supplicant roaming
- Gateway ping (8.8.8.8) every 5s
- USB tethering fallback if offline >30s
- TTS warnings for connectivity issues
- Coverage logging with AP transitions

Features:
- Configurable roaming threshold (-70dBm default)
- Gateway connectivity verification
- Offline detection with configurable timeout
- USB tethering auto-activation/deactivation
- Signal strength change logging (>5dBm)
- AP transition logging
- Manual rescan/tether control commands

Topics:
- /saltybot/wifi_state (String)
- /saltybot/speech_text (String warnings)
- /saltybot/wifi_cmd (String commands)

Configuration:
- interface: wlan0
- roam_threshold_dbm: -70
- offline_warning_timeout: 30.0
- target_ssid: SaltyLab
- fallback_tether: true
- coverage_log_file: /tmp/wifi_coverage.log

Roaming Behavior:
- Monitors signal continuously
- When signal < -70dBm, scans for stronger AP
- wpa_supplicant performs seamless handoff
- Logs all AP transitions to coverage file

Fallback Behavior:
- Pings gateway every 5 seconds
- If unreachable for >30s, activates USB tether
- TTS alert: 'Warning: Lost WiFi connectivity...'
- Auto-deactivates when WiFi restored

Coverage Mapping:
- Logs timestamp, SSID, signal, connected status
- Tracks roaming events
- Useful for mesh network optimization

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-03-05 09:20:42 -05:00
..

SaltyBot WiFi Mesh Handoff (Issue #458)

Seamless WiFi AP roaming with automatic fallback to USB tethering.

Features

  • Signal Monitoring: Continuous WiFi signal strength tracking via iwconfig
  • Auto-Roaming: Seamless handoff to stronger AP when signal < -70dBm
  • Gateway Ping: Periodic connectivity verification to 8.8.8.8
  • USB Tethering Fallback: Auto-activate phone USB tether if WiFi offline >30s
  • TTS Warnings: Voice alerts for connectivity issues
  • Coverage Mapping: Logs all signal transitions for analysis
  • wpa_supplicant Integration: Native WiFi roaming support
  • Status Publishing: Real-time WiFi state on /saltybot/wifi_state

Setup

1. WiFi Configuration

Edit /etc/wpa_supplicant/wpa_supplicant.conf:

network={
  ssid="SaltyLab"
  psk="password"
  bgscan="simple:30:-70:600"
  ap_scan=1
  priority=10
}

2. Launch

ros2 launch saltybot_wifi_monitor wifi_monitor.launch.py

3. Monitor

ros2 topic echo /saltybot/wifi_state

Configuration

Parameter Default Description
interface wlan0 WiFi interface
roam_threshold_dbm -70 Roaming signal threshold
offline_warning_timeout 30.0 Timeout before USB fallback
target_ssid SaltyLab Target mesh SSID
fallback_tether true Enable USB tethering

Roaming Behavior

Automatic roaming when:

  1. Signal < -70dBm
  2. Stronger AP available (>5dBm better)
  3. wpa_supplicant performs seamless handoff
  4. No ROS message disruption

Fallback Behavior

Automatic fallback when:

  1. Gateway ping fails for >30 seconds
  2. TTS warning published
  3. USB tethering activated
  4. Auto-deactivated when WiFi restored

Topics

Topic Type Description
/saltybot/wifi_state String Current WiFi state
/saltybot/speech_text String TTS warnings
/saltybot/wifi_cmd String Control commands

Coverage Log

tail -f /tmp/wifi_coverage.log

Output:

2026-03-05T09:15:23.456 | SSID:SaltyLab | Signal:-65dBm | Connected:true | Roaming:false
2026-03-05T09:15:45.789 | SSID:SaltyLab-5G | Signal:-62dBm | Connected:true | Roaming:true

Issue #458 Completion

WiFi signal monitoring (iwconfig/nmcli) WiFiState.msg interface Auto-roam at -70dBm Seamless wpa_supplicant handoff Gateway ping verification USB tethering fallback TTS warnings (offline >30s) Coverage logging + AP transitions Configurable parameters Manual control commands