pynq.lib.wifi Module¶
The pynq.lib.wifi module is a python module for interacting with WiFI adapters. This module can be used to connect and disconnect to wireless networks.
-
class
pynq.lib.wifi.
Wifi
(interface='wlan0')[source]¶ Bases:
object
This class controls the WiFi connection.
For USB WiFi, RALink RT5370 devices are recommended.
Note
Administrator rights are necessary to create network interface file
-
wifi_port
¶ string identifier of the wireless network device
Type: str
-
connect
(ssid, password, auto=False)[source]¶ Make a new wireless connection.
This function kills the wireless connection and connect to a new one using network ssid and WPA passphrase. Wrong ssid or passphrase will reject the connection.
Parameters: - ssid (str) – Unique identifier of the wireless network
- password (str) – String WPA passphrase necessary to access the network
- auto (bool) – Whether to set the interface as auto connected after boot.
Returns: Return type: None
-
gen_network_file
(ssid, password, auto=False)[source]¶ Generate the network authentication file.
Generate the file from network SSID and WPA passphrase
Parameters: - ssid (str) – String unique identifier of the wireless network
- password (str) – String WPA passphrase necessary to access the network
- auto (bool) – Whether to set the interface as auto connected after boot.
Returns: Return type: None
-