Amazon AWS Internet of Things
Have you ever wondered what it takes to build good IoT product? How much effort does it take to create useful solution which will work safely and serve many clients? It can take a lot of time to do it. Fortunately there are some services like Google Cloud IoT or Amazon AWS IoT which try to help developers overcome all of common obstacles and make the work much easier.
Today, we will talk more closely about Amazon services. The main goal of their platform which was launched in 2015 is to offer tools that will help to spend more time on product development and not on common tasks that could be easily automated.
In order to achieve it they created several services that are tightly connected to each other. All you need is to think about functionalities your project needs and pick services that will help you to develop them.
In this blog post I will try to go through some important ones and make it easier to understand what can be build with them.
Basic functionality of this service is to connect all the devices to the Amazon cloud. It allows them to interact with cloud applications and other connected modules. It’s said that it can support billions of devices and trillions of messages (pretty impressive numbers though) and can process and route them to the needed endpoint.
The good thing is that it supports all the common communication protocols such as HTTP, WebSockets and MQTT which was described in one of our blog posts. You can also write your own custom protocol if it is really necessary.
Down below is an image that represent basic scheme of system functionality.
As we can see there is some set of devices and physical sensors whose data states are transmitted over MQTT and processed with other AWS Services. Interesting thing is that AWS Core is storing the latest state of a device so in result it appears to some client application as if it was online all the time. There is also one cool thing with the state updates - it will automatically update them when the device will reconnect in the future and prevent the situation when important change could be missed. All of it is happening in a secure way thanks to Device Defender which is an another service in AWS list.
What it is responsible for is basically to continuously audits the security policies associated with devices and watch for behavior that is different then the one predefined as an appropriate. We can easily say that it some kind of a guardian of whole system.
What is it all about? Amazon FreeRTOS
We went through the introduction but it didn’t really told us how exactly we are able to setup all of those devices with cloud functionalities which Amazon is highly recommending. Microcontrollers are very often running operating systems which have limited connectivity with local networks or the cloud which makes the IoT applications more difficult to develop.
That’s why we will focus on Amazon FreeRTOS. They came up with an idea to expand the most popular operating system on the market which is FreeRTOS (Real Time Operating System) with their own frameworks and libraries to make it safer and easier to connect everything with their services and create their own one.
It includes software libraries to meet the requirements of common IoT capabilities in devices such as internet connectivity or OTA (Over The Air) updates feature. It also includes support for data encryption, key management and TLS v1.2. The good thing is that it’s not restricted to certain group of devices as it support different architectures such as ARM or MIPS and the chipsets are ready to be used from such providers like Espressif, Microchip and STMicroelectronics. There is also a Qualification Program which checks if particular microcontroller is fully supporting Amazon FreeRTOS capabilities. Some interesting fact - Nasa is on their customers list and Amazon FreeRTOS was used by them to build new and more powerful miniature robots.
Maybe your idea is really simple and don’t require heavy custom specification? For example you just want to perform some action when the button is pressed on the device. Amazon thought about it as well and created 1-Click service. In short it enables devices to execute any function you want them to just right out of the box. There is no additional configuration, no need to write your own firmware and thinking about security. All you need to do is to wire that click with some AWS Lambda functions which can be written in languages like C#, Java, Python. They are offering two 1-Click devices on their site which are:
- Enterprise Button - WiFi based button which supports three types of click: single, double and long press
- LTE-M Button - cellular based button, a bit restricted one as it will work only over AT&T in United States
They are also providing reports about devices so it is easy to monitor their health, utilization or activity. This reports can be accessed through iOS and Android mobile apps in which it is possible to group them into groups associated with specific Lambda function.
When you think about how much money you need to spend to start working with it you must first look at the services that are going to be used. Each of them (expect a few free ones like Amazon FreeRTOS) has it’s own price list with different rates. However what connects them together is the fact that the pricing is relative to the amount of data/devices you are using through Amazon services. It should prevent situations when you will overpay for a given service and always make sure that you pay for what you really use.
What can we build on all of that?
That’s a really good question. With variety of those services we can build many things in different categories. Let’s say you want some smart meter which will record the consumption of electric energy, an electronic door lock that will work with biometric data or even an oil pump sensors for a heavy industry sector. This ideas are achievable using all the benefits of AWS IoT. I see a big potential in consumer products like wearable technology or smart houses solutions.
With 1-Click service it is reasonable to think about facilities that are using simple devices like hotels, conference rooms and airports to request some kind of service or even in hospitals for patients to inform the staff about emergencies.
Considering all of the above I must say that Amazon AWS IoT made good impression on me and seemed to be a pretty solid environment to develop new things. The amount of available services can be overwhelming at first but when you go deeper into it you realize that it all makes sense and could speed up the development time. To sum it up I will just say one thing - finally someone made it the right way.