One of the many consequences of COVID-19 is the increased usage of online video conferencing to meet with our developers and conduct training. Unfortunately, due to the current environment we all experience, getting access to a “Pelion Ready” hardware to perform initial experiments with the platform is complicated, with delayed shipping or potentially misdelivered packages. Despite the platform already providing libraries to connect from a Linux system and the natural support for embedded OSs (such as Mbed OS and FreeRTOS), we felt we could further ease our developers on-boarding process even if they don’t have access to real hardware.
Let me introduce you to the Pelion Virtual Demo:
In essence, the application wraps the Pelion IoT Linux client libraries. It adds what we’d like to think is a “pretty” user interface on top to create a “virtual” simulated device, connecting and being managed by the platform. As far as the platform is concerned, this a “real” device connected, supporting all device management operations, including firmware updates!
We had the following goals when designing the tool:
- As a means for our developers to evaluate the platform and perform initial experiments while waiting for real hardware to arrive.
- Used as another tool in our toolbelt when conducting online training.
- Spawn several of “virtual” instances easily to simulate a real-world scenario to perform some initial testing. Albeit we do not recommend it for large-scale production-grade testing, it still can serve as an excellent tool for those initial platform tests.
We’ve already packaged the tool as a container image, so as long as you have Docker installed and an existing Pelion platform account, literally all that is required is the following:
docker run -e CLOUD_SDK_API_KEY=<YOUR_PELION_API_KEY> pelion/virtual-demo
NOTE: We provide free-tier access to the Pelion IoT platform, so you can quickly get started without any upfront costs. Please visit our sign-up page for more information.
Once started, the tool will automatically download the necessary development certificates, build and compile the initial firmware image and then attempt to connect and register to the platform. Once connected, it’ll start emitting “simulated” vibration sensor readings every 5 seconds (a value that is configurable):
The Vibration sensor reading is represented as an LwM2M managed resource registered to the platform. LwM2M stands for “Lightweight Machine-to-Machine” and is an open, efficient, vendor-neutral and standardized Device Management protocol devices use to communicate with the server to send telemetry data and invoke actuator commands. “Resource” is the name LwM2M gives to the readable and controllable aspects of IoT devices, such as their sensors.
Apart from built-in resources the Pelion client library configures automatically and the vibration sensor we mentioned earlier, the demo tool registers two more custom managed resources:
- a “blink_action” resource – to blink a simulated LED on the device modeling the invocation of a device actuator.
- and a “pattern_resource” to adjust the blinking length modeling the adjustment of a device attribute.
Suppose you are a long-time Pelion IoT developer. In that case, you can’t escape noticing that those resources are precisely the ones exposed by the official Pelion reference example: mbed-cloud-client-example; this is the one with which we recommend developers start with. The tool is based on the same code example extended only to communicate its internal state in real-time with the web user interface built on top.
Firmware (and Delta) Updates
One of the most important considerations when deploying production IoT solutions is to enable the devices to receive firmware updates-over-the-air (FOTA). With FOTA, you can extend your application’s functionality even after leaving the factory floor. More critically important, you can fix any security vulnerabilities discovered in the embedded OS or your application code. Already Pelion provides both a sophisticated security framework and a FOTA process to enable secure updates of your devices at scale. Since the tool uses the native Pelion IoT client libraries, enabling FOTA support was relatively simple, just toggling some build flags during the Linux binary firmware compilation and implementing a set of method callbacks to track the progress of the update. The process of creating your manifests to describe and sign the update, starting an update campaign, and monitoring the progress remains the same as if it was a “real” device. Further, delta update – that is, the binary difference between the current running firmware and the new one – is also supported, producing binary firmware images with significantly reduced size. This capability is critically important when you want to upgrade devices over LPWAN networks such as Cellular NB-IOT or WI-SUN, where bandwidth is limited and the cost of having the device online for an extended period, affecting its battery life.
Below is a recorded video walkthrough of the tool demonstrating device management and firmware updates “in-action”:
Try our virtual demo online using Katacoda
Occasionally we may need to quickly and visually demonstrate the Pelion IoT platform anywhere and without the requirement to have any local software such as Docker installed. Web technologies to the rescue! I am a big fan of the online katacoda platform as a means to “Learn new technologies using real environments right in your browser”. For that reason, we went ahead and created a Pelion Virtual Demo scenario, where the user is guided through a step-by-step visual guide to launch the demo tool online and interact with the Pelion IoT platform.
Give it a try and let us know what you think!
We hope you find this tool useful as you explore the Pelion IoT platform. We plan to continue to enhance it with more of the platforms features, such as Device Health, additional Katacoda scenarios that demonstrate concepts such as Factory Provisioning, and ran it alongside our Pelion Device Management Edge to simulate sensors attached to an edge gateway. For now, sign up for a Pelion free tier account and head to our katacoda scenario to try it out online. We would love to hear your comments and suggestions!