Su Kyi in MATLAB Answers
上次活动时间: 2023-4-27

I'm working on SIM800L with arduino and try to read data from ThingSpeak. I can read my channel field last value (1 or 0) using AT+HTTPREAD command. But the content get from sim800L.read() is -1 not one or zero. I want to read 1 or 0 and then turn on/off LED. How to get the data of field from the response of AT+HTTPREAD? Please find the code as follows: {..... SIM800L.println("AT+HTTPPARA=\"URL\",\"http://api.thingspeak.com/channels/xxxxxxx/fields/3/last?api_key=xxxxxxxxxxxxxx\""); delay(1000); ShowSerialData(); SIM800L.println("AT+HTTPACTION=0"); delay(10000); ShowSerialData(); SIM800L.println("AT+HTTPREAD"); delay(300); ShowSerialData(); changeled(); ShowSerialData(); SIM800L.println(""); delay(100); } void changeled() { String content = ""; Serial.println(SIM800L.read()); content = content + String(SIM800L.read()); Serial.print("Content:"); Serial.println(content); }
MathWorks Internet of Things Team in MATLAB Answers
上次活动时间: 2022-11-26

I want to write information for controlling a device in my ThingSpeak channel, can I store the control parameters in ThingSpeak and read all of the paremeters at once back to the device? I'd like to be able to read multiple fields without having to make multiple calls to the ThingSpeak readfield command on my Arduino or esp32 or ESP8266. Is this possible?
Nipuna in MATLAB Answers
上次活动时间: 2020-7-6

When I use following code the answer I receive is always Average Humidity = NaN What is the reason? Is there a way to set data type in Channel fields? readChannelID = 1094383; % Humidity Field ID humidityFieldID = 1; % Channel Read API Key % If your channel is private, then enter the read API Key between the '' below: readAPIKey = 'xxxxxxxxxxxxxx'; %removed the API key % Get humidity data for the last 60 minutes from the MathWorks weather % station channel. Learn more about the THINGSPEAKREAD function by going to % the Documentation tab on the right side pane of this page. humidity = thingSpeakRead(readChannelID,'Fields',humidityFieldID,'NumMinutes',120,'ReadKey',readAPIKey); % Calculate the average humidity avgHumidity = mean(humidity); display(avgHumidity,'Average Humidity');

关于 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.