Changes

Jump to: navigation, search
Configuring SBC Lynx as a MQTT broker
This example shows how to install a MQTT broker on SBC Lynx, running Debian distribution. "MQTT, a simple, lightweight, publish/subscribe messaging protocol on top of the TCP/IP protocol, is the ideal protocol for the emerging IoT world" [1] and is becoming one on the most common protocols used for machine-to-machine communications.
In contrast to HTTP with its request/response paradigm, MQTT is based on a publish/subscribe model, as depicted in the following image. This makes it suitable for "Internet of Things" messaging where even highly constrained devices are used (low power sensors, mobile devices, embedded computers, microcontrollers, etc.).
[[File:MQTT-architecture.png|thumb|center|600px]]
Publish/Subscribe way of communication is an event-driven and enables messages to be pushed to clients. The central communication point is the MQTT broker (server). It is in charge of routing all messages between the senders and the rightful receivers. Each client (sensors) that publishes (transmits) a message to the broker includes a topic into the message. The topic is the routing information for the broker. Each client that wants to receive messages subscribes to a certain topic and the broker delivers all messages with the matching topic to the client.
For more details, please refer to the publicly available resource such as [http://www.steves-internet-guide.com/mqtt/ this link].
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.
First, we need to check the Linux distribution installed The procedure was tested on the sbcan [[XUELK-lynx board (as there are different repositories of mosquito broker for the different debian distribution)To check the the distribution installed on the board we use the command lbs_release_a 1. Login to the sbcAN-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 002:_Running_Debian_distribution|SBC-lynx board root@arm:~# lsb_release -aNo LSB modules are available.Distributor ID: Lynx running DebianDescription: Debian GNU/Linux 8Jessie distribution]].7 (jessie)Release: 8.7Codename: Jessie  From the resultFirst, the debian distribution is “Jessie” 2. Import import the repository package signaling key:<pre class="board-terminal mw-collapsible mw-collapsed">
wget http://repo.mosquitto.org/debian/mosquitto-repo.gpg.key
sudo apt-key add mosquito-repo.gpg.key
</pre>3.We need to make Make the reposioty available for the mqtt:<pre class="board-terminal mw-collapsible mw-collapsed">
cd /etc/apt/sources.lit.d/
 
 
4. Add the mosquitto repository by 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.list
sudo wget http://repo.mosquitto.org/debian/mosquitto-jessie.list
 Source.ist.d$ sudo wget http:/</repo.mosquitto.org/debian/mosquitto-jessie.listpre>Install mosquito  (Here in this case, our sbc<pre class="board-terminal mw-collapsible mw-lynx board distribution’s debian distribution is Jessie)5. update the packagecollapsed"> List.d$ sudo apt-get update 6. Install mosquito sudo apt-get install mosquitomosquitto</pre>
7. Install Mosquitto developer libraries to develop MQTT clients
4,650
edits

Navigation menu