Making MQTT data visible in ThingSpeak
6 views (last 30 days)
Show older comments
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
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.
Answers (1)
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..
0 Comments
Communities
More Answers in the ThingSpeak Community
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!