MQTT basics with paho-mqtt
Problem statement
Simple "Hello World" MQTT PUB/SUB app.
- Subscriber should listen to the topic "/test" (subscriber listens to two topics here, the ones that publishers publish to)
- First publisher, with "/test /hello" sends "hello" every 1 second (feel free to use time.sleep(1))
- Second publisher, with the "/test /world" sends "world" every 2 second
Steps to run:
- Create a Py3 virtual environment, activate the same; do this on 3 terminals.
- On each terminal:
2.1python subscriber.py
2.2python publisher1.py
2.3python publisher2.py
- On the first terminal you'll be able to see hello twice and world printed once on the terminal.