ruvnet/RuView · error · RuntimeError

WiFi interface '{self._interface}' is disconnected. Connect

Error message

WiFi interface '{self._interface}' is disconnected. Connect to a WiFi network first.

What it means

The Windows collector found the adapter name in netsh output, but within the 200 characters following the name in lowercased output it found the word 'disconnected', meaning the adapter exists but is not associated with any WiFi network. Without association, netsh reports no signal for the interface, so RSSI sampling cannot work until a connection is established.

Source

Thrown at archive/v1/src/sensing/rssi_collector.py:558

    def collect_once(self) -> WifiSample:
        return self._read_sample()

    # -- internals -----------------------------------------------------------

    def _validate_interface(self) -> None:
        try:
            result = subprocess.run(
                ["netsh", "wlan", "show", "interfaces"],
                capture_output=True, text=True, timeout=5.0,
            )
            if self._interface not in result.stdout:
                raise RuntimeError(
                    f"WiFi interface '{self._interface}' not found. "
                    f"Check 'netsh wlan show interfaces' for the correct name."
                )
            if "disconnected" in result.stdout.lower().split(self._interface.lower())[1][:200]:
                raise RuntimeError(
                    f"WiFi interface '{self._interface}' is disconnected. "
                    f"Connect to a WiFi network first."
                )
        except FileNotFoundError:
            raise RuntimeError(
                "netsh not found. This collector requires Windows."
            )

    def _sample_loop(self) -> None:
        interval = 1.0 / self._rate
        while self._running:
            t0 = time.monotonic()
            try:
                sample = self._read_sample()
                self._buffer.append(sample)
            except Exception:
                logger.exception("Error reading WiFi sample")
            elapsed = time.monotonic() - t0

View on GitHub (pinned to 4685618388)

Solutions

  1. Connect to a WiFi network before starting the collector, for example: 'netsh wlan connect name="YourSSID"' or via Settings > Network & Internet.
  2. Verify state with 'netsh wlan show interfaces' and check that the 'State' field reads 'connected' or 'is connected to...'.
  3. If WiFi was disabled, re-enable the adapter (Settings, or 'netsh interface set interface "Wi-Fi" admin=enable').
  4. Retry collector start after the connection is up; validation runs again on each start().

Example fix

# before
collector = WindowsWifiCollector(interface='Wi-Fi', rate=2.0)
collector.start()  # RuntimeError: interface is disconnected

# after
import subprocess
subprocess.run(['netsh', 'wlan', 'connect', 'name=HomeNet'], check=True)
collector = WindowsWifiCollector(interface='Wi-Fi', rate=2.0)
collector.start()
Defensive patterns

Strategy: validation

Validate before calling

import subprocess
out = subprocess.run(['netsh', 'wlan', 'show', 'interfaces'],
                     capture_output=True, text=True, timeout=5.0).stdout.lower()
section = out.split('wi-fi', 1)[1][:200] if 'wi-fi' in out else ''
if 'disconnected' in section:
    subprocess.run(['netsh', 'wlan', 'connect', 'name=HomeNet'], check=True)

Prevention

When it happens

Trigger: Starting WindowsWifiCollector while WiFi is off, in airplane mode, or merely enabled but not connected to an SSID; the machine dropped its association between adapter validation and collector start.

Common situations: Fresh Windows installs or headless Windows boxes never joined to a WiFi network; group policy or VPN clients that disconnect WiFi; hotel/captive networks that drop idle associations; laptop WiFi toggled off via Fn key.

Related errors


AI-assisted analysis of ruvnet/RuView@4685618388 (2026-08-16). Data as JSON: /api/errors/e1940490d630f849. Report an issue: GitHub.