tutorials and ruby scripts

Read my tutorials

Read my gists


Tutorial: mosquitto

Mosquitto is a lightweight MQTT broker for any linux machine.

Installation is quite simple:

1 Add repository

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

cd /etc/apt/sources.list.d/
sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list

2 Install Mosquitto server

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

3 Start Mosquitto server

service mosquitto start

4 Test your MQQT broker

On terminal 1:

mosquitto_sub -d -t hello/world

On terminal 2:

mosquitto_pub -d -t hello/world -m "Hello MQQT"

Don’t forget to open port 1883 on your firewall.