Import
Function Reference
| Function | Description |
|---|---|
scan_wifi(interface) | Scan for available WiFi networks |
connect_to_wifi(ssid, password, interface) | Connect to a WiFi network |
get_wifi_status() | Get current WiFi connection status |
disconnect_wifi(interface) | Disconnect from WiFi network |
scan_wifi(interface='wlan0')
Scan for available WiFi networks.
| Parameter | Type | Default | Description |
|---|---|---|---|
interface | str | 'wlan0' | Network interface to scan on |
dict with key access_points containing a list of network dicts, each with:
ssid- Network namestrength- Signal strength as percentage (0-100)security- Security type (‘Open’ or ‘Secured’)
connect_to_wifi(ssid, password, interface='wlan0')
Connect to a WiFi network.
| Parameter | Type | Default | Description |
|---|---|---|---|
ssid | str | Network name | |
password | str | Network password (empty string for open networks) | |
interface | str | 'wlan0' | Network interface to use |
dict with keys:
success- Boolean indicating connection successmessage- Success message (whensuccessis True)error- Error message (whensuccessis False)
get_wifi_status()
Get current WiFi connection status for all interfaces.
dict keyed by interface name, each value containing:
interface- Interface namessid- Connected network name or ‘Not Connected’state- ‘Connected’ or ‘Disconnected’
disconnect_wifi(interface='wlan0')
Disconnect from the current WiFi network.
| Parameter | Type | Default | Description |
|---|---|---|---|
interface | str | 'wlan0' | Network interface to disconnect |
dict with keys:
success- Boolean indicating disconnect successmessage- Success message (whensuccessis True)error- Error message (whensuccessis False)
Router Internet Access Control
TheWifi net type controls internet access via an Asus router’s parental control feature. This is a separate concern from box-level WiFi management — it blocks/unblocks a device’s internet access by MAC address.
Examples
Scan and Connect
Network Verification Test
Signal Strength Test
Connection Test
Hardware Requirements
| Requirement | Description |
|---|---|
| WiFi Hardware | USB adapter or built-in |
| Permissions | Root/sudo access required |
| Supported Security | WPA2, WPA3, Open |
Notes
- Lager Box must have WiFi hardware
- Root/sudo access required for most operations
- WPA2/WPA3 networks supported
- Open networks require empty password string (
'') - Interface defaults to ‘wlan0’
get_wifi_status()takes no parameters and returns all interfaces- Router management (enable/disable) requires Asus router with parental control and a configured wifi net

