5.6: Mosquitto MQTT broker : up and running
Created by ppatierno on 11/14/2013 3:56:28 PM

From MQTT official web site (http://mqtt.org/wiki/doku.php/brokers) we can see that there are a lot of brokers we can use on a PC. The one we have choosen is Mosquitto because it is free, it has a lot of features and it is also available as a convenient installer for the Windows environment that we can download from its web site (http://mosquitto.org/).


Mosquitto MQTT broker : up and running

From MQTT official web site (http://mqtt.org/wiki/doku.php/brokers) we can see that there are a lot of brokers we can use on a PC. The one we have choosen is Mosquitto because it is free, it has a lot of features and it is also available as a convenient installer for the Windows environment that we can download from its web site (http://mosquitto.org/).

Fig5.3

Figure 5.3 : Mosquitto broker web site to download Windows installer

In the “Downloads” section we can find two binaries for Windows : the former uses an installer with the broker compiled natively and we can use it for Windows Vista and up; the latter is based on Cygwin that provides a Linux-like environment for Windows and we can use it for Windows XP and up. Using a Windows 7 virtual machine (or a real PC), the installation is really simple because we can choose only if we want Mosquitto installed as a Windows Service and the destination folder. For our examples, we can avoid to install the broker as a Windows Service because we will run it manually.

Fig5.4

Figure 5.4 : Not install Mosquitto as a Windows Service

Fig5.5

Figure 5.5 : Choose the destination folder

After installation, inside destination folder, there are three main executable files :

  • mosquitto.exe : the broker itself;
  • mosquitto_sub.exe : a console application that act as a subscriber;
  • mosquito_pub.exe : a console application that act as a publisher;

Furthermore, there is a template for the configuration file (mosquito.conf) with all parameters for the broker but we will run Mosquitto passing it only the main parameters on the command line without use this configuration file. Open a command prompt within Mosquitto installation folder; typing mosquitto -h we can see the parameters that the broker accepts on the command line. For complex configuration we need to use –c config_file parameter but for our examples we can simply type mosquitto –p 1883 –v; in this way, we specify default MQTT port number and verbose mode to enable logging.

Now we have a Mosquitto broker up and running on our machine !

Fig5.6

Figure 5.6 : Mosquitto broker up and running

If we want to stop the broker, we need to type the CRTL+C sequence.

rating
  Comments


Turkish porno izle video site in rokettubeporno izle