File Exchange にある、MQTT in MATLAB を活用して、ThingSpeak のデータを取得する方法を教えてください。

 Accepted Answer

サンプル例です。CH 12397 のWeather Station のデータを取得します。
コードの1行目については、
ThingSpeak のページで、[Account]-[My Profile]から、[MQTT API Key]を作成します。
そのKey がパスワードになります。
コードの2行目は、チャネルIDを次のように指定します。
もしプライベートなチャネルの場合は、json の後に、json/<Read key> のように追記します。
myMQTT=mqtt('tcp://mqtt.thingspeak.com','Port',1883,'Username','xxxx','Password','xxxx')
mySub = subscribe(myMQTT,'channels/12397/subscribe/json')
read(mySub)

More Answers (0)

Communities

More Answers in the  ThingSpeak Community

Categories

Find more on Test and Measurement in Help Center and File Exchange

Products

Asked:

on 28 Nov 2017

Edited:

on 28 Oct 2019

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!