I want to send acceleration data from a mobile phone sensor to ThingSpeak. Error: URL is incorrectly formed, or the requested feature is not supported in this version of ThingSpeak.
[acc, tacc] = accellog(m);
xAcc = acc(:,1);
yAcc = acc(:,2);
zAcc = acc(:,3);
InitialTime = datetime(m.InitialTimestamp,'InputFormat','dd-MMM-yyyy HH:mm:ss.SSS');
AccelTime = InitialTime + seconds(tacc);
channelID = XXXXX;
writeKey = XXXXXXXXXX;
tStamps = AccelTime;
data=[xAcc,yAcc,zAcc];
thingSpeakWrite(channelID,data,'TimeStamp',tStamps,'WriteKey',writeKey)

댓글 수: 2

Vinod
Vinod 2021년 11월 5일
What version of MATLAB are you using?
sicajios dsgvbdgs
sicajios dsgvbdgs 2021년 11월 5일
R2021b

댓글을 달려면 로그인하십시오.

답변 (1개)

Vinod
Vinod 2021년 11월 6일

0 개 추천

Thingspeak can only accept data sampled at 1hz or lower frequency. That is, tStamps should be at least 1s apart. My initial guess is that your accelerometer data is sampled at a much higher rate.

댓글 수: 8

sicajios dsgvbdgs
sicajios dsgvbdgs 2021년 11월 6일
When I set the sampling rate to 1 Hz, more than one value per second is recorded. How to solve this?
For the position sensor everything works. The error occurs when writing data from the other sensors.
[lat, lon, t, speed, course, alt, horizacc] = poslog(m);
InitialTime = datetime(m.InitialTimestamp,'InputFormat','dd-MMM-yyyy HH:mm:ss.SS');
PosTime = InitialTime+seconds(t);
channelID = XXXXXX;
writeKey = XXXXXXXXXXXXX;
tStamps = PosTime;
data=[lat,lon,alt,speed];
thingSpeakWrite(channelID, data,'TimeStamp',tStamps,'WriteKey',writeKey);
Christopher Stapels
Christopher Stapels 2021년 11월 9일
Perhaps consider using retime:
newData=retime(myData,'secondly','mean');
sicajios dsgvbdgs
sicajios dsgvbdgs 2021년 11월 10일
This function solved the problem. Thank you.
sicajios dsgvbdgs
sicajios dsgvbdgs 2021년 11월 11일
Is it possible to record data in real time without a paid licence? I am using a loop for this, but I get the error 'requests are too frequent'.
Vinod
Vinod 2021년 11월 11일
"Real time" means different things for different people. An RF engineer who is measuring phenomena in the Ghz or Thz range has a very different defintion of real time than does an engineer measuring heat transfer across a large body with high thermal capacity.
What is the timescale of the phenomena you are measuring? If you are looking to store raw accelerometer data at over 1Hz, you might be better served by something like the Arduino IO support package. If you are looking to do some feature detection on the edge node based on accelerometer data and send the feature changes to the cloud, when the rate of change of the features are at a longer timescale, ThingSpeak can meet your needs.
If you give more detail of your project someone can guide you towards the right solution.
sicajios dsgvbdgs
sicajios dsgvbdgs 2021년 11월 12일
I want to update the accelerometer data on ThingSpeak every 1 second.
Vinod
Vinod 2021년 11월 12일
That is possible.
If you have an unstable or slow internet connection, it might be that the data you send from your device does not reach the servers exactly 1s apart. You might want to add a 5-10% buffer to factor in network latencies.

댓글을 달려면 로그인하십시오.

커뮤니티

더 많은 답변 보기:  ThingSpeak 커뮤니티

카테고리

도움말 센터File Exchange에서 ThingSpeak에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

2021년 11월 5일

댓글:

2021년 11월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by