Error using thingSpeakWrite Expected a string scalar or character vector for the parameter name.
조회 수: 3 (최근 30일)
이전 댓글 표시
I need to send data from MATLAB output to a field on ThingSpeak?
this is my current code.......
% Enter your MATLAB Code below
opts = weboptions('Timeout',15);
data = webread('https://api.thingspeak.com/apps/thinghttp/send_request?api_key=PC4EOCTMNDPPQOSW',opts)
writeChannelID = xxxxx;
% TODO - Enter the Write API Key between the '' below:
writeKey = 'xxxxxxxxxx';
thingSpeakWrite(writeChannelID, data, writeKey);
but it comes up with this in the output????
Lounge_Temp
18
Loft_Temp
6
Lounge_Humidity
62
Loft_Humidity
88
' must be a string scalar or character vector that can represent a field name.
Any ideas how to fix?
댓글 수: 0
채택된 답변
ES
2018년 1월 20일
Isnt this the API ? You missed the 'WriteKey' key in your API call?
thingSpeakWrite(channelID, data, 'WriteKey', writeAPIKey)
댓글 수: 1
Hans Scharler
2018년 2월 16일
추가 답변 (0개)
커뮤니티
더 많은 답변 보기: ThingSpeak 커뮤니티
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!