### Raspberry Pi Mosquitto

Installation Mosquitto on Raspberry Pi 2 Model B running Jessie.
Login as User pi.
Installation Steps
sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list
sudo apt-get update
sudo apt-get install mosquitto mosquitto-clients python-mosquitto
Check Mosquitto running
ps -A | grep mosq
Output example:
5723 ? 00:00:00 mosquitto
Mosquitto starts automatically after every boot
Startup script is located in: /etc/init.d/mosquitto
Mosquitto Control
sudo service mosquitto restart
sudo service mosquitto stop
sudo service mosquitto start
Mosquitto Tests
Open a first Putty Terminal, Login as User Pi and start a Subscriber (sub):
mosquitto_sub -h 127.0.0.1 -t myTopic/#
Open a second Putty Terminal, Login as User Pi and run as Publisher (pub):
mosquitto_pub -h 127.0.0.1 -t myTopic/Temp -m "23.7"
mosquitto_pub -h 127.0.0.1 -t myTopic/Temp -m "31.2"
On the first Putty Terminal (the subscriber), the result of the message issued by the second terminal (the publisher),
is shown
23.7
31.2

Changed: 2018-03-28 15:37, Category: MQTT, File: T6C221M1629.htm, ID: 1629