No description
| static | ||
| templates | ||
| .drone.yml | ||
| .gitignore | ||
| app.py | ||
| Dockerfile | ||
| hostapd_client.py | ||
| README.md | ||
| requirements.txt | ||
Hostapd Web UI
A Flask-based web application that provides a REST API interface to manage WiFi stations via hostapd.
Features
- List connected WiFi stations (MAC addresses)
- Get detailed information about specific stations
- RESTful API with proper error handling
- JSON responses for easy integration
API Endpoints
GET /api/v1/sta/list
Returns a JSON array of connected station MAC addresses.
Response:
[
"aa:bb:cc:dd:ee:ff",
"11:22:33:44:55:66"
]
GET /api/v1/sta/details/<mac>
Returns detailed information about a specific station.
Response:
{
"rx_packets": "1234",
"tx_packets": "5678",
"signal": "-65",
"connected_time": "3600"
}
GET /health
Health check endpoint.
Response:
{
"status": "healthy",
"service": "hostapd-webui"
}
Requirements
- Python 3.7+
- Flask
- hostapd with hostapd_cli installed and configured
Error Handling
The API returns appropriate HTTP status codes:
- 200: Success
- 400: Bad request (invalid MAC address format)
- 404: Station not found
- 500: Internal server error
Logging
The application logs information and errors to the console. Set the LOG_LEVEL environment variable to control verbosity.
Development
To run in debug mode, set debug=True in the app.run() call in app.py.