10 Easy Steps to Transfer Data to the Cloud for Less than $100
We meet a lot of different people, from a lot of different backgrounds and they may be mechanical engineers, they might be industrial process engineers, they might be EEs, and through one course or another either being a hobbyist or through the things they do at their job, they are kind of like a casual programmer. And from these people, we get asked the same question a lot of times:“I want to start collecting, or capturing, some sort of data, off of some project that I’m doing”it could be at work or home, but the concept is the same,“and how hard is it really to start capturing data and get it into the cloud? Or perhaps on AWS?”So what we did, we asked one of our engineers, Alex, to actually go out and source some hardware and pull down some tutorials and give somebody a step-by-step way to implement a very simple system to capture data and upload it to the cloud. What we found is that you can do this with a budget of less than $100 and with probably just 4 hours of work, if you’re just somebody who’s a casual programmer.So here’s what you’ll need:
First, you’ll need to open an account with AWS if you don’t already have one. On your account, add IoT Core, Lambda, and Lightsail. Then, you’re going to need some hardware. The hardware that we chose for the example is just a simple Raspberry Pi. You can pick those up on Amazon. So the total cost for a Raspberry Pi kit is probably about $50 – $60 dollars, and then the AWS stack as discussed is about $7 per month.So, here is Alex with ’10 Steps to Capture Data and Send it to the Cloud.’
How to do a Cloud Data Transfer
Alex –
Step 0 would be to read the 5-minute tutorial on the AWS website about how their IoT platform works. To give you a quick rundown, it consists of creating a ‘Thing’, which is just a logical unit on a cloud-enabled device a ‘Thing’ could be an embedded device, a laptop, a vending machine a thermostat, a smart sensor, something along those lines.
So you create a ‘Thing’ on AWS, create rules to process incoming data with their rules engine, and you can also read and set the device status with something called a device shadow, it’s a quick 5-minute tutorial.
Step 1 would be to create that ‘Thing’ with the AWS console or the IoT command line tool.
Step 2 would be to create a security policy for that ‘Thing’, allowing it to publish, subscribe, connect, things of that sort. Attach that security policy to the certificate you created for the ‘Thing’ that allows it permission to access AWS.
Next (Step 3) would be to download the SDK for your language of choice they have several flavors, you can use C++, Go, Java, .NET, PHP Ruby, Python, no JS I believe. For my examples, I used C++. They seem to be the easiest. So then, you build the SDK.
For Step 4, just download GitHub, I believe they support a CMake buildsystem. Pretty easy to build, and that will give you a static library to link against and also some sample code, which is a great example on how to actually publish and subscribe.
Step 5 would be to modify that sample, create a new topic to publish against. Topics are just strings that you define, you can create something like ‘My Test Topic’ test string, or something of that sort. Build those samples again with the modified updates.
Step 6 would be to open the AWS console again. They have a testing console that allows you to publish and subscribe to topics, create a subscription to the topic that you just added to your source code, your modified sample.
Step 7 would be to run that modified sample and verify that the data sent from the device is what you’re receiving in the test console it’ll display right in your web browser, and it’s pretty easy to see whether you get the data immediately.
Step 8 would be to integrate that sample code into your device that you want to be cloud enabled. In my example, I used a Raspberry Pi, but you can use something like STMicro or any platform that could run C, C++ code with web capabilities.
Then Step 9 would be to create a rule in the AWS console to process your data. The rules engine is really the magic of the AWS IoT Core as messages come in and are published to different topics you can route them to different services, you can use Lambda functions for their serverless architecture, you can parse the data using an SQL-like syntax, and split up the fields to put in database tables like in Dynamo DB. One of the simplest examples I used getting started was to send a push notification using Amazon’s SNS service, their simple notification, you simply create a text message topic, subscribe entering your phone number, and you’ll receive the data sent from your device in a nice text message so it’s really easy to verify if the data is coming through the IoT Gateway.
From there, the sky is the limit. AWS offers quite a few services, most of them can be integrated into their IoT Core platform. So from there, it’s really up to you what you want to do with that data, but to get it from your device to the cloud, shouldn’t take more than an hour or two with a decent platform after you’ve read the tutorials. Definitely go through the tutorials. They go through a lot to let you know how to configure your device, how to set it up, but from an engineering standpoint, it’s not very difficult.
Building the architecture is where the magic is, so the sky is the limit from there.
Rightley –
Let us know what you think in the comments below. And also, if you’d like us to go more in depth on any one of these steps, if you’d think that be helpful, put that in the comments as well, and then we can create a follow up video with a little more explanation. Thanks!
Partner with PSI
PSI partners with a variety of industrial, medical, and military clients to design custom software development. We complete projects that meet SIL, FDA, & military standards. Contact us about your project specs and view our capabilities.
- Custom Industrial Software Development Solutions
- FDA Software Development for Medical Devices
- Military Software Development and Embedded Military Firmware
No Comment
You can post first response comment.