New to Imp and needing help with getting temp readings to Xively

I’m new to the electric imp and I need help. I would like to take a temperature reading with a TMP36 temp sensor and get the data to stream to Xively. I’m new to writing code and if someone can help me with the basic setup I think I can customize it from there. Thanks in advance.

Here is how I do that


and

I got the device code to work just fine but I’m still having trouble with the agent code. Here is my agent code (I’ve replaced feed id and api key with my actual settings though):

`XIVELY_FEED_ID <- “FEED ID”;
XIVELY_API_KEY <- “API KEY”;

function addXively(csv)
{
local req = http.put(“https://api.xively.com/v2/feeds/” + XIVELY_FEED_ID + “.csv”, {“X-ApiKey”:XIVELY_API_KEY, “Content-Type”:“text/csv”, “User-Agent”:“Xively-Imp-Lib/1.0”}, csv);
local res = req.sendsync();

addXively("Temperature," + avgTemperature);

if(res.statuscode != 200)
{
    server.log("error sending message: "+res.body);
}
else
{
  server.log("Xively updated");
}

}`

got mine working with the bearded-one :slight_smile:

https://github.com/electricimp/reference/tree/master/webservices/xively

Also worth noting that we have an instructable specifically about sending temperature data to Xively :slight_smile:

www.instructables.com/id/TempBug-internet-connected-thermometer/

Great instructable, but the link is dodgy so you need to cut/paste it into the browser

@DrJack link now fixed… thanks :slight_smile: