Overview
In this quick start guide, youβll build a simple WiFi Controller Pilot that connects to Qaptly Desktop and executes WiFi commands. This example demonstrates the core UPP concepts in a working implementation.Prerequisites
- Qaptly Desktop version 0.15.0 or later
- Python 3.8+ installed
- Basic knowledge of Python and JSON
Step 1: Install Dependencies
First, install the WebSocket library:Step 2: Create Your Pilot
Create a file namedwifi_pilot.py:
Important: Replace
<qaptly_desktop_ip> with the actual IP address of the machine running Qaptly Desktop on your local network (e.g., 192.168.1.100). You can find this IP address in your network settings or by running ifconfig (macOS/Linux) or ipconfig (Windows).Step 3: Start Qaptly Desktop
- Launch Qaptly Desktop application
- The UPP service starts automatically on port 18765
Step 4: Run Your Pilot
Execute the pilot script:Step 5: Approve the Connection
A dialog will appear in Qaptly Desktop:Step 6: Test the Connection
Your pilot should receive:Step 7: Execute a Command
You can now execute commands from Qaptly. The pilot will receive commands and respond automatically. For example, if Qaptly sends awifi.scan command, youβll see:
Next Connection (With Key)
For subsequent connections, use the assigned key:Key Concepts Demonstrated
This example shows: β WebSocket Connection - Connect tows://<qaptly_desktop_ip>:18765/upp
β
Message Format - All messages follow UPP structure
β
Registration - Declare pilot info and capabilities
β
Authentication - First-time approval + key-based auth
β
Command Handling - Receive and respond to commands
β
Heartbeat - Keep connection alive every 30 seconds
β
JSON Schema - Define params and returns for each capability
Troubleshooting
βConnection refusedβ
- Make sure Qaptly Desktop is running
- Check that no firewall blocks port 18765
- Verify youβre connecting to
<qaptly_desktop_ip>(localhost)
βRegistration failed: AUTH_FAILEDβ
- Your key may be invalid or expired
- Try connecting without a key (first-time flow)
- Check for typos in the key string
Heartbeat timeout
- Your pilot must send heartbeat every 30 seconds
- Connection closes after 90 seconds without any message
Next Steps
Now that you have a working pilot:- Add real WiFi control - Replace simulation with actual network commands
- Implement more capabilities - Add
wifi.connect,wifi.disconnect - Send events - Notify Qaptly about WiFi state changes
- Read the protocol - Understand all message types and flows
Protocol Reference
Complete message specifications
Capabilities Guide
Define complex capabilities with JSON Schema
Authentication
Security model and key management
Examples
More complete implementations