{"id":188,"date":"2017-03-01T18:10:29","date_gmt":"2017-03-01T18:10:29","guid":{"rendered":"http:\/\/allabouttheproduct.com\/blog\/?p=188"},"modified":"2017-05-11T13:09:34","modified_gmt":"2017-05-11T13:09:34","slug":"experience-with-aws-iot-platform-part-2","status":"publish","type":"post","link":"https:\/\/allabouttheproduct.com\/blog\/iot\/experience-with-aws-iot-platform-part-2\/","title":{"rendered":"Experience with AWS IoT platform, part 2"},"content":{"rendered":"<p>This is the second blog in a <a href=\"http:\/\/allabouttheproduct.com\/blog\/iot\/iot-use-cases-initial-aws-iot-platform-experience\/\">series <\/a>looking at the complexity of using well known cloud compute platforms for building solutions for the Internet of Things.<\/p>\n<p><strong><a href=\"http:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/aws-iot-blog2-header.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-190\" src=\"http:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/aws-iot-blog2-header.png\" alt=\"Amazon Web Services Internet of Things (IoT) setup and configuration block diagram\" width=\"816\" height=\"315\" srcset=\"https:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/aws-iot-blog2-header.png 816w, https:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/aws-iot-blog2-header-300x116.png 300w, https:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/aws-iot-blog2-header-768x296.png 768w, https:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/aws-iot-blog2-header-624x241.png 624w\" sizes=\"auto, (max-width: 816px) 100vw, 816px\" \/><\/a>Summary<\/strong><\/p>\n<p>The IoT \u201crules\u201d and \u201cactions\u201d within AWS IoT are what allow you to bring your IoT data to life within the cloud through associated AWS services.<\/p>\n<p>My first observations about setting these up gave me the sense that this was going to be quite tricky- using the AWS command line interface to craft new roles and policies to be able to use different AWS services.<\/p>\n<p>However, this setup work is now starting to get a whole lot easier, with the introduction of a set of guided UI steps in the IoT suite which make it easier to accomplish the end goal. I was able, with relatively little effort, to setup publishing using an IoT program on a client to create IoT data files in the AWS storage cloud and make these publically visible on the web.<\/p>\n<p>Whilst saying this, I experienced a few odd quirks from the platform e.g. when trying to configure IoT automated actions. Whilst I can\u2019t claim strong knowledge of the platform, the reasons for the issues were far from clear and it may well be that there is just one way of doing things.<\/p>\n<p>My feeling is however, that it would be a small step from here to have the client program running on a reasonable scale embedded platform e.g. one with Wi-Fi\/IP stack. Indeed, the <a href=\"https:\/\/aws.amazon.com\/iotbutton\/\">AWS IoT button<\/a> is a good example and AWS themselves reference a number of other <a href=\"https:\/\/aws.amazon.com\/iot-platform\/getting-started\/\">suitable hardware platforms<\/a>.<\/p>\n<p>AWS have a number of services to connect with the IoT platform e.g. database and simple notification services which are bundled under a somewhat \u201cvertical\u201d navigation scheme; it is a shame that the service \u201cworked examples\u201d are rather spread around the AWS documentation, meaning that the problem you are trying to solve may have an answer, but you can\u2019t always see it from your current silo.<\/p>\n<p><strong>AWS IoT platform rules &amp; actions<\/strong><\/p>\n<p>In a <a href=\"http:\/\/allabouttheproduct.com\/blog\/iot\/iot-use-cases-initial-aws-iot-platform-experience\/\">previous blog<\/a>, I looked at the basic epics and user stories for an IoT system and cross referenced the experience with the AWS IoT platform. This previous blog only touched on the basic connection experience with AWS IoT: configuring end-points with identity certificates, setting up the target internet access point and enabling the basic data publish policy on the cloud end. These are represented by the greyed out boxes in the initial block picture.<\/p>\n<p>This piece is an initial look at the next step operations possible with the AWS IoT system:<\/p>\n<ul>\n<li>Defining a rule to filter all the published IoT topic data<\/li>\n<li>Creating an action related to the rule e.g. data file\/database update<\/li>\n<\/ul>\n<p><strong>Note: <\/strong>As a company looking to make a solution with a number of real \u201cautonomous\u201d IoT end points, quite a number of other tasks remain beyond what I have mentioned in the blogs so far e.g. visualisation, endpoint update, non-functional performance, alternate wireless connectivity (BT, LoRa) etc.<\/p>\n<p><strong>Initial thoughts<\/strong><\/p>\n<p>The rules and actions seem to be the most quirky part of the IoT system so far: I noticed that one of my new rules\/actions stored in the cloud seems to have disappeared\/deleted itself and then re-instated itself on the following day. Strange.<\/p>\n<p>From my experience in trying to use AWS IoT rules and actions, it is best to follow AWS\u2019 precise recommendations.<\/p>\n<ul>\n<li>Setup an account with AWS (account \u201cowner\u201d &#8211; access all areas including billing)<\/li>\n<li>Set up an administrator account under AWS IAM (all areas w\/out billing)<\/li>\n<li>Make\/configure <u>everything else<\/u> whilst logged in as administrator i.e. all AWS IoT, \u201cthing\u201d\/ device names, certificates &amp; access policies.\n<ul>\n<li>After creating devices\/certificates as the account owner, and other items as the admin, I had some odd behaviour with rules\/actions not being executed and files being created yet not being visible to me as \u201cadministrator\u201d.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><a href=\"http:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/AWS-iot-create-rule.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-191\" src=\"http:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/AWS-iot-create-rule.png\" alt=\"Amazon web services Internet of Things (IoT) creation of a rule for processing IoT data\" width=\"617\" height=\"723\" srcset=\"https:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/AWS-iot-create-rule.png 617w, https:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/AWS-iot-create-rule-256x300.png 256w\" sizes=\"auto, (max-width: 617px) 100vw, 617px\" \/><\/a><\/p>\n<p>The picture shows some of the SQL syntax used for specifying the topic of interest to work with and a SQL \u201cWHERE\u201d condition can provide further filtering on the topic data content \u2013 it is typically looking for key-value pairs with more details in the IoT developer guide.<\/p>\n<p><a href=\"http:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/create-action.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-192\" src=\"http:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/create-action.png\" alt=\"Amazon Web Services Internet of Things (IoT) creation of an action on IoT data\" width=\"747\" height=\"769\" srcset=\"https:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/create-action.png 747w, https:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/create-action-291x300.png 291w, https:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/create-action-624x642.png 624w\" sizes=\"auto, (max-width: 747px) 100vw, 747px\" \/><\/a><\/p>\n<p>The next stage in the dialogue, the selection of an action to result from an IoT rule is shown in the picture above e.g. creating files in S3 storage.<\/p>\n<p><a href=\"http:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/configure-action.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-193\" src=\"http:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/configure-action.png\" alt=\"AWS Internet of Things (IoT) configuration of an action on IoT data\" width=\"607\" height=\"545\" srcset=\"https:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/configure-action.png 607w, https:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/configure-action-300x269.png 300w\" sizes=\"auto, (max-width: 607px) 100vw, 607px\" \/><\/a><\/p>\n<p>The selected action must be configured and the above picture shows the s3 action configuration. The first boxes are to specify or create the S3 bucket where the IoT data will be written along with the sub-directory\/key. If a new bucket is needed then an s3 management console is opened to enable this.<\/p>\n<p>The lower box enables the selection of a \u201crole\u201d with an appropriate associated permissions policy to execute the action. Interestingly the \u201ccreate a new role\u201d most often did not work for me i.e. fails to load the IAM management console. To work around, I used an existing role which had the s3PutObject policy, and used the \u201cupdate role\u201d button to add the new s3 bucket\/subdirectory to the role permission &#8211; see the picture below.<\/p>\n<p><a href=\"http:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/aws-iot-workaround-create-action-role.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-194\" src=\"http:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/aws-iot-workaround-create-action-role.png\" alt=\"AWS Internet of Things (Iot) workaround for role definition for IoT actions \" width=\"575\" height=\"217\" srcset=\"https:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/aws-iot-workaround-create-action-role.png 575w, https:\/\/allabouttheproduct.com\/blog\/wp-content\/uploads\/2017\/03\/aws-iot-workaround-create-action-role-300x113.png 300w\" sizes=\"auto, (max-width: 575px) 100vw, 575px\" \/><\/a><\/p>\n<p>This odd behaviour is an example of there is perhaps just one way of doing things at present i.e. when using the rule wizard, it appears to prefer to re-use existing roles with s3 access as opposed to creating additional roles.<\/p>\n<p>Having been through the setup experience, it is clear to me that to get most value from AWS IoT rule and action deployment, you need to get to know the rest of AWS\u2019 solution offering e.g.<\/p>\n<ul>\n<li>Identity access and management (IAM) as an enabler<\/li>\n<li>Simple storage service (s3) for storing data<\/li>\n<li>Lambda (\u201cserverless\u201d execution) for manipulating data<\/li>\n<li>Simple notification service for messaging and alarm notifications<\/li>\n<\/ul>\n<p>This should not be surprising as most of these solutions are also \u201cchargeable services\u201d in their own right, with the IoT providing the on ramp for customers. This familiarisation process is going to involve a certain amount of time investment, but the payback potential is evident and the examples within each service silo are generally good and worthwhile to try out.<\/p>\n<p>A future blog will contrast our experiences with Microsoft Azure IoT with those of AWS IoT.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the second blog in a series looking at the complexity of using well known cloud compute platforms for building solutions for the Internet of Things. Summary The IoT \u201crules\u201d and \u201cactions\u201d within AWS IoT are what allow you to bring your IoT data to life within the cloud through associated AWS services. My [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[40],"tags":[42],"class_list":["post-188","post","type-post","status-publish","format-standard","hentry","category-iot","tag-iot"],"_links":{"self":[{"href":"https:\/\/allabouttheproduct.com\/blog\/wp-json\/wp\/v2\/posts\/188","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/allabouttheproduct.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/allabouttheproduct.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/allabouttheproduct.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/allabouttheproduct.com\/blog\/wp-json\/wp\/v2\/comments?post=188"}],"version-history":[{"count":6,"href":"https:\/\/allabouttheproduct.com\/blog\/wp-json\/wp\/v2\/posts\/188\/revisions"}],"predecessor-version":[{"id":200,"href":"https:\/\/allabouttheproduct.com\/blog\/wp-json\/wp\/v2\/posts\/188\/revisions\/200"}],"wp:attachment":[{"href":"https:\/\/allabouttheproduct.com\/blog\/wp-json\/wp\/v2\/media?parent=188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/allabouttheproduct.com\/blog\/wp-json\/wp\/v2\/categories?post=188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/allabouttheproduct.com\/blog\/wp-json\/wp\/v2\/tags?post=188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}