MATLAB Answers

Help with basics - cant even copy data to another field

34 views (last 30 days)
Denis Lukashevich
Denis Lukashevich on 26 Dec 2020 at 21:54
Commented: Vinod on 29 Dec 2020 at 19:04
Hi. I want to use matlab to calculate some data from my channel and send it ti new field. But even simple code cannot be done. What i do wrong? Every time i getting error : "URL is incorrectly formed, or the requested feature is not supported in this version of ThingSpeak". Here it is (channel is private):
readChannelID = 1071866;
writeChannelID = 1071866;
humidityFieldID = 1;
readAPIKey = 'xxxx';
writeAPIKey = 'yyyyy';
[hum1,time] = thingSpeakRead(readChannelID,'Fields',[humidityFieldID],'ReadKey',readAPIKey);
thingSpeakWrite(writeChannelID, hum1,'Fields',5,...
'TimeStamps', timestamps,'WriteKey',writeAPIKey);

  0 Comments

Sign in to comment.

Answers (1)

Christopher Stapels
Christopher Stapels on 28 Dec 2020 at 20:41
Edited: Christopher Stapels on 29 Dec 2020 at 19:03
Timestamps in a channel must be uniqiue. Once written, you cannot edit a feed. A feed is the collection of a timestamp and the associated fields at that timestamp. You are trying to write data with the same timestamp as existing data to the channel. You would need to clear the channel to be able to write that data again. At the time that you write the first data point, you can simultaneously write all 8 fields, but not after you have written the feed.

  1 Comment

Vinod
Vinod on 29 Dec 2020 at 19:04
To add to what Christopher said, if you are looking to modify the historical data in a channel, you can do that by writing out the modified entries to a new channel.

Sign in to comment.

Products

Communities

More Answers in the  ThingSpeak Community

Community Treasure Hunt

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

Start Hunting!