Sending data from sensors to imp to AWS

Hi all! I am new to Electric Imp. Can someone point me to documentation on sending data from sensors to the Electric Imp and Electric Imp to AWS? I did find some information in the Libraries section but is there more in-depth documentation anywhere?

Thanks,
Apoorva.

Which bit of AWS were you trying to send the data to?

To use Kinesis Firehose (which is a large volume data ingestion pipe provided by AWS) then use of the firehose library is very simple, see https://electricimp.com/docs/libraries/webservices/awskinesisfirehose/ - essentially, you just call PutRecord in your event handler that receives the data from the device.

eg, if you had an explorer kit, you could take this example: https://electricimp.com/docs/gettingstarted/explorer/libraries/ and instead of sending to twitter:

function motion(data) {
    local message = format("Data from my Explorer Kit! [Temp: %.2f | Humid: %.2f | Pressure: %.2f]", 
        data.temp, data.humid, data.press);
    tweeter.tweet(message, tweetback);
    server.log(message);
}

…you’d send it to amazon (assuming you had instantiated the firehose class already per the library docs):

function motion(data) {
    local message = format("Data from my Explorer Kit! [Temp: %.2f | Humid: %.2f | Pressure: %.2f]", 
        data.temp, data.humid, data.press);
    firehose.putRecord("myStreamName", http.jsonencode(data), function(response) {
        server.log(response.statuscode + ": " + response.body);
    });
    server.log(message);
}

Firehose was exactly what I was looking at. How about getting data from sensors onto the imp? I am working at slightly complex sensors- not the usual temperature, humidity or pressure. Is there a general thumbrule for any given sensor?

Every sensor is different; different data rates, interfaces, power requirements, sampling intervals etc.

However, once the data is in the imp, it’s just data; you send it to the agent and the agent can push it into firehose. We have customers pushing pictures, audio, environmental data, machine data etc from devices to the cloud.

If you can provide more information about the sensor you’re wanting to use then we can likely help further; you can do this via a private message or email to sales@electricimp.com too if you’d prefer not to talk about it on the forum.

Thanks, @hugo. I’ll get back once I have more information on the sensors.