MQTT - themactep/thingino-firmware GitHub Wiki
MQTT Integration
MQTT Client
Thingino already has the MQTT mosquitto_pub
and mosquitto_sub
clients installed in the /usr/bin
directory.
Publishing
Publish on motion is built-in. See Tools > Send to MQTT in the web ui to set it up with your MQTT broker information. Motion Guard must be enabled and the box for "Send to MQTT" checked.
NOTE: Until this commit in june 2025, the default configuration had a bug. The default MQTT message {"camera_id": "020c113b8530", "timestamp": "%timestamp"} causes a publishing error. If you haven't updated yet, change the MQTT message by replacing the "%timestamp" parameter with "%s".
The script that publishes on motion is /usr/sbin/send2mqtt
which is called from the /sbin/motion
script.
mosquitto_pub
Basic syntax no password:
# mosquitto_pub -h host -t topic -m message
# mosquitto_pub -h 192.168.0.30 -t thingino/cam4 -m motion
Basic syntax with password:
# mosquitto_pub -h host -u username -P password -t topic -m message
# mosquitto_pub -h 192.168.0.30 -u UncleBob -P secretpassword -t thingino/cam4 -m motion
See full syntax:
# mosquitto_pub --help
Subscribing
See this mqtt_full.sh
script at thingino-scripts for an example using MQTT to control a Thingino camera.
You will need to make it persistent across boots (/etc/init.d, etc/rc.local, etc).
mosquitto_sub
See full syntax:
# mosquitto_sub --help