In this lecture, we're going to look specifically at some of the IoT elements that are provided by Amazon Web Services. These are things that we're going to exercise as part of the class. Good to dig into them and understand what's available. We'll look at the different services and we'll talk a little bit about developing applications using the IoT SDKs. These are things that you're going to be doing in the project work for the class. The AWS for IoT is always expanding and changing. It's changed a lot in the five years or so that it's been around. The core has pretty much been there from the beginning. But they've added things like the Lambda serverless processes, Greengrass, which we'll talk about, which is a device based portion of AWS. There's some IoT devices that AWS supports directly. Then there is a lot of IoT device support that's been added to the system. Later in the class, you'll see lecture on FreeRTOS, which is a way to create an embedded device using an RTOS that has some direct Amazon stack support, so something to consider there too. Again, IoT Core, it's relatively new. It's only been around since 2015. But having said that, it's been a key part of AWS since then. It's relatively inexpensive to use on a per-device level. But as soon as you get into levels of production numbers of devices that are communicating significantly, those numbers start to add up. Pricing is on millions of minutes of connections, millions of messages. The maximum message size that you can pass through the IoT system is 120 kilobytes. Again, IoT implies that we're sending relatively small amounts of data from our devices into the system using MQTT or whatever application protocol we decide to use. I will take a walk through the key service elements that make up AWS IoT. We start with our devices. When we're creating a device that we want to have a talk to AWS, we create something called a thing definition. There's a thing SDK that we use in order to get the devices set up to talk appropriately to the rest of the AWS system. Those devices using their thing definition in AWS, we'll talk to a message broker, again, usually be MQTT or another well-known protocol. Then those messages will come into one of two places. They'll go into a device shadow, if you decide to use shadows, in order to allow for communication with devices that may go offline from time to time. But more normally the messages would come into a rules engine. The rules engine is where we will say when a message comes in, where does it go? Do we send it to Lambda where we might do some processing, do we send it directly to a database? Do we send it to an SQS queue? Then other applications can talk to those systems using AWS SDKs and they can consume that incoming data from the devices. Now this is all two ways. If you take it from the other direction, those IoT applications can talk to those applications that are provided by AWS and they can send messages back out to those devices to be able to do things like configuration control or over the air updates. Again, a fairly straightforward connectivity within the system. Although in practice, once we start looking at the different pieces and we start to mix in the security and identity functions that are required in order to make all this work, it can get a little complicated. But we are going to work up from a Hello World' level so that you get to the point where you're comfortable making these connections. One great way to play with those if you're on your own and you want to try it out, is to use something called the AWS IoT button. You may have seen these advertised on Amazon as Dash Buttons, where you could press the button and it would reorder some favorite part of your food or groceries or things you use around the house. Again, very easy to pull together a system. This is an example in the diagram of one that I did, where I created an AWS IoT connection to a button with the thing definition, and then the messages that came in, which we're essentially the button presses on the device, would come both to an SQS application and a Lambda application. When it went into the Lambda, I have Lambda use Amazon SNS so that I could send SMS messages, text messages out to a phone saying that message had appeared. I also sent those same incoming messages to SQS and I could consume messages from those cues with a Python application. So this was my first approach to using AWS, and again, couldn't have been easier. IoT provides default actions for most of the major services that AWS provides. I mentioned a few, but things like the API Gateway, using some of the Alexa skills for voice controlled things, direct connections to databases, etc. All those things are available as part of your potential application setup. Typically, you go through a series of steps to do an IoT setup. Often the first time you do this when you're connecting a Raspberry Pi or some other thing to AWS. It's best to walk through a detailed tutorial just so you get all the pieces right and you understand what those different elements are step-by-step. If I was trying to connect a Raspberry Pi, for instance, as a thing that was going to be sending messages to AWS, I would go into the IoT console and register that thing. When I do that, I would be able to create and attach my Raspberry Pi as a Thing that it recognizes. In order to make all that work, I have to create some security documentation, I need a certificate, I need a public and private key and a root certificate, for AWS IoT. All that security infrastructure has to be put in place before I'll be able to do my communications. Now, I also have to create actual security policies to say what things that device is going to be allowed to talk to. Once I create that policy, I have to attach the policy to the certificates being used, and I have to attach the thing to the certificates. Then at that point, I can start to configure and test the rules for how messages coming from that device will communicate to other parts of AWS. Again, it looks a little complicated, but in point of fact, once you've done it a few times, running through these steps becomes pretty straightforward. On the Python side, consuming some of the AWS services around IoT is pretty straightforward. Again, AWS provides a nice SDK using Boto3 that lets us wait for or pull AWS resources, helps us set up our credential connections. There are some good examples of using SQS. There's also SDKs for other languages. We'll do a little bit of Node.js in this class as well. We'll do some Node.js programming in Lambda. But you could create a fully Node.js based application and make the connections that we're going to be doing using Python. Lambda again, is an important part of this system because Lambda provides that server-less place for us to execute some Python or Node or other languages. When we want to try and do some configuration or response to incoming messages, the Lambda tool has a set of blueprints that lays out typical Lambda actions using the different languages, and gives you some nice examples for how to integrate those incoming IoT messages into other AWS services. So taking some quality time and spending it with a Lambda function tool is also a good thing to do. You'll find there's other third-party tools for Lambda to help set up your applications, for deploying them, for creating them, managing them, testing them, but really, you can do most of what you need to do just in the Amazon AWS console using Lambda. Greengrass is an interesting version of Lambda that actually runs on your Edge device. So you load the Greengrass toolset, for instance, onto a Raspberry Pi, and you can use the infrastructure to run functions on the device as if you were talking to AWS. This can make it a little easier to configure some applications that you may have already set up in AWS, and now you want to push out to your Edge devices. There's lots of devices, ARM based, x86 based, Linux-based devices that can use the Greengrass Core and act as a local hub for other devices that are running the IoT device SDKs. Again, this is a relatively new element within IoT, it came out in 2017 and release, but it can provide some nifty functionality. There's a nice example of setting up a Raspberry Pi using Amazon Greengrass. We're not going to use Greengrass to do our applications, but certainly it's worth taking a look at this example to see how you set up the Greengrass elements within AWS, get the security working, associate them with the IoT thing and create Lambda functions on your Raspberry Pi. Really neat to think about using, and the pricing is, is relatively low if you were going to deploy and lots of devices. For a little test application, you can use Greengrass for free, for three devices. There's a lot of other AWS IoT support, if you were doing serious system development. The device management tools help you onboard and provision your devices, set them up into groups, provide for over-the-air updates. The Device Defender looks at security issues, can monitor issues with the CloudWatch tools, maybe send alerts as text messages. Then there's analytic tools to look at traffic, SQL queries, and drive things into machine learning tools and tools like MATLAB or Octave if you're doing advanced application development. So take some time to look at the AWS IoT framework. Again, I'll just point out here that we're talking a lot about AWS and we're doing that because we're using it for the class, but there are other cloud vendors out there, Google Cloud Platform, Azure, in particular, both have their own IoT support sweets. You can certainly look at those as well for your own applications. But for class we're using AWS simply because it's pretty approachable. It's easy to use, and for the size of applications that we're doing, the price is right, it's usually free. So let's move on. Thank you.