cesc bonet in MATLAB Answers
上次活动时间: 2025-2-28

good morning!, I'm learning in MatlLab and ThingSpeak, and I'm a bit lost ... I have a variable that changes state from 0 to 1. And I want to know how I can calculate the times it changes state, and the time that remains for Example in state 1. Can you help me? Thank you so much
Niklas Maximilian Busse in Discussions
上次活动时间: 2022-8-18

Hi everyone, I want to know how much time my data takes from uploading it to a thingspeak channel until the channel receives the data. Therefore I am sending a unix timestamp as data to my thingspeak channel. When ThingSpeak receives the datapoint, it creates a timestamp itself called "created_at". But this "created_at" timestamp measures only seconds, while the unix timestamp, that is sent as data, measures milliseconds. Because of this, it can happen, that the unix timestamp in the data is bigger than the "created_at" timestamp from thingspeak, which makes no sense. Does anybody know if there is a way that the "created_at" timestamp also measure milliseconds? Or if there is a better way to measure the latency between my system and ThingSpeak? How to get exact "created_at" timestamps in thingspeak? You can get the system time in a MATLAB analysis script (for example using datetime('now'); and also use thingSpeakWrite to write data to the channel. You can use a field to store higher precision than the created_at timestamp. Thanks for your reply! But do I get it right, that when I use MATLAB Analysis I have to use for example thingSpeakRead which also takes some time? The problem with this would be that I want to know the exact timestamp, when my data "arrives" to the thingSpeak Channel. Sure there will be other delays involved, but you could probably back out some estimates by doing a bunch of measurements over time and taking averages. You can aslo use webread() and the GET REST command to get data from ThingSpeak. MQTT has the fastest response time. I tried to to it with MATLAB Analysis, but sometimes my results are very strange. c = 0; culum_delay = 0; lastMatlabValue = 0; limit = 5; cumul_diff = 0; while c < limit c = c + 1; data = thingSpeakRead(readChannelID, 'ReadKey', readAPIKey); fprintf('Data: %8f\n', data); time = datetime("now",'TimeZone', 'Europe/Berlin'); timestamp = posixtime(time); fprintf('time: %8f\n', timestamp) if isnan(data) || data == lastMatlabValue continue end diff = timestamp - data; fprintf('Diff: %8f\n', diff); lastMatlabValue = data; pause(0.5); end This is my MATLAB Analysis script. From my local matlab environment I upload the current timestamp every second on my thingspeak channel. The shown MATLAB Analysis script reads the latest datapoint that was uploaded and creates a timestamp after that. This timestamp (you can see it in the code as 'timestamp') should be later than the timestamp that was loaded from the thingspeak channel. But sometimes it is smaller (aka older timestamp) than the data that was loaded. This makes no sense to me, so do you see anything that I overlooked? timestamp milliseconds latency
Iftikhar in MATLAB Answers
上次活动时间: 2021-11-17

Hi, I am analysing sensor data downloaded from thingspeak API and my goal is to somehow take all 4 channels data and merge them into 1. Does anyone know at what point thingspeak server (during data upload from device) attached created_at? At the time when data received at the server? At the time when we data is ingested into thingspeak data store? I am assuming that there can be delay between data being received at thingspeak server vs. data ingested into thingspeak data store.
avner gideobi in MATLAB Answers
上次活动时间: 2020-4-30

Using bulk upload in a CSV format to store IoT logs onto Thinkspeak. My IoT (ESP32) will bulk upload few (~10) lines by the end of a cycle, once in about an hour. However, ont he time line (both on automatic charts and on export) it seems that the lines are spread on over an hour, so actually I have no idea when this is really happened. the two following pictures demonstrates it well: both "points" where reported at the same time using a simple bulk update call, but reported like it was posted 40 minutes apart. this is consistent with the data exported in the export function. However there, it is 10-15 seconds shifted from the time on the chart... (?!?!!?) Why is the timestamp incorrect and spead over time ? How can I make sure I get the correct timestamp to a log submitted ? thanks!
Gayan Rahthnayaka in MATLAB Answers
上次活动时间: 2019-11-22

I have a thigspeak channel which triger an event as 1 with its time stamp. what i need is to plot date in x axis and time in y axis fom the timestamps when the event detected. (to figure out the date and the time of occurance of each event.) can someone please help me with this.
Zdenek Svezen in MATLAB Answers
上次活动时间: 2019-11-18

Hello, I have this in ThingHTTP body: {"src":"013025819299","dst":"+420605555555","text":"ALARM"} It works fine, but I need to insert timestamp inside it, like this: {"src":"013025819299","dst":"+420605555555","text":"ALARM at %%timestamp%%"} Is it possible? How to do it?
monimi in MATLAB Answers
上次活动时间: 2019-9-12

Hello, I have a wrong time in my thingspeak charts.So i have in my account profile changed the time zone. But nothing changes. Have also created a new channel the same problem. What am I doing wrong

关于 ThingSpeak

The community for students, researchers, and engineers looking to use MATLAB, Simulink, and ThingSpeak for Internet of Things applications. You can find the latest ThingSpeak news, tutorials to jump-start your next IoT project, and a forum to engage in a discussion on your latest cloud-based project. You can see answers to problems other users have solved and share how you solved a problem.