Pick a WiFi adapter to host the KEY1 AP on. Preference order, so wardriving AND an active WiFi uplink keep running whenever the hardware allows: 1. a radio used by neither wardriving nor the live WiFi connection; 2. any radio not used by wardriving (may be the Wi
(self)
| 2433 | self.logger.warning(f"Failed to connect to {network}: {result.stderr}") |
| 2434 | except Exception as e: |
| 2435 | self.logger.warning(f"Error connecting to {network}: {e}") |
| 2436 | |
| 2437 | return False |
| 2438 | |
| 2439 | def start_ap_mode_with_timeout(self): |
| 2440 | """Start AP mode with smart timeout management""" |
| 2441 | self.ap_logger.info("Starting AP mode with timeout management") |
| 2442 | if self.start_ap_mode(): |
| 2443 | self.ap_mode_start_time = time.time() |
| 2444 | self.cycling_mode = True |
| 2445 | self.logger.info(f"AP mode started with {self.ap_timeout}s timeout") |
| 2446 | self.ap_logger.info(f"AP mode started with {self.ap_timeout}s timeout in cycling mode") |
| 2447 | return True |
| 2448 | else: |
| 2449 | self.ap_logger.error("Failed to start AP mode with timeout") |
| 2450 | return False |
| 2451 | |
| 2452 | def enable_ap_mode_from_web(self): |
| 2453 | """Enable AP mode from web interface - uses endless loop behavior""" |
| 2454 | self.logger.info("AP mode requested from web interface") |
| 2455 | if self.wifi_connected: |
| 2456 | # If connected, disconnect first |
| 2457 | self.disconnect_wifi() |
| 2458 | |
| 2459 | # Stop current AP if running |
| 2460 | if self.ap_mode_active: |
| 2461 | self.stop_ap_mode() |
no test coverage detected