MQTT with BeagleBone and ESP8266 – Mosquitto installation on Beaglebone

After summarizing the architecture that we are implementing in the previous article

 Mqtt with Beaglebone and ESP8266-Architecture

We proceed now with the installation of the MQTT broker on Beaglebone Black with the following version of Debian

The image used is the following

Beaglebone Black Image

We proceed to the configuration as described in the article

Debian sd card setup for Beaglebone Black

Proceed to extend the space on the SD card  with the application gparted in a linux host or using the grow_partition.sh tool on BeagleBone in the /opt/scripts/tools folder

Performing the upgrade with this image we have  had space issue with 4Gb partition.

The message broker we’ll use is  mosquitto

Mosquitto

The version of Mosquitto with Debian Jessie  doesn’t not have the Wesockets services, which we’ll use for the Dashboard. For this reason, we have to install a more recent version of Mosquitto  (or recompile it from source).

Log on as root in a command shell on BeagleBone and add the Debian testing repository

Run the following

After the installation comment  the reference of the debian testing repository  in /etc/apt/sources.list

and run

We test at this point if the server is installed correctly by running in a shell the subscription to a topic

In another command shell run the publishing on topic “topic / test”

The first shell has to show the message “Prova”

mqtt Test

With MQTT protocol we can define different QOS, as described in the  Mosquitto FAQ

QOS Mosquitto

With QoS = 0 the message is sent only once and is not required confirmation of receipt by the subscribers; the MQTT implementation in these articles is without protection with name/password or ssl channel encryption and with QOS=0.

In the next article we’ll proceed to the preparation of ESP9266 module with the Mqtt lua library inside the nodemcu firmware

MQTT with BeagleBone and ESP8266-MQTT ESP8266