IoT Edge Developer Webcast

Tired of the endless IoT Edge marketing and want to get your hands dirty?

Join Akash Sharma each week as he fires up the editor and starts cutting code for everyone to see, use, and learn from.

Session 11: ClearBlade Command Line Interface

Introduction

This session will cover using the cb-cli and its local editing commands.

Additional Info

Date posted: November 13th, 2020
YouTube Link: Click here to see the recording

Session 10: Shared Cache and Timers

Introduction

In this session, we modify our getTemperature microservice to retrieve temperature data from the National Weather Service endpoint periodically using a timer. We then save the temperature we receive from the endpoint in a Shared Cache and treat it as an Ambient Temperature.
We modify our logTemperaturesMqtt stream service to read the Ambient Temperature from the Shared Cache, subtract it from the received device temperature, and save the difference in our collection.

Pre-requisites

Completed Session 9 system or have the zip system file accessible.

Additional Info

Date posted: October 9th, 2020
YouTube Link: Click here to see the recording.

Session 9: Relay Topics

Introduction

In this session, we will learn how to send messages between MQTT clients connected to one of the different MQTT brokers within one ClearBlade system. There is one MQTT broker in the platform and one broker per edge.
We will modify our Python adapter to subscribe to a “Platform to Edge” topic based on which it returns smooth or raw temperature data. We will also have the adapter publish an acknowledgment of an “Edge to Platform” topic.
We will add a Toggle widget to our portal to allow us to select between smooth and raw data. Then, we will add a Text widget to display the acknowledgment message.

Pre-requisites

Completed Session 8 system or have the .zip system file accessible.

Additional Info

Date posted: September 18th, 2020
YouTube Link: Click here to see the recording.

Session 8: Using the new MQTT Library and Handling Promises

Introduction

In this session, we will tackle two main tasks that are unified in that they involve handling promises:
A. Create a version of the logTemperatures stream service that uses the new MQTT library.
B. Add a Toggle widget to our portal that will allow us to select between “C” (Celsius) and “F” (Fahrenheit). Our choice will dictate the unit where the Speedometer widget (part of our portal since Session 1) displays the temperature. Recall that this temperature is retrieved by the getTemperature microservice we created in Session 1. This code service retrieves an array of time/temperature forecast data from an HTTP endpoint maintained by the National Weather Service. Therefore, this task will involve modifying the getTemperature microservice.

Pre-requisites

Completed Session 7 system or have the .zip system file accessible.

Checking out the Python Adapter Library

Additional Info

Date posted: September 11th, 2020
YouTube Link: Click here to see the recording.

Session 7: Custom Device Columns, Libraries, and Configurations

Introduction

In this session, we will address the situation in which different devices may send temperature data in different units (Fahrenheit/ Celsius).
We will add a custom string column to our Devices table called temperature_unit, which will hold F (Fahrenheit) or C (Celsius). We will create a Library with a function that converts Fahrenheit to Celsius. We will also create a configuration with an upper-temperature limit to log only temperatures above that limit. Then, we will modify the stream service to save only Celsius temperatures above the threshold.

Pre-requisites

Completed Session 6 system or have the .zip system file accessible.

Additional Info

Date posted: September 4th, 2020
YouTube Link: Click here to see the recording.

Session 6: Capturing and Displaying Data from Multiple Devices

Introduction

In this session, we modified our system to capture and display data from two devices. We will have two copies of our temperature adapter running on one edge. One will authenticate as device-1 and the other as device-2. The time and temperature data will be stored in a single collection on the edge synced to the platform. The data is displayed in a new line chart widget showing one plot for device-1 and a second plot for device-2.

Pre-requisites

Completed Session 5 system or have the .zip system file accessible.

Additional Info

Date posted: August 28th, 2020
YouTube Link: Click here to see the recording.

Session 5: Deploying an Edge and Adapter

Introduction

