Hello,

I am trying to connect XDK device to mosquitto broker(Ip 127.0.0.1) on default port 1883 but I am unable to connect. Attached is the cosole screenshot, please guide.

0 (0 Votes)
RE: Mosquitto MQTT broker connection issue
Answer
4/16/18 12:18 PM as a reply to Kedar Dahivale.
Hello Kedar,

the address 127.0.0.1 is used to address the machine itself, on which MQTT is running. It is not the IP that the machine uses to communicate with other machines (such as the XDK).

That means, you have to find out the IP of the machine that runs mosquitto. I assume that you use a Raspberry Pi (or a different Linux machine) perhaps.

First, make sure that the machine is connected to the same WiFi that the XDK is connected to, then open up a terminal and run ifconfig .

A sample output of this command would be the following:

 

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:f6:08:f8
          inet addr:192.168.10.2  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::49ea:cd27:1fea:6197/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2980383 errors:0 dropped:202 overruns:0 frame:0
          TX packets:2707054 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1395762943 (1.2 GiB)  TX bytes:2443641817 (2.2 GiB)


wlan0 is the WiFi interface on a Raspberry Pi. It is most likely wlp3s0 or something similar on other machines.

The attribute inet addr is the IP address you have to address with your XDK, to connect to the mosquitto broker.

Please tell me if this was helpful, and do not hesitate to ask further questions.

Kind regards,
Alex
0 (0 Votes)
RE: Mosquitto MQTT broker connection issue
Answer
4/16/18 2:00 PM as a reply to Alexander Sawtschuk.

Hello Sir,

Yes that was the issue I was using wrong one.. thank you.

0 (0 Votes)
RE: Mosquitto MQTT broker connection issue
Answer
4/16/18 2:51 PM as a reply to Kedar Dahivale.
Hello Kedar,

I am always glad to help.

Please do not hesitate to ask if you have further questions or concerns.

Kind regards,
Alex
0 (0 Votes)