mqtt.chem.wisc.edu


This server hosts an MQTT broker for "internet of things" applications within the Department of Chemistry at the University of Wisconsin-Madison.
In particular, this server hosts:

This server is maintained by Blaise Thompson and Chemistry Comphelp.
Please contact them with any questions or concerns.

mosquitto

This server runs mosquitto, an MQTT broker. Briefly, MQTT is a lightweight publish-subscribe protocol that allows many devices to communicate. The broker provides structured topics, e.g. "sensor42/temperature" and "instrument9/opa2/wavelength". Clients can publish topic updates. Other clients can subscribe to be notified each time a topic is updated. Refer to mqtt.org for more information.

Anyone on the campus network can subscribe to the topics served here. There are lots of great MQTT clients you can use. We recommend:

To see all topic updates on your command line:


mosquitto_sub -h mqtt.chem.wisc.edu -t "#" --verbose

You'll need a password to publish to this broker. Talk to Blaise Thompson or Chemistry Comphelp if you want to start publishing.

influxdb

The Chemistry Department has standardized on the homie convention. This convention imposes a well-defined structure on top of the basic MQTT communication layer. This structure introduces a "device" topology.

This server stores all homie device history to an influx time-series database. Importantly, only homie-convention compliant MQTT topics are stored---other published topics are not recorded in any permanent way.

While we make every attempt to prevent data loss, please do not treat this database as an archive. You are responsible for saving data that you care about in a more permanent way. Device history older than two years will automatically be deleted.

Homie data is written to the database with each node corresponding to one field. All of the additional information that is represented within the homie hierarchy is stored as tags.

Anyone on the campus network can query this database using the following read-only account:


username: user
password: xtssxgxy

The following example will return all of the recorded "temperature" measurements within the last one day using curl.


curl -u user:xtssxgxy \
-G "mqtt.chem.wisc.edu:8086/query?pretty=true" \
--data-urlencode "db=homie" \
--data-urlencode "q=SELECT value FROM temperature WHERE time > now()-1d"

The following example will return all of the recorded "temperature" measurements within the last one day using Python. You will need the influxdb Python package.


import influxdb

client = influxdb.InfluxDBClient(host="mqtt.chem.wisc.edu",
                                 database="homie",
                                 username="user",
                                 password="xtssxgxy")

result = client.query("SELECT value FROM temperature WHERE time > now()-1d")

We have also set-up a grafana appliance with this database as a source. You will need Chemistry Department LDAP credentials to log in. Check it out at grafana.chem.wisc.edu.


source                                                         CC0: no copyright