{"record":{"id":"e1940490d630f849","repo":"ruvnet/RuView","slug":"wifi-interface-self-interface-is-disconnected","errorCode":null,"errorMessage":"WiFi interface '{self._interface}' is disconnected. Connect to a WiFi network first.","messagePattern":"WiFi interface '(.+?)' is disconnected\\. Connect to a WiFi network first\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"archive/v1/src/sensing/rssi_collector.py","lineNumber":558,"sourceCode":"\n    def collect_once(self) -> WifiSample:\n        return self._read_sample()\n\n    # -- internals -----------------------------------------------------------\n\n    def _validate_interface(self) -> None:\n        try:\n            result = subprocess.run(\n                [\"netsh\", \"wlan\", \"show\", \"interfaces\"],\n                capture_output=True, text=True, timeout=5.0,\n            )\n            if self._interface not in result.stdout:\n                raise RuntimeError(\n                    f\"WiFi interface '{self._interface}' not found. \"\n                    f\"Check 'netsh wlan show interfaces' for the correct name.\"\n                )\n            if \"disconnected\" in result.stdout.lower().split(self._interface.lower())[1][:200]:\n                raise RuntimeError(\n                    f\"WiFi interface '{self._interface}' is disconnected. \"\n                    f\"Connect to a WiFi network first.\"\n                )\n        except FileNotFoundError:\n            raise RuntimeError(\n                \"netsh not found. This collector requires Windows.\"\n            )\n\n    def _sample_loop(self) -> None:\n        interval = 1.0 / self._rate\n        while self._running:\n            t0 = time.monotonic()\n            try:\n                sample = self._read_sample()\n                self._buffer.append(sample)\n            except Exception:\n                logger.exception(\"Error reading WiFi sample\")\n            elapsed = time.monotonic() - t0","sourceCodeStart":540,"sourceCodeEnd":576,"githubUrl":"https://github.com/ruvnet/RuView/blob/4685618388a5e49fad5b3005806f3bdd6a7c25c3/archive/v1/src/sensing/rssi_collector.py#L540-L576","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Connect to a WiFi network before starting the collector, for example: 'netsh wlan connect name=\"YourSSID\"' or via Settings > Network & Internet.","Verify state with 'netsh wlan show interfaces' and check that the 'State' field reads 'connected' or 'is connected to...'.","If WiFi was disabled, re-enable the adapter (Settings, or 'netsh interface set interface \"Wi-Fi\" admin=enable').","Retry collector start after the connection is up; validation runs again on each start()."],"exampleFix":"# before\ncollector = WindowsWifiCollector(interface='Wi-Fi', rate=2.0)\ncollector.start()  # RuntimeError: interface is disconnected\n\n# after\nimport subprocess\nsubprocess.run(['netsh', 'wlan', 'connect', 'name=HomeNet'], check=True)\ncollector = WindowsWifiCollector(interface='Wi-Fi', rate=2.0)\ncollector.start()","handlingStrategy":"validation","validationCode":"import subprocess\nout = subprocess.run(['netsh', 'wlan', 'show', 'interfaces'],\n                     capture_output=True, text=True, timeout=5.0).stdout.lower()\nsection = out.split('wi-fi', 1)[1][:200] if 'wi-fi' in out else ''\nif 'disconnected' in section:\n    subprocess.run(['netsh', 'wlan', 'connect', 'name=HomeNet'], check=True)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the 'State' field of 'netsh wlan show interfaces' reads connected before starting the collector.","Automate connection (netsh wlan connect or a profile) as a startup precondition in deployment scripts.","Retry collector start once after connecting, since validation re-runs on every start()."],"tags":["windows","wifi","netsh","connectivity"],"backgroundTag":null,"analyzedSha":"4685618388a5e49fad5b3005806f3bdd6a7c25c3","analyzedAt":"2026-08-16T06:09:40.886Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}