-->
Page 5 of 17

Re: MQTT for NodeMCU Lua working NOW

PostPosted: Sat Jan 17, 2015 7:34 pm
by papagenic
Hello,

I have tested this and I have been able to send and receive MQTT messages in a matter of minutes. This is great stuff Thanks a lot.
Will try to do more extensive testing

Re: MQTT for NodeMCU Lua working NOW

PostPosted: Sun Jan 18, 2015 9:08 am
by PuceBaboon
wouter011 wrote:Works flawlessly when using minicom for entering LUA. Still having some problems using luatool.py tough.. Keep up the good work!


Wouter, make sure you quit minicom before trying to upload files with luatool, they
can't coexist on the same com.

Re: MQTT for NodeMCU Lua working NOW

PostPosted: Sun Jan 18, 2015 3:15 pm
by gwizz
Just in case it helps anyone else - the standard port for MQTT is 1883 - see http://mqtt.org/faq

Also I had to remove the / at the start of the topic to get it working.

EDIT - I now realise you don't have to remove the / - it's just part of the topic name if you use it.

So the send commands become:
Code: Select allmqtt:connect(1883,my.ip.address.or.domain.name.com)
mqtt:send("topic","Hello from ESP8266.com example!",0,0, function(conn) print("sent") end)

Re: MQTT for NodeMCU Lua working NOW

PostPosted: Sun Jan 18, 2015 4:28 pm
by ampakinetic
I found it needed time between the commands for it to work with test.mosquitto.org - ie running all the sample lines in one batch doesn't work, but running them one at a time subscribed to the topic successfully.