Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arulrajnet/mqtt-publish-subscribe-demo
MQTT broker and client code for publish and subscribe
https://github.com/arulrajnet/mqtt-publish-subscribe-demo
mosquitto mqtt paho-mqtt
Last synced: 14 days ago
JSON representation
MQTT broker and client code for publish and subscribe
- Host: GitHub
- URL: https://github.com/arulrajnet/mqtt-publish-subscribe-demo
- Owner: arulrajnet
- License: mit
- Created: 2022-10-29T15:17:48.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-10-29T16:11:24.000Z (about 2 years ago)
- Last Synced: 2024-11-09T04:36:34.711Z (2 months ago)
- Topics: mosquitto, mqtt, paho-mqtt
- Language: Python
- Homepage:
- Size: 403 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
= MQTT publish and Subscribe Demo
Mosquitto broker and `paho.mqtt` client for publish and subscribe.
:toc: left
== Prerequisites
* Install Docker
* Install Docker-Compose
* Install Python3
* Install `paho.mqtt`All steps for unix based deployment.
=== Docker
[source,bash]
----
curl -sSL https://get.docker.com/ | sh
sudo usermod -aG docker ${USER}
----=== Docker Compose
[source,bash]
----
sudo curl -sSL https://github.com/docker/compose/releases/download/v2.12.2/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
----=== Python3
[source,bash]
----
sudo apt-get install python3
sudo apt-get install python3-pip
----=== paho.mqtt
[source,bash]
----
python3 -m pip install paho-mqtt
----== Test
Bring-up the setup
[source,bash]
----
docker-compose up -d
----=== Publish
[source,bash]
----
python3 mqtt_client_publish.py
----image:client-publish.png[publish]
=== Subscribe
[source,bash]
----
python3 mqtt_client_subscribe.py
----image:client-subscribe.png[subscribe]
image:mosquitto-logs.png[mosquitto logs]