MQTT

Introduction

MQTT (Message Queuing Telemetry Transport) is a lightweight publish/subscribe protocol that allows edge-of-network devices to publish to a broker. Clients connect to the broker, which then mediates communication between the two devices. When another client publishes a message on a subscribed topic, the broker forwards the message to any client that has subscribed.

MQTT provides a lightweight data transport for IOT (Internet Of Things).

Kindle Cloud Reader

Example Code

Run mosquitto on a Raspberry Pi

Install (on Linux) MQTT Explorer

Home Assistant

MQTT Spy

Node-RED (extensible graphical programming environment)

Mosquitto (MQTT broker) on Linux (Mint)

From: How to Install the Mosquitto MQTT Broker on Linux

To install the service ...

sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa
sudo apt update
sudo apt upgrade
sudo apt install mosquitto
sudo apt install mosquitto-clients
sudo apt clean

Note: By default, mosquitto is automatically started after the install.

To Stop and start the service ...

sudo service mosquitto stop
sudo service mosquitto start
sudo service mosquitto restart

   or

sudo systemctl start   mosquitto
sudo systemctl stop    mosquitto
sudo systemctl restart mosquitto

Python MQTT client library

pip install paho-mqtt
From: paho-mqqt 1.5.1

Which version of mosquitto is running?

From: stackoverflow.com/questions/26716279/how-to-test-the-mosquitto-server

mosquitto

Links

MQTT Tutorial for Raspberry Pi, Arduino, and ESP8266
(Excellent getting started tutorial; I used it.)

Mosquitto Broker (home)
Mosquitto Broker (documentation)

MQTT (home)

Python Client - documentation
Beginners Guide To The Paho MQTT Python Client
Simple Python MQTT Simulator

Using MQTT to send and receive data for your next project
MQTT client examples
Practical IOT with Steve
What is an MQTT Broker Clearly Explained (YouTube)
How to Get Started with MQTT (YouTube)
Getting Started with Home Automation Using MQTT
IoT Device Simulator (AWS)
Guide to IOT Dashboards and Platforms

Instructables: IoT - 'Intranet' of Things : Home Automation. Part 1 : IoT, Introduction
Instructables: Setting Up an MQTT Broker. Part 2 : IoT, Home Automation
Instructables: Creating Your First IoT WiFi Device. Part 3 : IoT, Home Automation
Instructables: 'Pimping' Your First IoT WiFi Device. Part 4 : IoT, Home Automation