5:16 pm

September 20, 2019

Hi,
I have run into this error:
+IPD,288:HTTP/1.1 400 Bad Request
Server: awselb/2.0
Date: Fri, 20 Sep 2019 20:40:37 GMT
Content-Type: text/html
Content-Length: 138
Connection: close
400 Bad Request
This is my post data
http://api.thingspeak.com/update.json?api_key=XXXXXXXXXXXXXXX&field1=73
POST /update HTTP/1.1
Host: api.thingspeak.com
Connection: close
Content-Type: application/x-www-form-urlencoded
Content-Length: 207
CLOSED
If I copy and paste the URL into a browser, I can see the values being updated on the thingspeak.com server.
Any idea, what would be the issue ?
The log looks thus:
WIFI CONNECTED
WIFI GOT IP
OK
+CIFSR
+CIFSR:APIP,"192.168.4.1"
+CIFSR:APMAC,"ee:fa:bc:a9:1e:fd"
+CIFSR:STAIP,"192.168.1.36"
+CIFSR:STAMAC,"ec:fa:bc:a9:1e:fd"
OK
+CIPSTART="TCP","api.thingspeak.com",80
CONNECT
OK
+CIPSEND=214
OK
>
Recv 214 bytes
SEND OK
+IPD,288:HTTP/1.1 400 Bad Request
Server: awselb/2.0
Date: Fri, 20 Sep 2019 21:12:43 GMT
Content-Type: text/html
Content-Length: 138
Connection: close
400 Bad Request
CLOSED
Any suggestions ?
Thanks
6:30 pm


MathWorks
May 1, 2016

Have you considered using the ThingSpeak client libraries (https://github.com/mathworks/thingspeak-arduino) to send data to ThingSpeak? There are specific examples that show you how to do it with the Arduino, ESP8266 and the ESP32 that allow you to write higher level code. Do remember to check out the examples: https://github.com/mathworks/thingspeak-arduino/tree/master/examples
Good luck!
PS: Consider posting future questions to MATLAB Answers (linked straight off the menu at https://thingspeak.com)
Most Users Ever Online: 166
Currently Online:
27 Guest(s)
Currently Browsing this Page:
1 Guest(s)
Top Posters:
rw950431: 272
Vinod: 240
piajola: 95
turgo: 70
vespapierre: 63
Adarsh_Murthy: 62
Member Stats:
Guest Posters: 1
Members: 8665
Moderators: 1
Admins: 2
Forum Stats:
Groups: 3
Forums: 14
Topics: 1600
Posts: 5760
Newest Members:
huldacormier, bogart, estebanmateo93, mikewrite, onlinebusiness, winzy99Moderators: cstapels: 460
Administrators: Hans: 405, lee: 457