This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

MQTT Basics

MQTT is a publish/subscribe architecture that is developed primarily to connect bandwidth and power-constrained devices over wireless networks. It is a simple and lightweight protocol that runs over TCP/IP sockets or WebSockets. MQTT over WebSockets can be secured with SSL. The publish/subscribe architecture is event-driven that enables messages to be pushed to the client devices. The MQTT broker is the central point of communication, and it is in charge of dispatching all messages between the senders and the rightful receivers. A client is any device that connects to the broker and can publish or subscribe to topics to access the information. A topic contains the routing information for the broker. Each client that wants to send messages publishes to a certain topic, and each client that wants to receive messages subscribes to a certain topic. The broker delivers all messages with the matching topic to the appropriate clients.

ThingSpeak™ has an MQTT broker at the URL and port 1883. The client devices communicate with the ThingSpeak broker as shown in this diagram:

To send a CONNECT request to the ThingSpeak MQTT broker, configure the MQTT client as shown in MQTT Client Configuration . If the connection is successful, the ThingSpeak MQTT broker responds with a CONNACK - connection acknowledge message. To learn more about these messages, see MQTT v3.1.1 specification. You can then publish messages to topics using the form Publish to a Channel Feed that publishes to a channel feed or to topics of the form as mentioned in Publish to a Channel Field Feed that publishes to a channel field.

Related Topics

External Websites

Was this topic helpful?