2
Getting started with MOSQUITTO After my first experiments with 2elemtry , I decided to give MOSQUITTO a try. Mosquitto is a small MQTT mess age broker , which provides basically the same functionality like 2lemetry. Here the steps, I got Mosquitto up und running on my Windows 8 machine: - Install Mosquitto from the website . To avoid any security issues I installed it in the directory c:mosquitto - Edit the existing configuration file mosquitto.conf. Uncomment the following parameters and change them bind_address 192.168.2.100 port 1883 password_file c:/mosquitto/pwfile allow_anonymous false - Open a command prompt (cmd.exe) and navigate to c:mosquitto - Create a new password file for the new user dl2sba using this command mosquitto_pas swd.exe -c pwfile XXXXXX . Enter the password YYYYYY twice. - Be sure to enable the windows firewall to let external applications access mosquitto.exe . - Start mosquitto in the command window with mosquitto.exe -v -c mosquitto.conf - Now you should see some initial output: C:mosquitto>mosquitto.exe -v -c mosquitto.conf 1400926309: mosquitto version 1.2.3 (build date 22/12/2013 13:36:32.54) starting 1400926309: Config loaded from mosquitto.conf. 1400926309: Opening ipv4 listen socket on port 1883. -  Open another command window an start the provided subscribe-client of mosquitto 1 / 2

getting-started-with-mosquitto.pdf

Embed Size (px)

Citation preview

Getting started with MOSQUITTOAfter my first experiments with2elemtry , I decided to giveMOSQUITTOa try. Mosquitto is asmallMQTT message broker, which provides basically the same functionality like 2lemetry.

Here the steps, I got Mosquitto up und running on my Windows 8 machine:

- Install Mosquitto from thewebsite . To avoid any security issues I installed it in thedirectory c:mosquitto- Edit the existing configuration file mosquitto.conf. Uncomment the following parametersand change them

bind_address 192.168.2.100port 1883password_file c:/mosquitto/pwfileallow_anonymous false

- Open a command prompt (cmd.exe) and navigate to c:mosquitto- Create a new password file for the new userdl2sba using this command mosquitto_passwd.exe -c pwfile XXXXXX. Enter the password YYYYYYtwice. - Be sure to enable the windows firewall to let external applications access mosquitto.exe. - Start mosquitto in the command window with mosquitto.exe -v -c mosquitto.conf- Now you should see some initial output:

C:mosquitto>mosquitto.exe -v -c mosquitto.conf1400926309: mosquitto version 1.2.3 (build date 22/12/2013 13:36:32.54) starting1400926309: Config loaded from mosquitto.conf.1400926309: Opening ipv4 listen socket on port 1883.

- Open another command window an start the provided subscribe-client of mosquitto 1 / 2Getting started with MOSQUITTO

C:mosquitto>mosquitto_sub.exe -t dl2sba.de/+/+ -h 192.168.2.100 -d -v -u XXXXXX -PYYYYYYClient mosqsub/5916-DL2SBA-5 sending CONNECTClient mosqsub/5916-DL2SBA-5 received CONNACKClient mosqsub/5916-DL2SBA-5 sending SUBSCRIBE (Mid: 1, Topic: dl2sba.de/+/+, QoS:0)Client mosqsub/5916-DL2SBA-5 received SUBACKSubscribed (mid: 1): 0

- In the first command windowyou should now see some additional message

1400926458: New connection from 192.168.2.100 on port 1883.1400926458: New client connected from 192.168.2.100 as mosqsub/5916-DL2SBA-5 (c2,k60).1400926458: Sending CONNACK to mosqsub/5916-DL2SBA-5 (0)1400926458: Received SUBSCRIBE from mosqsub/5916-DL2SBA-51400926458: dl2sba.de/+/+ (QoS 0)1400926458: mosqsub/5916-DL2SBA-5 0 dl2sba.de/+/+1400926458: Sending SUBACK to mosqsub/5916-DL2SBA-5

If this happens, your first steps are done.Now continue reading hwoto connect to yourMosquitto MQT server from your arduino . 2 / 2