2016/06/22

Install MQTT Broker Mosquitto on Raspberry Pi

I have installed the MQTT Broker Mosquitto on my Raspberry Pi Model B+ with Raspbian Jessie pre-installed following the procedure described below a few days ago. The version of Mosquitto installed is 1.4.9 supporting both MQTT protocol 3.1 and 3.1.1.

It is stated on module page of  NodeMCU documentation website ( https://nodemcu.readthedocs.io/en/master/en/modules/mqtt/ )that:

"The client adheres to version 3.1.1 of the MQTT protocol. Make sure that your broker supports and is correctly configured for version 3.1.1. The client is backwards incompatible with brokers running MQTT 3.1."

1. Update your packages:

sudo apt-get update
sudo apt-get upgrade

2. To use the new repository, import the repository package signing key:

wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
sudo rm mosquitto-repo.gpg.key

3. Make the repository available to apt:

cd /etc/apt/sources.list.d/

4. Install the packages list for your version of Raspbian.

For Wheezy (old version)

sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.list

For Jessie (latest version)

sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list

5. Update apt information and install Mosquitto:

sudo apt-get update
sudo apt-get install mosquitto mosquitto-clients

No comments:

Post a Comment