Contents

ThingRex IoT Lab

Overview

Starting the Internet of Things (IoT) journey might be intimidating. IoT is not a “single thing” but a blend of multiple technologies and concepts.

The ThingRex IoT Lab offers a pre-configured learning environment designed to help you dive into the exciting world of the Internet of Things without the hassle of setting up development tools.

I created this Lab for people interested in learning about the Internet of Things and building IoT solutions leveraging the AWS Cloud.

Using this Lab, you can learn the foundational skills required in IoT:

  • MQTT protocol
  • handling Private Keys and X.509 Certificates
  • management of AWS Cloud infrastructure using:
    • AWS Command Line Interface (AWS CLI)
    • AWS SDK for Python (Boto3)
    • AWS Cloud Development Kit (AWS CDK)
  • basics of the Linux terminal

The ThingRex IoT Lab is free to use. You can modify it according to your needs.

I use this lab during my training sessions.

Requirements

The only requirement is an AWS account and a web browser.

Setup

AWS infrastructure costs notice

The ThingRex IoT Lab runs on the AWS SageMaker Notebook instance ml.t2.medium that generates hourly costs:

./lab_notebook_cost.png

Please check the current AWS SageMaker pricing at: https://aws.amazon.com/sagemaker/pricing/

During the IoT training, you will mainly interact with the AWS IoT Core service.

Please check the current AWS IoT Core pricing at: https://aws.amazon.com/iot-core/pricing/

AWS infrastructure setup

1 ) Log into your AWS account and search for the CloudFormation service:

./lab_deploy_01.png

2 ) Create a new stack to deploy the ThingRex IoT Lab infrastructure (use the “With new resources” option):

./lab_deploy_02.png

3 ) Leave the default options for “Prepare template” and “Template source”.

Use the following link as the Amazon S3 URL:

https://thingrex-pub.s3.eu-west-1.amazonaws.com/training/iot_lab.yml

./lab_deploy_03.png

4 ) Choose a name for your stack (for instance, ThingrexIoTLab):

./lab_deploy_04.png

5 ) Scroll to the bottom of the “Configure stack options” page and hit Next:

./lab_deploy_05.png

6 ) Scroll to the bottom of the “Review” page:

./lab_deploy_06.png

and acknowledge that AWS CloudFormation might create IAM resources. The ThingRex IoT Lab requires an IAM Role to manage AWS resources.

./lab_deploy_07.png

7 ) The ThingRex IoT Lab deployment started.

./lab_deploy_08.png

8 ) Wait till your environment is created and go to the “Outputs” tab.

./lab_deploy_09.png

9 ) Use the “Notebook” link to access your lab:

./lab_deploy_10.png

10 ) Open the JupyterLab Notebook:

./lab_deploy_11.png

11 ) Your environment is ready!

Your First Notebook

Create your first notebook.

./first_001.png

IMPORTANT: Use the conda_python3 kernel!

Before working with AWS, we need to upgrade the package manager (pip).

Type the following to the code cell and execute it.

!pip install -U pip

./first_002.png

Then, install required packages.

Type the following to the code cell and execute it.

!pip install -U boto3 botocore awscli pyOpenSSL

./first_003.png

Now, you are set to work with AWS!

Training Materials

Once you created the ThingRex IoT Lab, you can upload my training materials or use the demo session.

Demo session: https://thingrex-pub.s3.eu-west-1.amazonaws.com/demo_session.zip

./lab_upload_files.png

Double-click on the install_lab.ipynb notebook to open it:

./lab_install.png

Click on the play icon to execute the cell and install training materials:

./lab_installed.png

Open materials and enjoy your training!

Important: Select the conda_python3 kernel.

./lab_kernel.png

Download your work

Remember to save your work and download materials at the end of your working session.

Invoke the prepare_zip.ipynb notebook to create an archive of the training materials:

./lab_archive.png

and download that archive on your drive:

Right-click on the .zip file and select Download.

./lab_download_archive.png

Stop environment

Stop your lab environment to avoid additional costs when you are not using it:

Search for the sagemaker service:

./lab_stop_01.png

navigate to the Notebook instances:

./lab_stop_02.png

select the IoTTrainingNotebook instance, click on Actions, then Stop.

./lab_stop_03.png

Re-start stopped environment

To re-start a stopped environment find the IoTTrainingNotebook instance using the above steps, then invoke the Start action:

./lab_start.png

Select the conda_python3 kernel.

IMPORTANT: Remember to execute the marked cells in the IoT Lab setup section of the notebook every time you re-start your environment!

./lab_restart.png

Permanently remove the IoT Lab

To permanently remove the IoT Lab infrastructure search for the CloudFormation service:

./lab_deploy_01.png

and destroy the ThingRex IoT Lab stack:

./lab_delete.png

Support quality content❤️ Donate💰

Sign up for news: (by subscribing you accept the privacy policy)