Send "sensor error" to ThingSpeak
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello!
I'm using this simple code to send data to ThinkSpeak (ESP8266):
GET /update?key=xxxxxxxxxxxxxxxx&field1=025.0
It's working fine, no problem.
How can I send "sensor error" message to ThingSpeak? For example, the measured temeprature is out of range, unable to get temeprature data from the sensor etc. I would like to see errors in the graph, like in the attached picture. Is it possible?
Thank you!

2 commentaires
Christopher Stapels
le 22 Fév 2020
You will most likely want to use the MATLAB visualizations app to make a custom visualization.
One method would be to use the another field to write the error code. I am assuming the error comes from the sensor. If not you can also use MATLAB to pre process your data and find the mising data. (like here)
So assuming your sensor writes the errors, it can write using the same url above, but use of '&field5=myerror'
Now you can create a new MATLAB visualization from your channel view or from the pulldown apps menu.
Use thingSpeakRead to get the data fro your channel. (you can read the last few days of data or minutes, or just the last x number of points).
I'd aslo use 'outputformat' 'timetable' in the thingSpeakRead command. Then you can plot the time and the data points.
for example:
mydata=thingSpeakRead(<channelID>,'readkey','xxxxxxxxxxxxxxx','outputformat','timetable');
plot(mydata.timestamps,mydata.field1name);
text(mydata.timestamps,mydata.field5name);
I haven't tried that though. It might put NULL everywhere there is no data in field 2. Then you might have to do some extra filtering.
Réponses (0)
Communautés
Plus de réponses dans ThingSpeak Community
Voir également
Catégories
En savoir plus sur Visualize Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!