-->
Page 1 of 1

pushing data to sparkfun

PostPosted: Thu Jan 21, 2016 7:12 pm
by DANBnz
I have successfully managed to set up my esp8266 and it is connected to my wifi, however I am having difficulty successfully posting data to the sparkfun server.

I'm just using the serial monitor on the arduino IDE to manually send the following commands, and it replies to each : see attached screenshot. Once I have achieved success I would make an arduino programme. I am just unable to get past this point.

Code: Select all//set multiple connections
AT+CIPMUX=1

//open tcp connection
AT+CIPSTART=4,"TCP","54.86.132.254",80

//send number of characters characters
AT+CIPSEND=4,95

//push data
GET /input/<publickey>?private_key=<privatekey>&flow=30.00&temp=45.00 HTTP/1.1

//close connection
AT+CIPCLOSE=4



Now, I have spent a couple of days trying different things but my sparkfun stream still has nothing in it from my arduino.

Please help :) thanks,

Re: pushing data to sparkfun

PostPosted: Thu Jan 21, 2016 11:16 pm
by DANBnz
Solved it.

Set the number of characters to 151,

Sent the below:
GET /input/XXXXXXXXXXXXX?private_key=XXXXXXXXXXX&flow=60.00&temp=15.00 HTTP/1.1\r\nHost: data.sparkfun.com\r\nConnection: close\r\n

Hit the serial monitor/console send button several times until the following displayed :D :

SEND OK

+IPD,4,455:HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET,POST,DELETE
Access-Control-Allow-Headers: X-Requested-With, Phant-Private-Key
Content-Type: text/plain
X-Rate-Limit-Limit: 300
X-Rate-Limit-Remaining: 298
X-Rate-Limit-Reset: 1453434907.992
Date: Fri, 22 Jan 2016 03:47:28 GMT
Set-Cookie: SERVERID=; Expires=Thu, 01-Jan-1970 00:00:01 GMT; path=/
Cache-Control: private
Transfer-Encoding: chunked

a
1 success