i need to get the last entry of things speak using MIT app inventor and use it to determine if my microcontroller is turned off or not sending data to internet

3 Ansichten (letzte 30 Tage)
i like using thingspeak but the problem is,it always save the last data that have been sent by the arduino,so i cant detect if the arduino is truned off
btw im using esp32 ,i already established the connection between the mit app,thingspeak and esp32 .
the problem is the thingsspeak is always saving the last data ,(i also used firebase but it have the same problem)
my initial idea is to detect if the value is zero(not measuring any data) then the mit app will notify the user ,that the arduino is not connected to internet or turned off
but its not possible because it always saves the last data.
my next idea is to use mit app to determine if the last entry is not updating ,
but i dont know how i can do it, i cant also find tuturial to fix my problem xD hahah

Antworten (1)

Christopher Stapels
Christopher Stapels am 17 Nov. 2020
Does your Arduino send updates at regular intervals? You could read the last two or three data points and compare the time intervals, or compare the last posted time to the present time. You can get the present time in a MATLAB analysis using
timeNow=datetime('now');
  3 Kommentare
Christopher Stapels
Christopher Stapels am 20 Nov. 2020
Have a look at this help page on comparing datetimes.
When you read the time from ThingSpeak, you might have to convert the format. See datetime to see about changing the format.
You can see the thingSpeakRead documentation to get the last point time like this:
[data,timestamps] = thingSpeakRead(12397)

Melden Sie sich an, um zu kommentieren.

Communitys

Weitere Antworten in  ThingSpeak Community

Kategorien

Mehr zu Read Data from Channel finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by