Changes

Jump to: navigation, search
Installing the broker
[1] https://www.ibm.com/developerworks/cloud/library/cl-mqtt-bluemix-iot-node-red-app/
====Installing the broker====
Eclipse Mosquitto™ broker will be installed on SBC Lynx. Eclipse Mosquitto™ is an open source (EPL/EDL licensed) message broker that implements the MQTT protocol versions 3.1 and 3.1.1.
Eclipse Mosquitto™ is an open source First, we need to check the Linux distribution installed on the sbc-lynx board (EPL/EDL licensedas there are different repositories of mosquito broker for the different debian distribution) message broker that implements To check the the distribution installed on the board we use the MQTT protocol versions 3.1 and 3.1.1.command lbs_release_a
en devices and other systems 1. Login to the sbc-lynx board with root privileges ( sudo ) and run the above command  Here in below is the result after we execute the above command on the SBC-lynx board root@arm:~# lsb_release -aNo LSB modules are available.Distributor ID: DebianDescription: Debian GNU/Linux 8.7 (jessie)Release: 8.7Codename: Jessie  From the result, the debian distribution is “Jessie” 2. Import the repository package signaling key wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.keysudo apt-key add mosquito-repo.gpg.key  3.We need to demonstrate them make the reposioty available for the mqtt cd /etc/apt/sources.lit.d/  4. Add the mosquitto repository by implementing two given below commands Then one of the following, depending on which version of debian you are using:sudo wget http://repo.mosquitto.org/debian/mosquitto-wheezy.listsudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list Source.ist.d$ sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list  (Here in this case, our sbc-lynx board distribution’s debian distribution is Jessie)5. update the package List.d$ sudo apt-get update 6. Install mosquito sudo apt-get install mosquito  7. Install Mosquitto developer libraries to develop MQTT clientssudo apt-get install libmosquitto-dev8. Execute the given below command to install Mosquitto client packages$sudo apt-get install mosquitto-clients with 9. Ensure that Mosquitto broker is running$sudo service mosquitto status  10. simple test of the broker Open a terminal and issue the given below command to subscribe the topic “mqtt”1$mosquitto_sub -h localhost -t "mqtt" -vOpen another terminal and issue the given below command to publish message to the topic “mqtt”1$mosquitto_pub -h localhost -t "mqtt" -m "Hello MQTT"Now the message “Hello MQTT” will be displayed in the first terminal where the topic “mqtt” is subscribed.   Now, we can also test the functionality of the famous Broker installed broker (Mosquito), we will need two client one as a publisher and one as server) called Mosquittosubscriber.
==References==
4,650
edits

Navigation menu