-->
Page 1 of 1

Can not connect to MQTT hub

PostPosted: Wed Feb 03, 2016 5:12 am
by Andrey Andrev
Hi, I am trying to connect my local mosquitto server using mqtt lib and following code provides no output at all:

Code: Select allm=mqtt.Client("nodemcu_box", 120)

m:connect("192.168.1.3", 1883, 0, function(conn)
    print("connected")
end)

m:publish("hello/world","hello from nodemcu",0,0, function(conn)
    print("sent")
end)


but I can send messages to the broker using console client

Code: Select all$ mosquitto_pub -h 192.168.1.3 -p 1883 -d -t hello/world -m "hello"


and receive it if I subscribe to topic.

What might be the reason why it is not working from nodemcu?

Re: Can not connect to MQTT hub

PostPosted: Tue Feb 16, 2016 6:06 am
by Viriato
Hi,
I have the same issue , did you found a solution ?
My setup is the following :
- I am using Pi 2 as a broker , with mosquito installed
- client on PC - work correctly both ways
- client on Android - work correctly both ways

But Can't connect with ESP8266 - firmware 0.9.6
Any suggestion on this issue ?

Thanks