How qvr/unifi-gateway works
This daemon impersonates a UniFi gateway so a router can be adopted by, and report status to, a UniFi controller. An operator configures the gateway and initiates adoption; the daemon broadcasts discovery messages until adopted, then repeatedly collects router data, builds and encodes informs, sends them to the controller, and handles controller responses. The collector covers interface and host data, DHCP leases, latency, and speed-test results. The README documents these product stages; unsampled implementation details are represented only where the tree or excerpts support them.
Main entry points: unifi_gateway.py Gateway daemon · datacollector.py Data collector · unifi_protocol.py Inform protocol · unifi-gateway.conf Gateway settings
Components 8
Daemon lifecycle
- Gateway daemon
unifi_gateway.py
Router telemetry
- Data collector
datacollector.py - Telemetry formatting
tools.py
UniFi protocol
- Inform protocol
unifi_protocol.py
Configuration
- Gateway settings
conf/unifi-gateway.conf
Other components
- Operator
- UniFi controller
- Router host
Connections 10
- Operator → Gateway daemon: runs commands
- Gateway daemon → Gateway settings: reads and writes
- Gateway daemon → Data collector: creates and updates
- Data collector → Router host: reads system telemetry
- Gateway daemon → Inform protocol: builds broadcast and inform
- Inform protocol → Telemetry formatting: formats telemetry
- Gateway daemon → UniFi controller: sends discovery broadcast
- Gateway daemon → UniFi controller: posts encoded informs
- UniFi controller → Gateway daemon: returns response
- Gateway daemon → Gateway settings: persists adoption state