openpilot
openpilot copied to clipboard
system/ui: fix authentication callback and connection tracking
trafficstars
Fixes critical bugs in the WiFi manager that were causing connection failures and missing password prompts:
-
Fixed authentication callback issues: incorrectly using non-existent variables causing runtime exceptions:
def _on_need_auth(self): match self.state: case StateConnecting(network): # This throws NameError: name 'network' is not defined self.state = StateNeedsAuth(network) -
Improved connection state tracking:
- Added
_current_connection_ssidto track active connection attempts - Implemented proper cleanup when connections succeed or fail
- Added
-
Enhanced error handling:
- Added fallback methods to identify networks needing authentication
These changes ensure authentication prompts appear reliably and WiFi connections establish correctly.