Understanding Edge Devices & Gateways

In the last blog, we went through the basics of edge computing, in this blog we will delve a little deeper to understand devices and how they connect with gateways.

Code on Devices

The code on the devices performs one or many of these

  1. It makes a secure connection to the cloud endpoint. Secure means that it can connect and authenticate as well.
  2. Sends data from sensors to the cloud. These are device-to-cloud messages or could be file uploads like video, audio, or images sent to the cloud. The device could send them synchronously or batch them.
  3. Manages device state and keeps it in sync with the cloud. It can act as a device twin for the device it is managing or act as a digital twin to represent the device’s location, capabilities, and relationship to other devices
  4. Receives and responds to commands from the cloud. For example, asking a motor to start in 30 seconds.
  5. Enables firmware installation and upgrades from the cloud. For example, notifying the device that there is a new firmware ready for download and then transferring that over the network
  6. Enables the device to function even when not connected to the cloud

The device code is usually containerized. For Example, docker. These containers have the runtime environment of the code along with all packages and libraries.

Types of devices

MCUs and MPUs

MCUs (microcontrollers) are less expensive than MPUs (microprocessors). They do not have processing power but have memory, interfaces, and I/O on the chip. Often they use real-time OS (RTOS) or bare metal (no OS). They are highly deterministic to external events.

MPUs connect with the MCUs to get data. They have general-purpose OS like Linux, macOS, or Windows. They provide non-deterministic real-time responses.

Connectivity

Either the devices connect to the IoT hub using a connection string that needs to have the hostname. In this case, all the devices would be hard-wired to the host. Another option is to go through a provisioning service that allows the devices to connect to a well-known endpoint and protocol. This provisioning service then connects to the hub or cloud end-points and the devices need not know about that.

Given loose abstraction the provisioning service should be a better approach.

Devices use TLS (Transport Level Security) to authenticate the IoT Hub or the provisioning service. TLS  is a widely adopted security protocol designed to facilitate privacy and data security for communications over the Internet. A primary use case of TLS is encrypting the communication between web applications and servers, such as web browsers loading a website.

Protocols

Devices can use several protocols to connect to the Hub. Some of them are

Connections

Are of two kinds, persistent and ephemeral

Persistent – When the solution needs command and control capabilities. The edge would maintain a connection to the cloud and reconnect if disconnected. MQTT and AMQP are most used for persistent connections

Ephemeral – Brief connections to send telemetry to the cloud. Once the payload is sent, the connection is dropped. Usually, device clients use HTTP API connection

Field Gateways & Bridges

Deployed close to gateways and help the devices connect to the cloud. They help with

Bridges help connect to 3rd party clouds like The Things Network

1 thought on “Understanding Edge Devices & Gateways”

  1. Pingback: Understanding Device Management & Control - klyff.com

Leave a Comment

Your email address will not be published. Required fields are marked *