MQTT Plot#

I find myself often needing to plot e.g. sensor measurements and other data, both from the host and directly from a microcontroller.

MQTT Plot is a simple Python app that serves this purpose. All data and configuration for plots is sent over MQTT and hence accommodates many sources.

Use the following code to download the app:

%%bash

cd $IOT_PROJECTS
svn checkout https://github.com/iot49/iot49.org/trunk/docs/projects/mqtt-plot

Start the plot server by running

cd $IOT_PROJECTS/mqtt-plot/code
python -m mqtt_plot

from a terminal. To automatically start the server whenever ide49 boots, add python -m mqtt_plot & to ~/.micropython_rc.sh.

View plots at http://iot49.local:5006.

Limitations#

  • Only a single http connection at any one time:

    • Only the most recent plot is updated!

  • Absolutely no security:

    • no encryption, no access control

    • neither for MQTT data nor the plot