Question: Set up the GPRS shield for Thingspeak?

Help others to get forum honor. [Detail]

Question: Set up the GPRS shield for Thingspeak?

by Jacket Chen » Mon Dec 22, 2014 11:50 am

Product:GPRS Shield

Question description: viewtopic.php?f=23&t=5588

Bounty: +10 points & +3~5 dollars coupon
Love little, love long.
User avatar
Junior-6
Junior-6
 
Posts: 665
Joined: Thu Jun 21, 2012 4:25 pm
Location: China

Re: Question: Set up the GPRS shield for Thingspeak?

by squeck94 » Wed Dec 24, 2014 7:44 pm

I can't test this since I don't have a GPRS shield, but to send data to Thingspeak you need to send a string to the Thingspeak server using either GET or POST method. More info here: http://community.thingspeak.com/documentation/api/

Please try this example based on GET method: it's just the part of the code that sends the data.

Please tell me if it works!

Code: Select all
char *API = "YOUR_API_KEY_HERE";
char *value1 = "123";
char *value2 = "456";
char finalStr[50]; //modify this accordingly to the length of your string

sprintf(finalStr, "GET /update?api_key=%s&field1=%s&field2=%s", API, value1, value2);

Serial.println("AT+CIPSTART=\"tcp\",\"api.thingspeak.com\",\"80\"");
delay(2000);
Serial.println("AT+CIPSEND");
delay(2000);

Serial.println(finalStr);

delay(2000);

Serial.println((char)26); //send termination character

Serial.println("AT+CIPCLOSE");
Pre-kindergarten
Pre-kindergarten
 
Posts: 7
Joined: Wed Nov 26, 2014 3:20 am

Re: Question: Set up the GPRS shield for Thingspeak?

by sirhannick » Thu Jul 28, 2016 11:03 pm

I have the answer and have tested it to prove it works. Has this bounty been claimed?
Pre-kindergarten
Pre-kindergarten
 
Posts: 14
Joined: Wed Jul 09, 2014 4:34 am


Who is online
Users browsing this forum: No registered users and 1 guest