The php-wifi library, now in version 3.2, provides a PHP interface for managing Wi-Fi connections on Linux-based systems like Raspberry Pi. It utilizes system utilities such as nmcli, wpa_cli, and hostapd to handle network scanning, connection management, and hotspot creation without requiring manual input.
The library includes a watchdog service that monitors Wi-Fi connectivity. If a connection is lost, the service attempts to reconnect; if unsuccessful, it automatically launches a hotspot to allow configuration via a mobile device. The watchdog pauses its operations while a device is connected to the hotspot.
Designed primarily for Linux, the library automatically selects the appropriate backend. It supports NetworkManager via nmcli or direct interaction with wpa_supplicant. While basic scanning and connection features are compatible with macOS and Windows, advanced functions like hotspot management are limited to Linux environments.
Security measures include passing passwords via stdin or configuration files with restricted permissions to prevent exposure in process lists. Future updates, specifically version 3.3, are planned to include a provision command to simplify the initial device setup process, similar to smart speaker configuration.






