ESP8266 NodeMCU Module – MQTT


  • mqtt.Client()  – Creates a MQTT client.
  • mqtt.client:close()  – Closes connection to the broker.
  • mqtt.client:connect() – Connects to the broker specified by the given host, port, and secure options.
  • mqtt.client:lwt( ) – Setup Last Will and Testament (optional).
  • mqtt.client:on()  – Registers a callback function for an event.
  • mqtt.client:publish()  – Publishes a message.
  • mqtt.client:subscribe()  – Subscribes to one or several topics.
  • mqtt.client:unsubscribe()  – Unsubscribes from one or several topics.


MQTT Example

  • MQTT subscribe and publish the data to


 Read and Write files using MQTT

  • transfer files over mqtt



MQTT to cloud




Next :

Previous :


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

if you have any queries call us +918300026060 or WhatsApp Dismiss


Your Cart

%d bloggers like this: