Making MQTT data visible in ThingSpeak

11 ビュー (過去 30 日間)
Silvia Booij
Silvia Booij 2023 年 1 月 21 日
編集済み: Christopher Stapels 2023 年 1 月 22 日
My MQTT client sends different sensor data to thingspeak MQTT broker via a single MQTT device. Following the MQTT device procedure found on the Mathworks website. My MQTT client reports back no errors (100% succesfull MQTT data transmission).
But I cannot figure out how to select which data to make visible in the different ThingSpeak fields. At this moment the field in the selected channel has the name of the datafield in the MQTT message, but no data appears.
And I do not see any data when I download the Channel's feeds in CSV format.
The only work around I can think of is create via an ESP another MQTT server who retrieves the data from ThingsSpeak and sends it back to the ThingSpeak channel without using the MQTT channel (as I do with the non-MQTT devices), but this sounds silly. What is the normal method to make MQTT data visible without adding other hardware?
  2 件のコメント
Christopher Stapels
Christopher Stapels 2023 年 1 月 21 日
Look at the publish dataMQTT page to get the format. You specify field 1 data by sending field1=value in the payload of the MQTT post.
Silvia Booij
Silvia Booij 2023 年 1 月 22 日
Aha I have to add the field where I want to make it visible in the payload.
Is there an option to see which data is already received by the Thingspeak MQTT broker (a log file or a option to download that data in a CSV file)?

サインインしてコメントする。

回答 (1 件)

Christopher Stapels
Christopher Stapels 2023 年 1 月 22 日
編集済み: Christopher Stapels 2023 年 1 月 22 日
If the data is not ingested into your channel, there is not a file to see what data was sent. If the data is ingested into your channel, you can use the Read Data API or the export data in the UI.
If you have desktop MATLAB, or another service that allows you to create an MQTT broker, you could try that and then you will be able to see what is being sent to the broker from the device.
You could also use a desktop client like mqttx to send data to ThingSpeak, and then you can more easily play with the format until you get it right. There are good specific examples in the doc..

コミュニティ

その他の回答  ThingSpeak コミュニティ

カテゴリ

Help Center および File ExchangeThingSpeak についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by