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

1 Ansicht (letzte 30 Tage)
Takafumi
Takafumi am 28 Nov. 2017
Bearbeitet: michio am 28 Okt. 2019
以下のツールを活用した例をおしえてください。 MQTT in MATLAB

Akzeptierte Antwort

Takafumi
Takafumi am 28 Nov. 2017
サンプル例です。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)

Weitere Antworten (0)

Communitys

Weitere Antworten in  ThingSpeak Community

Kategorien

Mehr zu Test and Measurement finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!