Jakob Jackson in MATLAB Answers
上次活动时间: 2019-12-6

I am very new to this area. My small project is as follows: MCU: NXP ESP8266 module C programming language with AT Commands for ESP8266 IDE: Online Mbed Complier ThingSpeak Cloud Server My goal is simply to simply read data (measurement) from a sensor and push it to ThingSpeak cloud. Part of my code with AT commands for ESP8266 module is as follows: //Sending Data to the Cloud Server via ESP8266 WiFi Module strcpy(snd,"AT+CIPMUX=0\n\r"); //AT+CIPMUX: Enabling Single Channel Mode wifi.SendCMD(snd); wait(1); wifi.RcvReply(rcv, 1000); wait(1); sprintf(snd,"AT+CIPSTART=4,\"TCP\",\"%s\",80\n",CloudIP); //Establish TCP connection w/ Cloud Server wait(1); wifi.RcvReply(rcv, 1000); wait(1); strcpy(snd,"AT+CIPSEND=100\n\r"); //Set length of the data that will be sent wifi.SendCMD(snd); pc.printf("%s\r", rcv); wait(1); wifi.RcvReply(rcv, 1000); pc.printf("%s\r", rcv); wait(1); //Pushing the data acquired from HC-SR04 Ultrasonic Sensor to Cloud Server via API sprintf(snd,"GET https://api.thingspeak.com/update?api_key=3LV9GHWHJYDZNWEH&field1=%f \r\n\r\n", dist_percent); pc.printf("%s\r",snd); wifi.SendCMD(snd); wait(1); wifi.RcvReply(rcv, 1000); pc.printf("%s\r", rcv); Before this, I do initialization part for connecting my ESP module to my Wifi router. That works fine. No issues. Problem: I need to click on the GET link as shown in the screenshot below, in order to update my ThingSpeak cloud server. I have tried many AT commands but none seems to automatically update cloud. Everytime, I have to open terminal (TeraTerm) and then double click on the link, which then opens a new web page with just a single digit. Then after I go back to my ThingSpeak Channel dashboard, I see the new value. Else, channel does not automatically update itself. Please note that I am only updating (writing the channel), not reading from it or anything. (Screenshot with the GET link. When I double click on it, only then does my ThingSpeak Channel gets updated). Is there a way to automate this? Am I missing any AT command or anything else? I apologize, I am new to programming ESP module and ThingSpeak server. So, your help will be much appreciated. Thank you for your time.

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