Håkon Dahle in MATLAB Answers
上次活动时间: 2023-1-21

I use the REST API to read data from Thingspeak and this works well: https://api.thingspeak.com/channels/xxxxxx/fields/1.json?average=daily&start=2010-01-01&end=2011-01-01 This request correctly returns one value per day. However I need a monthly average - a single value per month. Ideally something like: https://api.thingspeak.com/channels/xxxxxx/fields/1.json?average=MONTHLY&start=2010-01-01&end=2011-01-01 Is there a way to achieve something like this?
Emilio Rubio Garcia in MATLAB Answers
上次活动时间: 2020-1-24

Hi, There is some kind of problem in one of my channels (Weather Station). Data is not showing in downloaded data file although channel is reflecting that there are already some records. I've recently changed POST procedure by GET in software, but it is not still showing data. Should I change anything else in code for data to appear? Thank you very much in advance for your support. Regards. Emilio Rubio.
joem in MATLAB Answers
上次活动时间: 2019-10-21

I build an arduino based device and connect a GSM900 module to it which can establish GPRS connection and visit website. Also I have created an account in thingspeak. I tested sending data to the field with the browser in my PC by visiting https://api.thingspeak.com/update?api_key=XXXXXXXXXXXXX&field1=0, and it does upload data and shows a number. But when I try to do the same thing with the arduino based device, after softSerial.println("GET https://api.thingspeak.com/update?api_key=XXXXXXXXXXXXX&field1=0"); It dosn't repond nor shows the number. Is there anything missing? The following is the arduino sketch and all the at command before the line above shows "ok" result. Also, is there a way to test this GSM900 module is able to get http? #include <SoftwareSerial.h> SoftwareSerial softSerial(51, 52);// void setup() { Serial.begin(9600); softSerial.begin(9600); Serial.println("Initing...please wait."); softSerial.println("AT+CPIN?"); delay(500); printLine(); softSerial.println("AT+CGATT?"); delay(500); printLine(); softSerial.println("AT+CIPSHUT"); delay(500); printLine(); softSerial.println("AT+CIPSTATUS"); delay(500); printLine(); softSerial.println("AT+CIPMUX=0"); delay(500); printLine(); softSerial.println("AT+CSTT=\"ZENNET\""); delay(500); printLine(); softSerial.println("AT+CIICR"); delay(3000); printLine(); softSerial.println("AT+CIFSR"); delay(1000); printLine(); //softSerial.println("AT+CIPSPRT=0"); // delay(1000); // printLine(); softSerial.println("AT+CIPSTART=\"TCP\",\"api.thingspeak.com\",\"80\""); //AT+CIPSTART="TCP","api.thingspeak.com","80" delay(3000); printLine(); softSerial.println("AT+CIPSEND"); delay(13000); printLine(); softSerial.println("GET https://api.thingspeak.com/update?api_key=XXXXXXXXXXXXX&field1=0"); delay(20000); printLine(); softSerial.println("\#026"); delay(3000); printLine(); softSerial.println("AT+CIPSHUT"); delay(500); printLine(); } void loop() { } void printLine() { String data; while (softSerial.available() > 0) { char c = softSerial.read(); data += c; } Serial.println(data); }

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