Making MQTT data visible in ThingSpeak

6 views (last 30 days)
Silvia Booij
Silvia Booij on 21 Jan 2023
Edited: Christopher Stapels on 22 Jan 2023
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 Comments
Christopher Stapels
Christopher Stapels on 21 Jan 2023
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 on 22 Jan 2023
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)?

Sign in to comment.

Answers (1)

Christopher Stapels
Christopher Stapels on 22 Jan 2023
Edited: Christopher Stapels on 22 Jan 2023
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..

Communities

More Answers in the  ThingSpeak Community

Categories

Find more on ThingSpeak in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!