Simple MQTT sample made in Python
Link to Repository: https://github.com/wernerpaulin/PyMQTTsample
This app is written in Python® 3. It shows a simple implementation of MQTT for app handling demonstration.
Table of Contents
- tbd
Technology | Description |
---|---|
Python® | asyncio for concurrent execution of coroutines |
Eclipse Paho® | MQTT client |
Docker® | Container technology |
Find this app in the App Store and use it in a machine.
This app requires a MQTT broker which can either run as an app or on a different host but in the same network of the Runtime. It also requires an influxdb app running on the Runtime or on a different host.
- tbd
The app subscribes to the following topics:
Topic | Value Example |
---|---|
pymqttsample.lenze.mosaiq/parameter | "{"threshold": 200, "step": 1}" |
The app publishes the following topics:
Topic | Value Example |
---|---|
pymqttsample.lenze.mosaiq/monitor | "{"value": 1}" |
Please note: Ports can be mapped to different host ports in the machine settings
Environmental variables are used to initialize or define a certain functionality of an app and can be changed in the machine settings:
Variable | Default Value | Changeable by User | Description |
---|---|---|---|
MQTT_BROKER_IP | localhost | yes | Hostname or IP address of MQTT broker |
MQTT_BROKER_PORT | 1883 | yes | Port used by the MQTT broker |
MQTT_BROKER_KEEPALIVE | 60 | yes | Maximum time that this app does not communicate with the broker |
CYCLE_TIME_APP | 0.2 | yes | Cyclic time of app |
Mount points are access points to volumes (like paths) provided to the app to read and write data:
Mount Point | Default Data | Changeable by User | Description |
---|---|---|---|
n.a. |
Developer | Compatibility | Size on Runtime | Copyright | License |
---|---|---|---|---|
Lenze SE | Requires Runtime 1.0 or later | 50.7 MB | © 2021- Lenze SE | MIT License. See LICENSE for more information. |
- "Python®" and the Python logos are trademarks or registered trademarks of the Python Software Foundation.
- "Eclipse®", "Mosquitto®", Paho® and the respective logos are trademarks or registered trademarks of the Eclipse Foundation.
- "Docker®" and "Docker Hub®" are trademarks or registered trademarks of Docker.