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 .
I
OT (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
- What is IOT and MQTT ?
- AWS IOT walkthrough and creating a thing.
- What is Node Red? Installing Node Red.
- Using Node Red to pubish and subscribe messages
- AWS IOT Rules Demo
Part 2 Agenda
- Device Shadows and IOT Core Shadow Service
- Demo - Using AWS Device Shadows
Prerequsites
- AWS Account
- 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
- Things that can be better explained in a text format
- 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.
- Public Key
- Private Key
- Client/Device Certificate
- 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
Thank you for reading through, Please share if it’s useful to someone. Also do check out the part 2.
-Nikhil