WIFIMODE
WIFIMODE is the Wi-Fi interface mode switcher for Lichee-Jack.
It safely recreates wlan0 with the correct interface type and NetworkManager state, avoiding common cfg80211 / driver conflicts when switching between client, AP, and monitor modes.
This utility is especially important on embedded platforms (CV181x + AIC8800) where changing Wi-Fi modes in-place is unreliable.
Why WIFIMODE exists
On Lichee-Jack, Wi-Fi is used for very different purposes:
- Normal Wi-Fi client connectivity (managed by NetworkManager)
- Software AP / rogue AP (hostapd)
- Active monitor mode with frame injection (Wi-Fi auditing)
Simply toggling modes often leaves the driver in a broken state.
WIFIMODE solves this by:
- Deleting
wlan0completely - Re-creating it with
iwusing the correct interface type - Explicitly telling NetworkManager whether it should manage the interface
This guarantees a clean, predictable Wi-Fi state.
Supported modes
| Mode | Description | Typical Use |
|---|---|---|
MANAGED | NetworkManager-controlled client mode | Normal Wi-Fi networking |
UNMANAGED | Manual control (NM disabled) | hostapd, custom scripts |
MONITOR | Active monitor mode with injection | Auditing, frame injection |
Usage
WIFIMODE <MODE>Examples
Managed (Wi-Fi client)
WIFIMODE MANAGED- Recreates
wlan0as a managed interface - Enables NetworkManager control
Unmanaged (AP / hostapd)
WIFIMODE UNMANAGED- Recreates
wlan0as a normal interface - Disables NetworkManager control
- Required before running
hostapd
Active monitor mode
WIFIMODE MONITOR- Deletes
wlan0 - Recreates it as an active monitor interface
- Supports frame injection
Internal behavior
- Detect existing
wlan0 - Delete the interface using
iw dev wlan0 del - Detect PHY name automatically
- Recreate
wlan0with the requested type - Apply NetworkManager managed / unmanaged state
This delete-and-recreate approach prevents:
Device busyerrors- Broken monitor mode
- NetworkManager re-grabbing interfaces unexpectedly
Dependencies
iwnmclijq
These are included by default in Lichee-Jack images.
Notes & limitations
- Only operates on wlan0
- Assumes a single Wi-Fi PHY (default on Lichee-Jack)
- Monitor mode requires a patched AIC8800 driver (frame injection enabled)
Typical workflows
Wi-Fi client
WIFIMODE MANAGED
nmcli device wifi connect <SSID>Rogue AP / captive portal
WIFIMODE UNMANAGED
hostapd hostapd.confAudit / sniffing
WIFIMODE MONITOR
iw dev wlan0 set channel 6
airodump-ng wlan0Summary
WIFIMODE is a hard reset switch for Wi-Fi operation modes.
If Wi-Fi behaves strangely, switching modes fails, or monitor mode refuses to inject frames — this tool is the correct and safe way to recover.