The Advanced Stats plugin uses FPP's built-in MQTT broker to capture events in real-time.
- ❌ Requires manual registration for each event type
- ❌ Not all FPP events are reliably delivered via callbacks
- ❌ GPIO events require explicit hooks
- ❌ Dependent on FPP calling the script
- ✅ Real-time event capture - Events published immediately
- ✅ More reliable - FPP automatically publishes all events
- ✅ GPIO monitoring - Captures ALL GPIO state changes instantly
- ✅ No registration needed - Just subscribe to topics
- ✅ Runs continuously - Background service monitoring all events
- Open FPP web interface
- Navigate to: Content Setup → System Settings
- Scroll down to Services section
- Find Enable Local MQTT Broker
- Check the checkbox to enable it
- Click Save at the bottom of the page
- FPP will automatically start the MQTT broker on
localhost:1883
# Check if MQTT broker is running
systemctl status mosquitto
# Test MQTT connection (FPP's MQTT broker requires authentication)
mosquitto_sub -h localhost -u fpp -P falcon -t '#' -v -C 1Note: FPP's MQTT broker uses authentication with username fpp and password falcon.
Once MQTT is enabled, the plugin's MQTT listener will automatically:
- Start when FPP starts (via
scripts/postStart.sh) - Subscribe to all relevant topics
- Begin logging events to the database
- Stop gracefully when FPP stops (via
scripts/preStop.sh)
The plugin subscribes to these FPP MQTT topics:
| Topic Pattern | Description | Example |
|---|---|---|
falcon/player/+/event/sequence/# |
Sequence start/stop events | falcon/player/FPP/event/sequence/start |
falcon/player/+/event/playlist/# |
Playlist start/stop events | falcon/player/FPP/event/playlist/start |
falcon/player/+/gpio/# |
GPIO pin state changes | falcon/player/FPP/gpio/18 |
falcon/player/+/status |
FPP status updates | falcon/player/FPP/status |
# Check for running process
pgrep -f mqtt_listener.py
# Or use ps
ps aux | grep mqtt_listener.py# Tail the log file to see events as they happen
tail -f /home/fpp/media/logs/fpp-plugin-AdvancedStats.logcd /home/fpp/media/plugins/fpp-plugin-AdvancedStats
python3 mqtt_listener.pyPress Ctrl+C to stop.
pkill -f mqtt_listener.pypkill -f mqtt_listener.py && sleep 2 && cd /home/fpp/media/plugins/fpp-plugin-AdvancedStats && nohup python3 mqtt_listener.py >> /home/fpp/media/logs/fpp-plugin-AdvancedStats.log 2>&1 &# Subscribe to all FPP topics (requires authentication)
mosquitto_sub -h localhost -u fpp -P falcon -t 'falcon/player/+/#' -v
# Then play a sequence or trigger a GPIO in FPP# View recent GPIO events
sqlite3 /home/fpp/media/config/plugin.fpp-plugin-AdvancedStats.db "SELECT * FROM gpio_events ORDER BY timestamp DESC LIMIT 10;"
# View recent sequences
sqlite3 /home/fpp/media/config/plugin.fpp-plugin-AdvancedStats.db "SELECT * FROM sequence_history ORDER BY timestamp DESC LIMIT 10;"- Navigate to: Status/Control → Advanced Stats Dashboard
- The dashboard will show recent events
- Play a sequence or trigger GPIO to see live updates
Problem: pgrep -f mqtt_listener.py returns nothing
Solutions:
- Check if MQTT broker is enabled in FPP settings
- Verify MQTT broker is running:
systemctl status mosquitto - Check logs:
tail -f /home/fpp/media/logs/fpp-plugin-AdvancedStats.log - Start manually to see error messages:
python3 /home/fpp/media/plugins/fpp-plugin-AdvancedStats/mqtt_listener.py
Problem: Failed to connect to MQTT broker: [Errno 111] Connection refused
Solution: Enable MQTT in FPP settings (see Step 1 above)
Problem: Connection error: Connection Refused: not authorised
Solution: FPP's MQTT broker requires authentication. Always use -u fpp -P falcon with mosquitto_sub:
mosquitto_sub -h localhost -u fpp -P falcon -t 'falcon/player/#' -vProblem: Dashboard shows no data
Checklist:
- ✅ MQTT enabled in FPP settings
- ✅ Listener is running:
pgrep -f mqtt_listener.py - ✅ Actually triggered events (played sequence, changed GPIO)
- ✅ Database exists:
ls -lh /home/fpp/media/config/plugin.fpp-plugin-AdvancedStats.db
Problem: ModuleNotFoundError: No module named 'paho'
Solution:
apt-get update && apt-get install -y python3-paho-mqttTopic: falcon/player/FPP/event/sequence/start
Payload:
{
"sequence": "MySequence",
"playlist": "MainShow",
"action": "start"
}Topic: falcon/player/FPP/gpio/18
Payload:
{
"state": 1,
"value": 1
}| Feature | Callbacks | MQTT |
|---|---|---|
| Setup Complexity | Manual registration | Enable in settings |
| Event Coverage | Limited | Comprehensive |
| GPIO Monitoring | Requires hooks | Automatic |
| Reliability | Depends on FPP calling script | FPP publishes automatically |
| Real-time | Delayed | Instant |
| Background Service | No | Yes |
| Recommended | ❌ Legacy | ✅ Use This! |
Note: The plugin maintains both callback (callbacks.py) and MQTT (mqtt_listener.py) implementations for compatibility, but MQTT is the recommended method for event capture.