Skip to content

Commit 9bdc896

Browse files
committed
Updated XivelyClient. Still not working
1 parent a181cf7 commit 9bdc896

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

hardware/arduino/avr/libraries/Bridge/examples/XivelyClient/XivelyClient.ino

+17-15
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,7 @@
2525
#define APIKEY "foo" // replace your pachube api key here
2626
#define FEEDID 0000 // replace your feed ID
2727
#define USERAGENT "my-project" // user agent is the project name
28-
29-
char ssid[] = "networkname"; // your network SSID (name)
30-
char pass[] = "password"; // your network password
31-
32-
*/
28+
*/
3329

3430

3531
// set up net client info:
@@ -44,12 +40,13 @@ void setup() {
4440
Serial.begin(9600);
4541
Bridge.begin();
4642
delay(2000);
47-
43+
4844
while(!Serial); // wait for Serial Monitor to open
4945
Serial.println("Xively client");
50-
46+
5147
// reserve space for dataString:
5248
dataString.reserve(100);
49+
sendData();
5350
}
5451

5552
void loop() {
@@ -64,9 +61,8 @@ void loop() {
6461
dataString += random(5) + 100;
6562

6663
// if there's incoming data from the net connection,
67-
// send it out the serial port. This is for debugging
68-
// purposes only:
69-
while (xively.available()>0) {
64+
// send it out the serial port:
65+
if (xively.available()>0) {
7066
char c = xively.read();
7167
Serial.write(c);
7268
}
@@ -83,7 +79,6 @@ void loop() {
8379
// this method makes a HTTP connection to the server:
8480
void sendData() {
8581
Serial.println("Sending data");
86-
xively.begin("curl");
8782
dataString = "--data \'" + dataString;
8883
dataString += "\'";
8984

@@ -93,12 +88,13 @@ void sendData() {
9388
apiString += "\"";
9489

9590
// form the string for the URL parameter:
96-
String url = " https://api.xively.com/v2/feeds/";
91+
String url = " \"https://api.xively.com/v2/feeds/";
9792
url += FEEDID;
98-
url += ".csv";
99-
93+
url += ".csv\"";
94+
10095
// send the HTTP PUT request:
101-
xively.addParameter(" -k");
96+
xively.begin("curl");
97+
xively.addParameter("-k");
10298
xively.addParameter("--request PUT");
10399
xively.addParameter(dataString);
104100
xively.addParameter(apiString);
@@ -108,3 +104,9 @@ void sendData() {
108104

109105

110106

107+
108+
109+
110+
111+
112+

0 commit comments

Comments
 (0)