None Notebook

This notebook contains material from cbe61622; content is available on Github.

< 3.0 Enabling the Internet of Things | Contents | 3.2 Accessing a Remote Experiment via MQTT >

Open in Colab

Download

3.1 Publishing an Experiment via MQTT

This notebook is part of a proof concept study regarding use of the Internet of Things (IoT) as infrastructure for engineering teaching laboratories.

This notebook uses the SimPy library a create real-time simulation of a hypothetical experiment. The experiment responds to inputs and publishes data to a remote user via an an MQTT broker. In actual use, the content of this notebook would be implemented in an attached device such as an Arduino, Particle, or Raspberry Pi, with attached sensors.

The companion notebook ??? demonstrates how a remote client could interact with the experiment via MQTT.

3.1.1 Installations

The following installations are required for use on Google Colab.

3.1.2 Publishing a real-time simulation via MQTT

Topics:

topic messages
cbe-virtual-lab/command start and stop experiments
cbe-virtual-lab/expt-name/data topic

3.1.2.1 Proof of Concept

Here we experiment with encapsulating the experiment as a standalone class. This is set up so that upon receiving an appropriate message from the remote user, a new instance of the experiment is created and run.

3.1.3 Version 1

T

< 3.0 Enabling the Internet of Things | Contents | 3.2 Accessing a Remote Experiment via MQTT >

Open in Colab

Download