Use MQTT to Send IoT Data to ThingSpeak
MQTT is a common protocol used in IoT systems to connect low-level devices and sensors. MQTT is used to pass short messages to and from a broker. ThingSpeak has recently added an MQTT broker so devices can send messages to ThingSpeak. A message might contain the current temperature in an office collected by a sensor. ThingSpeak takes the message and stores its content in a ThingSpeak channel. Once the data is in a channel, you can easily visualize and analyze the data with MATLAB code.
The ThingSpeak MQTT broker is available now to all ThingSpeak users!
To help users get started using MQTT to send data to ThingSpeak, we have created some examples for common devices and applications that support MQTT.
- Use Arduino Client to Publish to a Channel – Publish data to a ThingSpeak channel using an Arduino® device
- Use Desktop MQTT Client to Publish to a Channel – Publish to a channel using desktop MQTT client such as MQTT.fx
- Use Particle Photon Client to Publish to a Channel – Publish data to a ThingSpeak channel using a Particle Photon device
- Use WebSockets to Publish to a Channel – Publish data using WebSockets to a ThingSpeak channel
If your device or application is not able to use MQTT directly, we have also enabled WebSockets. Using MQTT over WebSockets allows devices to use the MQTT protocol to send messages behind a firewall. We also support secure sockets to encrypt the messages that are being sent to ThingSpeak.
To learn how to use MQTT with ThingSpeak, please review our documentation. Let us know what you build with this new capability.
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.