1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Updated XivelyClient. Still not working

This commit is contained in:
tigoe 2013-05-30 23:09:57 -04:00
parent a181cf715a
commit 9bdc89699a

View File

@ -25,10 +25,6 @@
#define APIKEY "foo" // replace your pachube api key here
#define FEEDID 0000 // replace your feed ID
#define USERAGENT "my-project" // user agent is the project name
char ssid[] = "networkname"; // your network SSID (name)
char pass[] = "password"; // your network password
*/
@ -50,6 +46,7 @@ void setup() {
// reserve space for dataString:
dataString.reserve(100);
sendData();
}
void loop() {
@ -64,9 +61,8 @@ void loop() {
dataString += random(5) + 100;
// if there's incoming data from the net connection,
// send it out the serial port. This is for debugging
// purposes only:
while (xively.available()>0) {
// send it out the serial port:
if (xively.available()>0) {
char c = xively.read();
Serial.write(c);
}
@ -83,7 +79,6 @@ void loop() {
// this method makes a HTTP connection to the server:
void sendData() {
Serial.println("Sending data");
xively.begin("curl");
dataString = "--data \'" + dataString;
dataString += "\'";
@ -93,11 +88,12 @@ void sendData() {
apiString += "\"";
// form the string for the URL parameter:
String url = " https://api.xively.com/v2/feeds/";
String url = " \"https://api.xively.com/v2/feeds/";
url += FEEDID;
url += ".csv";
url += ".csv\"";
// send the HTTP PUT request:
xively.begin("curl");
xively.addParameter("-k");
xively.addParameter("--request PUT");
xively.addParameter(dataString);
@ -108,3 +104,9 @@ void sendData() {