Example assets in an edge-based solution include:
- Robotic arms, conveyor belts, and elevators.
- Industrial CNC machines, lathes, saws, and drills.
- Medical diagnostic imaging machines.
- Security video cameras.
- Software or software components
- Programmable logic controllers.
These assets typically have built-in firmware that implements standard protocols. For example, a robotic arm might be an OPC UA client and a security video camera might implement the ONVIF protocol. In an edge-based solution, you use specialized connectors to connect to these assets and translate messages from them into a common format.
For assets, there's no direct equivalent to the device developer role. Instead, an operator can configure the connectors to connect to the assets. However, you might need to develop custom connectors to connect to assets that use protocols not natively supported by your edge-based solution.
Example devices in a cloud-based solution include:
- A pressure sensor on a remote oil pump.
- Temperature and humidity sensors in an air-conditioning unit.
- An accelerometer in an elevator.
- Presence sensors in a room.
These devices are typically built using microcontrollers (MCUs) or microprocessors (MPUs):
- MCUs are less expensive and simpler to operate than MPUs.
- An MCU contains many of the functions, such as memory, interfaces, and I/O on the chip itself. An MPU accesses this functionality from components in supporting chips.
- An MCU often uses a real-time OS (RTOS) or runs bare-metal (no OS) and provides real-time responses and highly deterministic reactions to external events. MPUs generally run a general purpose OS, such as Windows, Linux, or macOS that provides a nondeterministic real-time response. There's typically no guarantee as to when a task will complete.
Examples of specialized hardware and operating systems include:
Windows for IoT is an embedded version of Windows for MPUs with cloud connectivity that lets you create secure devices with easy provisioning and management.
Eclipse ThreadX is a real time operating system for IoT and edge devices powered by MCUs. Eclipse ThreadX is designed to support highly constrained devices that are battery powered and have less than 64 KB of flash memory.
FreeRTOS is a real time operating system for embedded devices. You can use FreeRTOS with the Azure IoT Middleware for FreeRTOS to connect devices to Azure IoT. For an overview of RTOS options for device development, see C SDK and Embedded C SDK usage scenarios.
Azure Sphere (Integrated) is a secure, high-level application platform with built-in communication and security features for internet-connected devices. It comprises a secured, connected, crossover MCU, a custom high-level Linux-based operating system, and a cloud-based security service that provides continuous, renewable security.
A device developer typically implements the following primitives in device code to interact with the cloud:
- Device-to-cloud messages to send time series telemetry to the cloud. For example, temperature data collected from a sensor attached to the device.
- File uploads for media files such as captured images and video. Intermittently connected devices can send telemetry batches. Devices can compress uploads to save bandwidth.
- Device twins to share and synchronize state data with the cloud. For example, a device can use the device twin to report the current state of a valve it controls to the cloud and to receive a desired target temperature from the cloud.
- Digital twins to represent a device in the digital world. For example, a digital twin can represent a device's physical location, its capabilities, and its relationships with other devices.
- Direct methods to receive commands from the cloud. A direct method can have parameters and return a response. For example, the cloud can call a direct method to request the device to reboot in 30 seconds.
- Cloud-to-device messages to receive one-way notifications from the cloud. For example, a notification that an update is ready to download.
To learn more, see Device-to-cloud communications guidance and Cloud-to-device communications guidance.
The device SDKs provide high-level abstractions that let you use the primitives without knowledge of the underlying communications protocols. The device SDKs also handle the details of establishing a secure connection to the cloud and authenticating the device.
For MPU devices, device SDKs are available for the following languages:
For MCU devices, see:
All of the device SDKs include samples that demonstrate how to use the SDK to connect to the cloud, send telemetry, and use the other primitives.
The IoT device development site includes tutorials and how-to guides that show you how to implement code for a range of device types and scenarios.
You can find more samples in the code sample browser.
Device development without a device SDK
Although you're recommended to use one of the device SDKS, there might be scenarios where you prefer not to. In these scenarios, your device code must directly use one of the communication protocols that IoT Hub and the Device Provisioning Service (DPS) support.
For more information, see: