Arduino library for Azure IoT
Published Dec 14 2021 09:00 AM 19.8K Views
Microsoft

We are committed to meet you, IoT developers, where you are, and a significant number of you happen to use the Arduino IDE. We're making the experience better than ever by releasing a first-class integration of Azure IoT C libraries into the Arduino IDE and tool chain.

When we redesigned the Azure IoT SDK or C library for the Arduino IDE we focused on principles like simplicity and memory footprint with a bare metal approach. It is possible for you to install the library, add Azure credentials and get your IoT devices connected in less than 5 minutes! And this whether you are an experienced Embedded Developer, a student or a maker getting your first device connected to a professional cloud platform like Azure IoT.

 

The Azure IoT SDK for C library

 

When you add this library to your Arduino IDE, you’re getting a fully tested set of APIs, documentation, and sample implementations on popular embedded platforms. Features provided by the library include establishing a secure MQTT connection to Azure IoT services, help to create and refresh security tokens, sending telemetry messages and receiving commands. You get the benefits of open source – available on GitHub under the MIT license – and the official support of Microsoft.

Some of the hardware platforms with out-of-the-box support include Espressif ESP32, ESP8266 and the Realtek Ameba D.

 

How to get started?

 

The library has already been published and you can find it from within the Arduino IDE: Sketch --> Include Library --> Manage Libraries. Search for Azure, select the Azure SDK for C library by Microsoft and click install.

 

wduraes_0-1639016772404.png

 

This library comes with samples for the Espressif ESP8266, ESP32 and the Realtek Ameba D. In all cases the sample structure is the same: look for the iot_config.h tab, and update the Wi-Fi credentials, and you Azure IoT Hub information.

That’s all you need to do! After loading the sketch to your device you’ll see simulated telemetry data flowing to your IoT Hub.

You’ll find more details about running the samples in our official repo: https://aka.ms/arduino

 

wduraes_1-1639017053720.png

 

Baremetal or RTOS?

 

This library was created on top of the Azure IoT SDK for C which provides the core APIs to get your device connected. You’ll see in our samples it uses a bare metal approach with a super loop to get the device working.

If you’re looking for support to create more complex solutions and you need to manage multiple threads, use semaphores, mutexes, queues and have a deterministic response time, you’re likely to need a real time operating system (RTOS).

Microsoft also offers two alternatives for device builders like yourself:

  1. Azure RTOS - https://github.com/azure-rtos
  2. Azure IoT middleware for FreeRTOS - https://github.com/Azure/azure-iot-middleware-freertos

Regardless of whether you use the Arduino Library for Azure IoT or from one of the options above, you’ll be using an officially supported Microsoft solution for connecting your IoT devices.

 

Let us know what you think

 

As we continue to work on improving the experience for IoT developers, provide your feedback, file issues, contribute with your own pull requests and stay tuned here on the IoT blog and on Azure Updates for any new Azure IoT SDK announcements.

7 Comments
Co-Authors
Version history
Last update:
‎Dec 13 2021 11:15 AM
Updated by: