Skip to content

IoTHub Client

Yoseph edited this page Jan 14, 2019 · 1 revision

Microsoft Azure IoT device SDK for C

This folder contains the following:

  • The Azure IoT device SDK for C (prepackaged or to compile) to easily and securely connect devices to the Microsoft Azure IoT Hub service.
  • Samples showing how to use the SDK

C Device SDK Features

  • Sends event data to Azure IoT based services.
  • Maps server commands to device functions.
  • Buffers data when the network connection is down.
  • Implements configurable retry logic.
  • Batches messages to improve communication efficiency.
  • Supports pluggable transport protocols: HTTPS, AMQP and MQTT.
  • Supports pluggable serialization methods.

Azure IoT device SDK for C can be used with a broad range of OS platforms and devices. For a list of tested configurations click here.


Prepackaged C SDK for Platform Specific Development

apt-get packages for Linux devices

To make it simpler to use the IoT Hub device SDK on Linux, we have created apt-get packages that are published on the Launchpad platform.

At this point you can use the packages on Ubuntu 16.04 and 18.04 using the following CPU architectures: amd64, arm64, armhf and i386.

Here you can find a detailed guide on how to install the packages to develop your device application.

If you are working with a device running a Linux distribution not supporting these packages, then you will need to compile the SDK following the instructions below.

CocoaPods for Apple devices

The IoT Hub Device SDK is available as CocoaPods for Mac and iOS device development. Details for how to use the CocoaPods are available here.

NuGet packages for Windows devices

When developing for Windows devices, you can leverage the NuGet packages manager in order to add new references to your projects. The Windows samples in this repository show how to use the Microsoft.Azure.IoTHub.IoTHubClient NuGet package along with its dependencies in your C project. To install Microsoft Azure IoTHub IoTHubClient, run the following command in the Package Manager Console in Visual Studio:

Install-Package Microsoft.Azure.IoTHub.IoTHubClient 

Once the package is added to your project, you simply can use it's APIs following the samples provided in this repository and the API reference documentation.

mbed library for mbed Developer Workspace

For developers creating device applications on the mbed platform, we have published a library and samples that will get you started in minutes witH Azure IoT Hub. This library and the samples have been tested with the following boards:

  • Freescale FRDMK64-F
  • Renesas GR-PEACH
  • SADE.IO GSM Gateway

To use the samples and the Azure IoT device SDK library in your mbed applications, here are the basic steps:

  • Prepare your device as instructed by the device manufacturer to connect it to the mbed development environment
  • In the mbed Developer Workspace click Import on the main menu. Then click the Click here to import from URL link next to the mbed globe logo.
  • In the popup window, enter the link for the sample code you want to try (you can find Azure IoT Hub samples here).
  • Adapt the code to use the right credentials for your device, and click Compile to generate the binary for your board.
  • Download the binary to your device and run.

You can find detailed instructions for each of the tested devices in the Azure IoT device catalog:

Arduino IDE library

If you are developing on Arduino, you can leverage the Azure IoT library available in the Arduino IDE library manager. You can find the list of supported boards as well as the instructions for using the library on Arduino devices in the azure-iot-arduino GitHub repository directly.

Compiling the C Device SDK

In order to compile the C SDK on your own, you will need to install a set of tools depending on the platform you are doing your development on and the one you are targeting. You will also need to clone the current repository. Detailed instructions can be found below for each platforms:

Samples

The repository contains a set of simple samples that will help you get started. You can find a list of these samples with instructions on how to run them here. In addition to the simple samples found in the current repository, you can find detailed instructions for the certified for Azure IoT devices in our online catalog

Read more