Skip to content

Commit b114164

Browse files
author
Tom Igoe
committed
Pachube is dead. Long live Cosm. All Pachube examples changed to Cosm examples
1 parent 6e149c4 commit b114164

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

WiFi/examples/WifiPachubeClient/WifiPachubeClient.ino renamed to WiFi/examples/WifiCosmClient/WifiCosmClient.ino

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
2-
Wifi Pachube sensor client
2+
Wifi Cosm sensor client
33
4-
This sketch connects an analog sensor to Pachube (http://www.pachube.com)
4+
This sketch connects an analog sensor to Cosm (http://www.cosm.com)
55
using an Arduino Wifi shield.
66
77
This example is written for a network using WPA encryption. For
88
WEP or WPA, change the Wifi.begin() call accordingly.
99
10-
This example has been updated to use version 2.0 of the Pachube.com API.
10+
This example has been updated to use version 2.0 of the Cosm.com API.
1111
To make it work, create a feed with a datastream, and give it the ID
1212
sensor1. Or change the code below to match your feed.
1313
@@ -16,7 +16,7 @@
1616
* Wifi shield attached to pins 10, 11, 12, 13
1717
1818
created 13 Mar 2012
19-
modified 23 Apr 2012
19+
modified 14 May 2012
2020
by Tom Igoe
2121
2222
This code is in the public domain.
@@ -25,7 +25,7 @@
2525
#include <SPI.h>
2626
#include <WiFi.h>
2727

28-
#define APIKEY "YOUR API KEY GOES HERE" // replace your pachube api key here
28+
#define APIKEY "YOUR API KEY GOES HERE" // replace your cosm api key here
2929
#define FEEDID 00000 // replace your feed ID
3030
#define USERAGENT "My Arduino Project" // user agent is the project name
3131

@@ -38,12 +38,12 @@ int status = WL_IDLE_STATUS;
3838
WiFiClient client;
3939
// if you don't want to use DNS (and reduce your sketch size)
4040
// use the numeric IP instead of the name for the server:
41-
IPAddress server(216,52,233,122); // numeric IP for api.pachube.com
42-
//char server[] = "api.pachube.com"; // name address for pachube API
41+
IPAddress server(216,52,233,121); // numeric IP for api.cosm.com
42+
//char server[] = "api.cosm.com"; // name address for cosm API
4343

4444
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
4545
boolean lastConnected = false; // state of the connection last time through the main loop
46-
const unsigned long postingInterval = 10*1000; //delay between updates to Pachube.com
46+
const unsigned long postingInterval = 10*1000; //delay between updates to Cosm.com
4747

4848
void setup() {
4949
// start serial port:
@@ -101,8 +101,8 @@ void sendData(int thisData) {
101101
client.print("PUT /v2/feeds/");
102102
client.print(FEEDID);
103103
client.println(".csv HTTP/1.1");
104-
client.println("Host: api.pachube.com");
105-
client.print("X-PachubeApiKey: ");
104+
client.println("Host: api.cosm.com");
105+
client.print("X-ApiKey: ");
106106
client.println(APIKEY);
107107
client.print("User-Agent: ");
108108
client.println(USERAGENT);

WiFi/examples/WifiPachubeClientString/WifiPachubeClientString.ino renamed to WiFi/examples/WifiCosmClientString/WifiCosmClientString.ino

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
/*
2-
Wifi Pachube sensor client with Strings
2+
Wifi Cosm sensor client with Strings
33
4-
This sketch connects an analog sensor to Pachube (http://www.pachube.com)
4+
This sketch connects an analog sensor to Cosm (http://www.cosm.com)
55
using a Arduino Wifi shield.
66
77
This example is written for a network using WPA encryption. For
88
WEP or WPA, change the Wifi.begin() call accordingly.
99
10-
This example has been updated to use version 2.0 of the Pachube.com API.
10+
This example has been updated to use version 2.0 of the cosm.com API.
1111
To make it work, create a feed with a datastream, and give it the ID
1212
sensor1. Or change the code below to match your feed.
1313
@@ -19,7 +19,7 @@
1919
* Wifi shield attached to pins 10, 11, 12, 13
2020
2121
created 16 Mar 2012
22-
modified 23 Apr 2012
22+
modified 14 May 2012
2323
by Tom Igoe
2424
2525
This code is in the public domain.
@@ -43,12 +43,12 @@ WiFiClient client;
4343

4444
// if you don't want to use DNS (and reduce your sketch size)
4545
// use the numeric IP instead of the name for the server:
46-
//IPAddress server(216,52,233,122); // numeric IP for api.pachube.com
47-
char server[] = "api.pachube.com"; // name address for pachube API
46+
//IPAddress server(216,52,233,121); // numeric IP for api.cosm.com
47+
char server[] = "api.cosm.com"; // name address for pachube API
4848

4949
unsigned long lastConnectionTime = 0; // last time you connected to the server, in milliseconds
5050
boolean lastConnected = false; // state of the connection last time through the main loop
51-
const unsigned long postingInterval = 10*1000; //delay between updates to Pachube.com
51+
const unsigned long postingInterval = 10*1000; //delay between updates to cosm.com
5252

5353
void setup() {
5454
// start serial port:
@@ -115,8 +115,8 @@ void sendData(String thisData) {
115115
client.print("PUT /v2/feeds/");
116116
client.print(FEEDID);
117117
client.println(".csv HTTP/1.1");
118-
client.println("Host: api.pachube.com");
119-
client.print("X-PachubeApiKey: ");
118+
client.println("Host: api.cosm.com");
119+
client.print("X-ApiKey: ");
120120
client.println(APIKEY);
121121
client.print("User-Agent: ");
122122
client.println(USERAGENT);

0 commit comments

Comments
 (0)