Labs

MQTT Labs

Mosquitto Intel® Edison Setup

We should have all Mosquitto MQTT tools available in latest version of Linux Yocto based version

Mosquitto Intel® Galileo Setup

root@galileo:~# wget http://mosquitto.org/files/source/mosquitto-1.3.5.tar.gz
root@galileo:~# tar xvf mosquitto-1.3.5.tar.gz
root@galileo:~# cd mosquitto-1.3.5
root@galileo:~# make -j3 WITH_SRV=no
root@galileo:~# adduser mosquitto
root@galileo:~# cd test/broker
root@galileo:~# make -j3 test
root@galileo:~# cd ../../
root@galileo:~# cp client/mosquitto_pub /usr/bin
root@galileo:~# cp client/mosquitto_sub /usr/bin
root@galileo:~# cp lib/libmosquitto.so.1 /usr/lib
root@galileo:~# cp src/mosquitto /usr/bin

Mosquitto Applications

root@board:~# mosquitto
1462105305: Error: Invalid user 'mosquitto'.
root@board:~# mosquitto_sub
Error: You must specify a topic to subscribe to.
mosquitto_sub is a simple mqtt client that will subscribe to a single topic and print all messages it . 
...
root@board:~# mosquitto_pub
Error: You must specify a topic to subscribe to.
mosquitto_sub is a simple mqtt client that will subscribe to a single topic and print all messages it .
...

Mosquitto Demo Temperature Gauge

Go to http://test.mosquitto.org/gauge/ and execute

root@platform:~# mosquitto_pub -h test.mosquitto.org -t temp/random -m 23.0

Mosquitto MQTT Server/Broker

As subscribers

root@board:~# mosquitto_sub -h test.mosquitto.org -p 1883 -t IoT101/#

As publishers

root@board:~# mosquitto_pub -h test.mosquitto.org -p 1883 -t IoT101/all -m "Hello All Operators!"

See output from the following command

root@board:~# mosquitto_sub -h test.mosquitto.org -t "#" -v

Last updated