Making MQTT data visible in ThingSpeak

조회 수: 9 (최근 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 CenterFile Exchange에서 ThingSpeak에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by