In this session, we will install the ClearBlade Edge on a Gateway (it can be your personal computer). We will modify the Python code in Session 4 to function as an adapter. The adapter will publish messages to the MQTT broker running at the edge. The temperature data will then be stored in a collection on the edge. We will sync relevant assets between the platform and edge by deploying such that our portal will still show incoming data.

Pre-requisites

Completed Session 4 system or have the .zip system file accessible.
Windows users will need either:
1. A Linux machine / VM you can SSH into (something like a RaspberryPi) OR
2. A Windows Store Linux app running on top of the Windows Subsystem for Linux (WSL).

If using (1) above you will need to install PuTTY

If using (2) above, the most up-to-date instructions on this are here (one modification – rather than the main Ubuntu app, install the “Ubuntu 18.04 LTS” app

Note regarding Ubuntu 18.04:
Ubuntu 18.04 LTS comes preinstalled with Python3.6.9 but not pip3. Follow the “Installing pip for Python 3” instructions here.

Note on installing the clearblade PyPi module:
Install using “pip3 install clearblade”.

Additional Info

Date posted: August 20th, 2020
YouTube Link: Click here to see the recording.
Windows Version

Session 4: Building an External MQTT Client using an SDK

Introduction

In this session, we will connect a Python program to our temperatureMonitor system as an external MQTT client. This MQTT client will have the following characteristics:

It will authenticate as a device.
It will subscribe to one topic on which a request can be sent.
It will be published on one topic. The data published will be raw or smoothed (averaged) temperature data depending on what request was received.
The temperature data will be displayed in the existing Scatter Plot widget.

Pre-requisites
    Completed Session 3 system or have the .zip system file accessible.
    Have Python 3.6 or newer installed and ready to use. Python can be installed from here.
    Have completed at least a Hello World Python exercise.
    Ensure you can change directories and run a Python3 program from your terminal (e.g., Bash on Linux, Cmd or PowerShell on Windows, Terminal on MacOS). Many operating systems come pre-installed with Python2, so you can run code using Python 3.6.x.
    Have an editor available to edit and save changes to the Python code. A simple text editor is sufficient, but something like VSCode is ideal.
    Install the ClearBlade Python SDK (not from source) as indicated here.
    Ensure that port 1884 is not blocked by your firewall.
Additional Info

Date posted: August 13th, 2020
YouTube Link: Click here to see the recording.

Session 3: Using a Stream Service to Subscribe to an MQTT Topic

Introduction

We will publish and subscribe to message topics in this session using MQTT.

The process will include creating a stream service, which will:

(a) subscribe to a topic to get temperature data and

(b) write that data to the existing collection.

Pre-requisites
    Completed Session 2 system or have the .zip system file accessible.
    Have the two code-snippets accessible for copy and paste:
    logTemperatures stream service
    Modified scatter plot data parser
Additional Info

Date posted: August 5th, 2020
YouTube Link: Click here to see the recording.

Session 2: Storing Data using a Collection

Introduction

In this session, we will use our simple system from the last session to capture temperature data from an HTTP endpoint and display it in a scatter plot. We will use an array of temperatures from a forecast period from the National Weather Service. The data we capture will then be written into a collection and sorted by timestamp.

The system will include a portal with a Speedometer widget showing temperature data from a microservice we build. The temperature data will be from a National Weather Service API endpoint.

Pre-requisites
    Completed Session 1 system or have the .zip system file accessible.
    Have the two code-snippets accessible for copy and paste:
    getTemperatures microservice
    Scatter plot data parser
Additional Info

Date posted: July 30th, 2020
YouTube Link: Click here to see the recording.

Session 1: Capturing Data from an HTTP Endpoint using a Microservice

Introduction

We will be creating a generic temperature monitoring system. The system will include a portal with a Speedometer widget showing temperature data from a microservice we build. The temperature data will be from a National Weather Service API endpoint.

Pre-requisites
    Please create an account on ClearBlade Platform
Additional Info

Date posted: July 23rd, 2020
YouTube Link: Click here to see the recording.

ClearBlade Unveils GenAI Assistant for Intelligent Assets

X