Import
Function Reference
scan_wifi(interface='wlan0')
Scan for available WiFi networks.
Returns:
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’)
error key and no access_points key. Use
result.get('access_points', []) and check result.get('error').
connect_to_wifi(ssid, password, interface='wlan0')
Connect to a WiFi network.
Returns:
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.
Returns:
dict with keys:
success- Boolean indicating disconnect successmessage- Success message (whensuccessis True)error- Error message (whensuccessis False)
delete_wifi_connection(connection_name)
Delete a saved WiFi connection by name, which is usually the SSID.
dict with connection (the name), deleted (bool) and, on failure, error
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
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

