Python Library simulate physical systems for with MQTT interfaces so students can control the simple versions before the live ones
[MQTT](MQTT - The Standard for IoT Messaging) is an OASIS standard messaging protocol for the Internet of Things (IoT). It is designed as an extremely lightweight publish/subscribe messaging transport that is ideal for connecting remote devices with a small code footprint and minimal network bandwidth. MQTT today is used in a wide variety of industries, such as automotive, manufacturing, telecommunications, oil and gas, etc.
A tank with fish in which we are trying to monitor and control. But this could a real one, a demo one with robot fish or an entirely simulated one. All of these will be MQTT Clients.
It sends out measurements and recieves control data that it uses to turn on the heater etc.
Measurement of temperature acidity etc sent from a Fish Tank
Should the heater be on or off etc.
What are the target ranges for measurements in the system.
An MQTT Client program that subscribes to the measurement, range and optionally the control data of a fish tank and decides what the control data should be and changes it,
An MQTT Client program that subscribes to the measurement and control data of a fish tank and shows the current status of the system.
Stored data for graphing etc.
Server where the data is stored. It subscribes to the MQTT data and records all data from messages.
A program containing a Display, range editing capability and optionally , graphing from the data store.
sequenceDiagram
Fish Tank -->> Broker: measurements
Broker-->>Control System : measurements
Broker-->>Display : measurements
Control System-->>Broker : control data
Broker-->>Fish Tank: control data
Broker-->>Web Front End: control data
Broker-->>Data Store: measurements
Broker-->>Display: control data
Web Front End->>Data Store: historical data request
Data Store->>Web Front End: historical data
Web Front End-->>Broker: range data request
Broker-->>Web Front End: range data
Web Front End-->>Broker: range data change
Broker-->>Web Front End: range data
Broker-->>Control System : range data
Control System-->>Broker : control data
Broker-->>Fish Tank: control data
Broker-->>Web Front End: control data
Broker-->>Display: control data
But because of Pub/Sub we can use other arrangements for demos etc.
The kids write a Control System that starts subbed to a simulation with a display that it subbed to the simulation too. runs at 60 times speed.
The fake tank can be attached to the control data of one of the simulated tanks.
A control system can then be subbed to the fake tank measurements and really take over.
- https://docs.espressif.com/projects/esp-idf/en/stable/esp32/api-reference/protocols/mqtt.html
- https://github.com/mlesniew/PicoMQTT
- https://randomnerdtutorials.com/esp32-mqtt-publish-subscribe-arduino-ide/
- https://www.hivemq.com/mqtt/public-mqtt-broker/
- https://www.hivemq.com/mqtt-toolbox/
- https://github.com/roppert/mosquitto-python-example
- https://pypi.org/project/paho-mqtt/
- https://github.com/Yakifo/amqtt
