In order to make better use of nodemcu to complete more interesting IOT project,we will learn what is MQTT and what is the psbcubclient in this lesson.For those who already familiar with MQTT / Pubsubclient can skip following peragraph,for biginers read for these introduction.
MQTT is a machine-to-machine (M2M)/”Internet of Things” connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport.In a simple language when you want to communicate to your controller through mobile or a web browser you need a communication protocol and MQTT does that magic.MQTT is a message queuing telemetry transport. It is specifically designed for automation.
MQTT works on publish subscribe events. It requires MQTT broker in between. It is very vast subject. To learn more about MQTT visit MQTT.org/MQTT Wiki.
Some links to articles and tutorials can be found via the legacy Documentation page. — FIXME these should move into the [technical articles](technical articles) and [blog posts](blog posts) pages
The legacy Frequently Asked Questions page also has some useful material if you are getting started. — FIXME these should be migrated into the questions page
It is a library provides a client for doing simple publish/subscribe messaging with a server that supports MQTT.
MQTT_MAX_PACKET_SIZE
inPubSubClient.h
.MQTT_KEEPALIVE
in PubSubClient.h
.MQTT_VERSION
inPubSubClient.h
.The latest version of the library can be downloaded from GitHub.
The library comes with a number of example sketches. See File > Examples > PubSubClient
within the Arduino application.
Full API Documentation
The library uses the Ethernet Client for Arduino api for interacting with the underlying network hardware. This means it Just Works with a growing number of boards and shields, including:
YunClient
in place of EthernetClient
, and be sure to do a Bridge.begin()
firstMQTT_MAX_TRANSFER_SIZE
define in PubSubClient.h
.
DownLoad Url osoyoo.com