Setting up the Raspberry Pi for MQTT
Mosquitto is a software that acts as the MQTT communication broker. The software is responsible to ensure the messages from the connected devices are received and delivered to the correct recipients. The Mosquitto server can installed on the Raspberry Pi using the following terminal instructions (For Raspbian-Jessie sketch). (More details can be found on this Instructable)
wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquitto-repo.gpg.key
sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list
sudo apt-get install mosquitto -y
sudo apt-get install mosquitto-clients -y
The Eclipse Paho MQTT client library was also installed in order to allow the raspberry pi to connect to mosquitto as a client.
sudo pip install paho-mqtt
Setting up the ESP-8266
Similar to the Raspberry Pi, the ESP8266
processor was also set up for MQTT communication using a library developed by
Adafruit to act as an MQTT Client, “Adafruit MQTT Library”. Using the pre-defined
functions in this library, the code was written to communicate over MQTT.
No comments:
Post a Comment