I guess my question is this…I need a strategy to change the Electric Imp 1-Wire Tutorial code such that I can have more control over names of each sensor found, so I can package it up and send to Grovestreams.
When the 1-wire Tutorial code (http://electricimp.com/docs/resources/onewire/) was published, I changed it a bit to send to Xively. I inserted the code which you see below. It had the benefit of auto-populating Xively with any quantity of sensors without the need to name each one, but the downside is that they are all simply “maximtemp_1”, “maximtemp_2”, and so on. No biggie, since heating each sensor in commissioning easily identified “which sensor was which number”.
Device:
local id = "maximtemp_" + (device+1); local datapoint = { "idmaxim" : id, "tempmaxim" : format("%.2f",temp_f) } agent.send("maxim_temp",datapoint);
Agent:
device.on("maxim_temp", function(datapoint) { postToXively(datapoint.tempmaxim, datapoint.idmaxim); });
I’m now attempting to use Grovestreams via their tutorial (https://www.grovestreams.com/developers/getting_started_elec_imp_temp.html). I removed anything that was sensor specific. I did a similar insert of code, as below. It works, but only sends temperature for one sensor, then gives an error in the log:
2014-07-30 11:43:17 UTC-4 [Agent] error sending message: {“message”:"exception.LabradorException: Feed PUT call limit has been exceeded for address 184.169.136.13 - 0c2a69047a97. One call every 10 seconds is allowed. ",“errCode”:“RATE_LIMIT_EXCEEDED”,“success”:false}
Device:
`local id = “maximtemp_” + (device+1);
local datapoint = {
“idmaxim” : id,
“tempmaxim” : format("%.2f",temp_f)
}
agent.send(“maxim_temp”,datapoint);
//TEST OF GROVESTREAMS
local data = { id = hardware.getimpeeid(), mac = imp.getmacaddress(), temp = temp_f, voltage = hardware.voltage()}
agent.send(“GroveStreams”, data);
`
Agent:
device.on("GroveStreams", function(data) { server.log("Sending temp: " + data.temp); client.Put(data); });
Have I left anything out which should be included to help people start to answer this? Please let me know if so.
Thanks!