:mod:`wificlient` -- WiFi connection manager ============================================ .. module:: wificlient :synopsis: WiFi connection manager. .. note:: A global instance of the `NetworkManager` is instantiated in this module. It is strongly recommended to use this instance instead of creating a new one. Import the global instance like this:: from wificlient import nmcli Classes ------- .. class:: NetworkManager() .. property:: ssid Returns the SSID of the wireless network that this board is currently connected to (if the infrastructure mode is used), or the one that this board created (if the access point mode is used). .. property:: connected Returns the connection status (please note that in the access point mode the ``connected`` property will always be ``True``) .. property:: ip Returns the IP of the board (as a string), or ``None``. .. method:: ifconfig() Returns a tuple of ``(ip, netmask, gateway, dns)`` or ``None`` .. method:: defaults() Configures the default connection: an access point, ip ``10.10.0.1``. The SSID is individual for each board (derived from the MAC address). .. method:: connect() :async: Tries to connect to the SSID or create an access point according to the board settings. .. method:: watcher() :async: This is a task, that monitors the connection, tries to restore it of it is lost and reboots the board if the reconnection retries have been exhausted.