Chat freely about anything...

User avatar
By anvoice
#22016 Recently got my module configured, and able to accept server requests. I'm using the Arduino IDE and the serial connection to type commands directly from my PC to the ESP module. However, when I tried to connect to thingspeak and use a GET request to update a test channel I created, nothing happened. The connection was successful, and as far as I can see the GET request was correctly formulated:
GET /update?key=WRITEKEY&field1=2
The method to send it was to use the AT+CIPSEND="data length" command, the line above was then typed in and sent when the ">" symbol appeared. The module lists the data as sent.

Unfortunately I have very little experience with how web interfaces work in general, so I don't know how to troubleshoot this. The fact that the ESP8266 does not seem to receive a response from thingspeak.com when this statement goes through could indicate that the GET statement is actually incorrectly formed, but that's just my guess. I'd appreciate any help or hints on this. Thanks for reading.
User avatar
By NigelTwo
#22021 Some things to try while you wait for an expert to answer this:
1. Remember the two newline characters at the end of your request;
2. I have found that ThingSpeak wants more (header?) information information in this call i.e.
GET /update?key=WRITEKEY&field1=2 HTTP/1.0\n\n
Remember to calculate the length correctly for this.
User avatar
By anvoice
#22026 Edit2:
Problem solved. Turns out that because I had carriage return and newline set to automatically append to what I typed in the arduino serial, it added it to whatever command I tried to send to the server. Accounting for that solved the problem with the initial get statement I tried, no other changes (except the \n\n must be at the end). Thanks to everyone who helped.