Go Down

Topic: xively.com (Read 608 times) previous topic - next topic

ereihani

Hi,  I got xively.com library and started the basic upload sketch. I also registered in the website and got some numbers:
Product ID
Product Secret
Activation Code
Feed ID
Feed URL
API Endpoint

In the sketch, there is a variable " xivelyKey". Which number of above shall i insert for xivelyKey?
Do u know what I should get for "xivelyclient.put" in the serial monitor?
If everything goes right, can I see my data in Channel section of my profile in the website?
Tnx.

oric_dan

#1
Jul 24, 2013, 10:06 pm Last Edit: Jul 24, 2013, 10:30 pm by oric_dan Reason: 1
I have routines that look like this. The first 2 items you get from your xively account, the  other lines show how they're used. Return code = 200, if it goes ok.

Code: [Select]
#define API_KEY   "..............................."
#define FEED_ID   12345678       // Xively feed ID = unsigned long

// Create three datastreams for the feed
#define NUM_FEEDS   3
#define chLIGHT     0    // 1st channel.
#define chTEMP1     1
#define chTEMP2     2

// Define the strings for our datastream IDs
char* sensorID[NUM_FEEDS] = { "light", "temp1", "temp2" };

XivelyDatastream datastreams[NUM_FEEDS] = {
 XivelyDatastream( sensorID[0], strlen(sensorID[0]), DATASTREAM_FLOAT),
 XivelyDatastream( sensorID[1], strlen(sensorID[1]), DATASTREAM_FLOAT),
 XivelyDatastream( sensorID[2], strlen(sensorID[2]), DATASTREAM_FLOAT),
};

// wrap the 3 datastreams into one feed.
XivelyFeed feed( FEED_ID, datastreams, NUM_FEEDS);


// insert data into Xively datastream.
/***************************************/
void setData( int ndx, float value )
{
 datastreams[ndx].setFloat(value);  // ~~~

 Serial.print("Sensor value is: ");
 Serial.println( datastreams[ndx].getFloat() );
}

/*************************************************************/
void sendFeed()
{
 Serial.println("Uploading to Xively");
 int ret = xClient.put(feed, API_KEY);
 
 Serial.print("xively PUT return code: ");
 Serial.println(ret);
}


Go here to see your feed, or else login to your account.
https://xively.com/feeds/12345678  <-- your feed ID.

EDIT: see also this post about enabling your account for writing, etc,
http://forum.arduino.cc/index.php?topic=178800.msg1326595#msg1326595

ereihani

yep!
I got 200 and it is working!
Thanks.


jgarcia

Anyone knows how to configure Xively feed to fixing MAX and MIN of the Graph?

Thanks

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy