14. Part - 1/2 - Learn AWS IOT Core with Node Red ๐Ÿ“ปโš™๐Ÿ”—๐Ÿงท๐Ÿญ๐Ÿ›Ž

While I worked at AWS during the publishing of this post / video, the views expressed here are my own and may not reflect those of my employer. Only publicly available material is used to put together the content of this article and video. The website and the Youtube videos are NOT monetized.

You can directly scroll down for the Youtube Video, just make sure that you check out the agenda for part - 1 and part - 2 .

IOT (Internet Of Things) is all the rage now !

Learning IOT however has its challenges. When you start - either you are coming from a software development background or you are coming from device / embedded development background. Whichever flank you are coming in from, using Node Red for prototying IOT applications provides a great ramp to get into IOT.

So in this series I am trying to scratch the sufrace of IOT or specifically AWS IOT core with Node Red. Here’s the agenda for part 1 and part 2.

Part 1 Agenda

  1. What is IOT and MQTT ?
  2. AWS IOT walkthrough and creating a thing.
  3. What is Node Red? Installing Node Red.
  4. Using Node Red to pubish and subscribe messages
  5. AWS IOT Rules Demo

Part 2 Agenda

  1. Device Shadows and IOT Core Shadow Service
  2. Demo - Using AWS Device Shadows

Prerequsites

  1. AWS Account
  2. Windows / Linux / Mac Laptop with Node.js installed.

The videos for both parts are very detailed so instead of repeating myself in the blog posts I am only capturing

  1. Things that can be better explained in a text format
  2. Providing links, commands and code samples.

DEMO | AWS IOT Core With Node Red | Part 1

Please watch in full screen or on youtube directly



A note about certificates

When you create a thing on AWS IOT you get 4 files.

  1. Public Key
  2. Private Key
  3. Client/Device Certificate
  4. Root CA Certificate

You need the last 3 files to set up your client (SDK or Node Red).

When connecting with AWS IOT, AWS presents the server certificate that is valdidated using the Root Certificate (This is same as your browser SSL workflow). Additionally since AWS IOT uses 2 way SSL, the client certificate is then required to be presented to AWS IOT by your client and the private key is needed to prove you are the rightful owner of that client certificate through the mutual SSL authentication.

Read more about it here

Download Node Red Flow used in this Video

aws-iot-core-node-red-part-1-flow.json

Code Snippets (if you download the flow above they are already included)


// javascript function code
time_stamp = Math.floor(Date.now() / 1000);
hard_breaks = Math.floor((Math.random() * 20) + 1);
peak_speed = Math.floor((Math.random() * 250) + 1);
msg.payload = {time_stamp,hard_breaks,peak_speed}
return msg;

Reference / Further reading

  1. AWS IOT Core
  2. MQTT vs HTTP

Thank you for reading through, Please share if it’s useful to someone. Also do check out the part 2.

-Nikhil

comments powered by Disqus