Introducing Mosquitto broker
Eclipse MosquittoTM is an open source MQTT broker that implements the MQTT v3.1 and MQTT v.3.1.1 standards and provides a lightweight method to transport messages, allowing publish and subscription for low power sensors, mobile devices, embedded computers, and micro controllers.
You can install Mosquitto on a Raspberry Pi or on AWS instance or on a VirtualBox Linux instance directly from your Linux repository distribution; or you can get the source code and compile it yourself if you want support from websockets.
Installing from your Linux distribution repository:
- First upgrade to the latest version:
sudo apt update && sudo apt upgrade
- Then install
mosquito
:
sudo apt install mosquitto
You should see the following screen:
![](https://static.packt-cdn.com/products/9781787282629/graphics/317b56cd-c300-49f9-9c1c-897284b2d7ec.png)
Installing Mosquitto
- After installing the Mosquitto broker verify that the broker is started and install
mosquitto-clients
as follows:
![](https://static.packt-cdn.com/products/9781787282629/graphics/68631ed0-b5b8-4cfd-8857-bb91c92249d9.png)
Verify if Mosquitto is running
- Type the following command:
sudo apt install mosquitto-clients
You will get the...