Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Connecting to MQTT on NodeMCU
-- Create an MQTT client with a 2m keep-alive interval.
client = mqtt.Client(wifi.sta.getmac(), 120)
-- Connect to the broker
"", -- broker hostname
1883, -- default MQTT port
0, -- no security
function(client) -- on-connect callback
print ("connected.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.