# WiFi Service 1.0 The WiFi service is a core component that manages wireless connectivity through WPA Supplicant. It provides robust wireless network management with support for multiple access points and automatic failover capabilities. ## Features ### Connection Management - Establishes and maintains wireless connections using WPA Supplicant - Handles WPA/WPA2 authentication and security - Manages connection state and automatic recovery - Implements failover between configured access points ### Network Selection - Prioritizes available networks based on configuration - Supports multiple access point configurations - Enables seamless switching between networks - Maintains connection stability through automatic reconnection ### Integration - Operates at the system level - Integrates with Network Manager for broader network infrastructure - Provides status updates to the Monitoring service - Supports the Transfer service's communication needs ## Implementation Details The service uses WPA Supplicant for wireless network management, providing: - Secure authentication (**WPA/WPA2**) - Network scanning and selection - Connection state management - Automatic failover capabilities The service automatically attempts to connect to alternative access points if the primary connection fails, using the priority values specified in the configuration to determine the connection order. ## Configuration The service is configured through environment variables that can be defined at plugin startup: ```json { "WIFI_SSID": "etablone_ap", // Primary access point SSID "WIFI_PASSWORD": "etablone", // Primary network password "RUST_LOG": "INFO", // Logging level "RUST_BACKTRACE": "full", // Debug backtrace setting "WIFI_ADDITIONAL_STA_CONFIGURATIONS": "etablone_ap:etablone:1" // Alternative APs } ``` ### Configuration Parameters - ``WIFI_SSID``: Defines the primary access point SSID for connection - ``WIFI_PASSWORD``: Sets the authentication password for the primary network - ``WIFI_ADDITIONAL_STA_CONFIGURATIONS``: Specifies alternative access points in the format "SSID:password:priority" - Multiple configurations can be provided, separated by commas - Priority value (1-100) determines the connection order (higher priority leads to first tries) - Example: "network1:pass1:1 network2:pass2:2" **NOTA : Password must be parametrized on 8 characters minimum, (this is the WPA2 requirement), otherwise the alternate access will not be taken into account ** Example : ``` "WIFI_SSID": "etablone_ap", // wifi access point SSID, used to connect "WIFI_PASSWORD": "etablone", // wifi password "RUST_LOG": "INFO", "RUST_BACKTRACE": "full", "WIFI_ADDITIONAL_STA_CONFIGURATIONS": "etablone_ap:etablone:1" // a list of alternative sta configurations ``` This module use the underlying ability to recover on other access point if the main one is not available. Alternate access points are given using the `WIFI_ADDITIONAL_STA_CONFIGURATION` config variables. The description is elicited below. #### Configuring Wifi additional STA configurations Using this additional parameter permit to define additional wifi connection, in case the first ones are not properly reachable. the configuration is based on tuple "**comma separated**" string like this : ``` [wifi tuple definition 1],[wifi tuple definition 2],[wifi tuple definition 3] ``` each configuration is defined as this : ``` [WIFIACCESSPOINTSSID1]:[WIFIPASSWORD]:[WIFIPRIORITY] ``` priority 1 is the most important network to try first, higher numbers defines less priority wifi to try connection to.