Status show updated time but data not showing in channel
32 views (last 30 days)
Show older comments
Hi, my channel upated time showed current time and date, but data did not appear in channe and last entry was 5 hours ago
10 Comments
André
ungefär en timme ago
@Vinoid, Thanks for your interest regarding this problem. Yes, the problem ist still existent. Please refer to my seperate 'answer'.
André
ungefär en timme ago
Oh, but now after writing this. I restarted the test. and everything worked fine!
So I cannot say if it is gone forever, but by now...
Answers (2)
Christopher Stapels
on 12 Jun 2025
Glad you got your data stream working again. Since I didn't see any change in behavior in any of my channels, I suspect it has something to do with your system Often network connectivity for devices can be unpredictable. You may be able to add tracking of signal strength into your code.
Its rare but I have heard of devices having long tern connectivity issues, if your code is written to never reconnect, that may be an issue. Most of the times I saw those type of errors, it was fixed in the wifi library. knowing the hardware you are using might help.
One more possibility is that whatever sensor data you are mesuring could have changed. For example, if you were measuring tempuratere, and it got really hot, then you might have an extra character in the temperature that would change the nature of the psot and possible break it. If you share more information about your process, it would help diagnose the issue.
4 Comments
André
ungefär 2 timmar ago
I tried to illustrate the problem with an example yesterday evening. Sorry for using the answer function but I felt to have not enougth space in the comment function for this large example.
Therefore I created a new channel and implemented more or less following.
- show actual rows: 44
- insert 4 rows
- show actual rows: 44
- insert a single row
- show actual rows: 45
- wait for the missing rows
- ... about three hours later
- show actual rows: 49
I think this delay isn't normal and I guess I would have detected it in my project. Any help is apreciated.
Example Script:
% Access Keys for the data
ChID= 3206566; %new Test Channel
RKey= 'xxxxx';
WKey= 'xxxxx';
% Parameter
batchSize= 4;
% Get current state
data= thingSpeakRead(ChID, ReadKey=RKey, NumDays=10, OutputFormat='TimeTable');
rows= size(data, 1);
fprintf('%s, Rows before batch test: %i\n', datestr(now), rows)
targetRows= rows+batchSize+1;
% Write batch test
ts= datetime('now')-minutes(batchSize-1):minutes(1):datetime('now');
val= randi(10,numel(ts),3);
result= thingSpeakWrite(ChID, Values=val, TimeStamp=ts, WriteKey=WKey)
pause(20); %to ensure 15s before next write
% Get state after batch test
data= thingSpeakRead(ChID, ReadKey=RKey, NumDays=10, OutputFormat='TimeTable');
rows= size(data, 1);
fprintf('%s, Rows after batch test: %i\n', datestr(now), rows)
% Write single row test
ts= datetime('now');
val= [9 9 9];
result= thingSpeakWrite(ChID, Values=val, TimeStamp=ts, WriteKey=WKey)
% Get state after single row test
data= thingSpeakRead(ChID, ReadKey=RKey, NumDays=10, OutputFormat='TimeTable');
rows= size(data, 1);
fprintf('%s, Rows after single row test: %i\n', datestr(now), rows)
% wait for rows reaching the table
while rows<targetRows
data= thingSpeakRead(ChID, ReadKey=RKey, NumMinutes=24*60, OutputFormat='TimeTable');
rows= size(data, 1);
fprintf('%s, Current rows: %i\n', datestr(now), rows);
pause(120);
end
fprintf('%s, Now all rows can be found: %i\n', datestr(now), rows)
% print inserted data
data(end-batchSize:end,:)
Output
17-Dec-2025 20:54:07, Rows before batch test: 44
result =
'{"success":true}'
17-Dec-2025 20:54:28, Rows after batch test: 44
result =
struct with fields:
Field1: '9'
Field2: '9'
Field3: '9'
Field4: []
Field5: []
Field6: []
Field7: []
Field8: []
Latitude: []
Longitude: []
ChannelID: 3206566
Created: 17-Dec-2025 20:54:28
LastEntryID: 45
Altitude: []
17-Dec-2025 20:54:28, Rows after single row test: 45
17-Dec-2025 20:54:28, Current rows: 45
17-Dec-2025 21:02:29, Current rows: 45
17-Dec-2025 21:04:29, Current rows: 45
17-Dec-2025 21:06:29, Current rows: 45
...
17-Dec-2025 23:54:30, Current rows: 49
17-Dec-2025 23:56:30, Now all rows can be found: 49
ans =
5×3 timetable
Timestamps Spalte1 Spalte2 Text3
____________________ _______ _______ _____
17-Dec-2025 20:51:07 9 7 10
17-Dec-2025 20:52:07 10 1 10
17-Dec-2025 20:53:07 2 3 2
17-Dec-2025 20:54:07 10 6 10
17-Dec-2025 20:54:28 9 9 9
1 Comment
André
ungefär en timme ago
After posting this I had a completely nice run of this test. But the output of the next one is completely strange! The rows become randomly less again. It looks like thingspeak has some long lasting synchronization problems on its backbone servers. The script is still running, for more the 10 Minutes already.
New output:
18-Dec-2025 10:15:40, Rows before batch test: 54
result =
'{"success":true}'
18-Dec-2025 10:16:01, Rows after batch test: 57
result =
struct with fields:
Field1: '9'
Field2: '9'
Field3: '9'
Field4: []
Field5: []
Field6: []
Field7: []
Field8: []
Latitude: []
Longitude: []
ChannelID: 3206566
Created: 18-Dec-2025 10:16:01
LastEntryID: 58
Altitude: []
18-Dec-2025 10:16:01, Rows after single row test: 53
18-Dec-2025 10:16:01, Current rows: 50
18-Dec-2025 10:18:02, Current rows: 50
18-Dec-2025 10:20:03, Current rows: 50
...
Communities
More Answers in the ThingSpeak Community
See Also
Categories
Find more on Write Data to Channel in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!