{"id":1998,"date":"2017-01-20T18:28:10","date_gmt":"2017-01-20T23:28:10","guid":{"rendered":"https:\/\/blogs.mathworks.com\/iot\/?p=1998"},"modified":"2017-01-20T20:07:25","modified_gmt":"2017-01-21T01:07:25","slug":"use-mqtt-to-send-iot-data-to-thingspeak","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/iot\/2017\/01\/20\/use-mqtt-to-send-iot-data-to-thingspeak\/","title":{"rendered":"Use MQTT to Send IoT Data to ThingSpeak"},"content":{"rendered":"<p><a href=\"https:\/\/www.mathworks.com\/help\/thingspeak\/mqtt-basics.html\">MQTT<\/a> 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.\u00a0<a href=\"https:\/\/thingspeak.com\">ThingSpeak<\/a>\u00a0has 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.<\/p>\n<p>The ThingSpeak MQTT broker is available now to all ThingSpeak users!<\/p>\n<p><a href=\"https:\/\/www.mathworks.com\/help\/thingspeak\/mqtt-api.html\"><img decoding=\"async\" loading=\"lazy\" width=\"530\" height=\"275\" class=\"aligncenter size-full wp-image-1999\" src=\"https:\/\/blogs.mathworks.com\/iot\/files\/2017\/01\/ThingSpeak_MQTT_Broker.png\" alt=\"\" \/><\/a><\/p>\n<p>To help users get started using MQTT to send data to ThingSpeak, we have created some <a href=\"https:\/\/www.mathworks.com\/help\/thingspeak\/mqtt-api.html\">examples<\/a> for common devices and applications that support MQTT.<\/p>\n<ul>\n<li class=\"add_margin_0\"><strong><a href=\"https:\/\/www.mathworks.com\/help\/thingspeak\/use-arduino-client-to-publish-to-a-channel.html\">Use Arduino Client to Publish to a Channel<\/a>\u00a0<\/strong>&#8211; Publish data to a ThingSpeak channel using an Arduino<sup>\u00ae<\/sup> device<\/li>\n<li class=\"add_margin_0\"><strong><a href=\"https:\/\/www.mathworks.com\/help\/thingspeak\/use-desktop-mqtt-client-to-publish-to-a-channel.html\">Use Desktop MQTT Client to Publish to a Channel<\/a>\u00a0<\/strong>&#8211; Publish to a channel using desktop MQTT client such as MQTT.fx<\/li>\n<li class=\"add_margin_0\"><strong><a href=\"https:\/\/www.mathworks.com\/help\/thingspeak\/use-photon-client-to-publish-to-a-channel.html\">Use Particle Photon Client to Publish to a Channel<\/a>\u00a0<\/strong>&#8211; Publish data to a ThingSpeak channel using a Particle Photon device<\/li>\n<li class=\"add_margin_0\"><strong><a href=\"\">Use WebSockets to Publish to a Channel<\/a>\u00a0<\/strong>&#8211; Publish data using WebSockets to a ThingSpeak channel<\/li>\n<\/ul>\n<p>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.<\/p>\n<p>To learn how to use MQTT with ThingSpeak, please review our <a href=\"https:\/\/www.mathworks.com\/help\/thingspeak\/mqtt-api.html\">documentation<\/a>. Let us know what you build with this new capability.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/iot\/files\/2017\/01\/ThingSpeak_MQTT_Broker.png\" onError=\"this.style.display ='none';\" \/><\/div>\n<p>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.\u00a0ThingSpeak\u00a0has recently added an MQTT broker so&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/iot\/2017\/01\/20\/use-mqtt-to-send-iot-data-to-thingspeak\/\">read more >><\/a><\/p>\n","protected":false},"author":148,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[238,239],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/posts\/1998"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/users\/148"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/comments?post=1998"}],"version-history":[{"count":2,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/posts\/1998\/revisions"}],"predecessor-version":[{"id":2004,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/posts\/1998\/revisions\/2004"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/media?parent=1998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/categories?post=1998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/iot\/wp-json\/wp\/v2\/tags?post=1998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}