-
Notifications
You must be signed in to change notification settings - Fork 18
MQTT
#MQTT
If you specified an MQTT broker in your preferences, the app will attempt to connect to this broker. If it can't connect, it will go into a loop an keep trying to connect, blocking analysis of recordings.
Once connected, for any detection that isn't ignored, an MQTT message is published to a topic in the following format: BirdCAGE/(log, record, or alert)/(stream name)
Log, record, or alert is where the detection falls based on your detection filter settings Stream Name is the name you gave your stream, e.g. Horace.
So if you want to monitor for all alert level detections from all streams, you can subscribe to the topic BirdCAGE/alert/#
The payload of the message is a JSON document with fields for...
- CommonName
- ScientificName
- ConfidenceScore
- TimeStamp
- StreamName
- ImportanceLevel (again this is log, record or alert)
- Occurrence (the likelihood of the species appearing in your location according to the analysis engine)
For record or alert level detections, if you specified in your Preferences to include recordings, it will also include a field called MP3 that contains the recording, in MP3 format with base64 encoding applied.
The publications have the "retain" flag set, so your broker should hold on to the most recent publication for any given topic which you'll receive when you connect to the broker.