• Stars
    star
    174
  • Rank 212,574 (Top 5 %)
  • Language
    C
  • Created over 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SDK to connect ESP8266 and ESP32 to Microsoft Azure IoT services

ESP Azure IoT SDK

Table of Contents

2021 Update

Since this library has been published, Microsoft has created newer versions of the Azure SDK for usage with the Espressif ESP32. This new library is better suited for microcontrollers, great for composition with your own network stack and officially supported by Microsoft.

The first one, Azure IoT middleware for FreeRTOS, is based on ESP-IDF and FreeRTOS and it has samples for IoT Hub and IoT Central using the device provisioning service (DPS).

The second one is based on Azure IoT for C library for Arduino and also has samples for IoT Hub.

If you can, avoid using this library for any new projects.

Introduction

The ESP Azure IoT SDK is based on Azure IoT C SDK and enables users to connect their ESP32 based devices to the Azure IoT hub. It provides some examples which can help understand most common use cases.

Getting Started

Hardware

You will basically just need a development host and an ESP32 development board to get started.

Development Host Setup

This project is to be used with Espressif's IoT Development Framework, ESP IDF. Follow these steps to get started:

  • Setup ESP IDF development environment by following the steps here.
  • In a separate folder, clone the esp-azure project as follows (please note the --recursive option, which is required to clone the various git submodules required by esp-azure)
$ git clone --recursive https://github.com/espressif/esp-azure.git

Note that if you ever change the branch or the git head of either esp-idf or esp-azure, ensure that all the submodules of the git repo are in sync by executing git submodule update --init --recursive

Setting up Azure IoT Hub

  • Create an Azure IoT Hub by following the documentation here.

Note: When selecting the "Pricing and scale tier", there is also an option to select , F1: Free tier, which should be sufficient for basic evaluation.

  • Copy the IoT Hub Connection string - primary key from the Azure IoT Hub. This will be required later. The screenshot below will help you locate it.
  • Connection string - primary key sample:
HostName=<azure-iot-hub-name>.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=<base64-encoded-access-key>

Setting up Azure CLI

  • Install Azure CLI
  • From your terminal, execute the az command to verify that the installation was successful. Output will be like this:
$ az

Welcome to Azure CLI!
---------------------
Use `az -h` to see available commands or go to https://aka.ms/cli.
...
  • Install the Azure IoT CLI extension using

$ az extension add --name azure-cli-iot-ext

After that, you should be able to use azure CLI to manage your iot-device. A list of useful Azure CLIs can be found here

Creating an Azure IoT Device

  • Login to Azure CLI using $ az login
  • Create a new device using $ az iot hub device-identity create -n [IoTHub Name] -d [Device ID]
  • Get connection string for your device using $ az iot hub device-identity show-connection-string -n [IoTHub Name] -d [Device ID]
  • Device connection string sample:
HostName=<azure-iot-hub-name>.azure-devices.net;DeviceId=<azure-iot-device-id>;SharedAccessKey=<base64-encoded-shared-access-key>
  • This will be required in the examples

Monitoring Results

To see various events and the data being exchanged between the device and IoT hub from your command line, run the following command:

$ az iot hub monitor-events -n [IoTHub Name] --login '[Connection string - primary key]'

Note the single quotes for the connection string. Without them, the command wont work as desired.

To monitor activity on your ESP device, run:

$ make monitor

Troubleshooting

  1. Some common problems can be fixed by disabling the firewall.

  2. You can try with the followings, if your build fails:

    • $ git submodule update --init --recursive
    • Check the compiler version and verify that it is the correct one for your ESP IDF version.
    • Check if the IDF_PATH is set correctly
    • Clean the project with make clean and if required, using rm -rf build sdkconfig sdkconfig.old
  3. Ensure that the device connection string received from Azure IoT Hub are correct.

More Repositories

1

esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
C
12,616
star
2

arduino-esp32

Arduino core for the ESP32
C++
12,308
star
3

esptool

Espressif SoC serial bootloader utility
Python
5,350
star
4

ESP8266_RTOS_SDK

Latest ESP8266 SDK based on FreeRTOS, esp-idf style.
C
3,232
star
5

esp-iot-solution

Espressif IoT Library. IoT Device Drivers, Documentations And Solutions.
C
1,763
star
6

esp-who

Face detection and recognition framework
C
1,594
star
7

esp-adf

Espressif Audio Development Framework
C
1,395
star
8

esp32-camera

C
1,259
star
9

vscode-esp-idf-extension

Visual Studio Code extension for ESP-IDF projects
TypeScript
967
star
10

ESP8266_NONOS_SDK

ESP8266 nonOS SDK
C
911
star
11

esp-at

AT application for ESP32/ESP32-C2/ESP32-C3/ESP32-C6/ESP8266
C
769
star
12

esp-mdf

Espressif Mesh Development Framework, limited maintain, recommend to use https://github.com/espressif/esp-mesh-lite
C
757
star
13

ESP8266_MP3_DECODER

A demo that should be run with ESP8266 Non-OS SDK
C
739
star
14

esp-box

The ESP-BOX is a new generation AIoT development platform released by Espressif Systems.
HTML
676
star
15

esp-drone

Mini Drone/Quadcopter Firmware for ESP32 and ESP32-S Series SoCs.
C
670
star
16

kicad-libraries

KiCad libraries for Espressif SoCs, modules, and DevKits.
Python
651
star
17

esp-csi

Applications based on Wi-Fi CSI (Channel state information), such as indoor positioning, human detection
C
608
star
18

esp-apple-homekit-adk

This is a port for Apple's Open Source HomeKit ADK
C
599
star
19

esp-mqtt

ESP32 mqtt component
C
577
star
20

esp-matter

Espressif's SDK for Matter
C++
577
star
21

esp-hosted

Hosted Solution (Linux/MCU) with ESP32 (Wi-Fi + BT + BLE)
C
562
star
22

esp-homekit-sdk

C
522
star
23

esp-skainet

Espressif intelligent voice assistant
C
500
star
24

ESP8266_AT

This project is not maintained, please use https://github.com/espressif/esp-at.
C
472
star
25

esp32-nesemu

Proof-of-concept NES emulator for the ESP32
C
471
star
26

esp-sr

Speech recognition
C
462
star
27

esp-now

A connectionless Wi-Fi communication protocol
C
450
star
28

rust-esp32-example

Example of Rust integration into an ESP-IDF project, for ESP32 series of chips
Rust
424
star
29

esp-rainmaker

ESP RainMaker Agent for firmware development
C
415
star
30

esp-dsp

DSP library for ESP-IDF
C
401
star
31

esp-dl

Espressif deep-learning library for AIoT applications
C++
369
star
32

openocd-esp32

OpenOCD branch with ESP32 JTAG support
C
336
star
33

esp-aliyun

Aliyun Iotkit-embedded, support esp32 & esp8266.
C
333
star
34

esp-idf-template

Template application for https://github.com/espressif/esp-idf
Makefile
323
star
35

esp-serial-flasher

Library for flashing Espressif SoCs from other MCUs.
C++
321
star
36

esp-tflite-micro

TensorFlow Lite Micro for Espressif Chipsets
C++
313
star
37

esp-dev-kits

Docs, Schematics, Factory Firmwares for ESP Development Kits
C
312
star
38

idf-eclipse-plugin

Espressif-IDE (based on Eclipse CDT) for ESP-IDF CMake based projects 4.x and above
Java
289
star
39

esp-va-sdk

Espressif's Voice Assistant SDK: Alexa, Google Voice Assistant, Google DialogFlow
C
273
star
40

esp-usb-bridge

USB to UART&JTAG bridge, implemented on ESP32-S2 or ESP32-S3
C
273
star
41

esp-aws-iot

AWS IoT SDK for ESP32 based chipsets
C
247
star
42

esptool-js

Javascript implementation of flasher tool for Espressif chips, running in web browser using WebSerial.
TypeScript
245
star
43

ESP31_RTOS_SDK

ESP31B SDK based on FreeRTOS. For ESP32 please see http://github.com/espressif/esp-idf
HTML
189
star
44

esp-idf-provisioning-android

Android Provisioning application for ESP-IDF Unified provisioning
Java
184
star
45

esp-jumpstart

Jumpstart from concept to production
C
167
star
46

esp-protocols

Collection of ESP-IDF components related to networking protocols
C
158
star
47

esp-gdbstub

C
157
star
48

esp32-wifi-lib

ESP32 WiFi stack precompiled libraries
Shell
153
star
49

esp32-doom

A proof-of-concept port of PrBoom to the ESP32. Needs psram hardware.
C++
151
star
50

esp-google-iot

Google Cloud IoT SDK as an ESP-IDF Component
C
144
star
51

esp-bsp

Board support components for Espressif development boards
C
141
star
52

esp-iot-bridge

A smart bridge to make both ESP and the other MCU or smart device can access the Internet.
C
140
star
53

esp8266-rtos-sample-code

C
130
star
54

esp-idf-provisioning-ios

Swift
125
star
55

idf-extra-components

Additional components for ESP-IDF, maintained by Espressif
C
123
star
56

esp32-arduino-lib-builder

C
120
star
57

esp-nn

Optimised Neural Network functions for Espressif chipsets
Assembly
116
star
58

esp-zigbee-sdk

Espressif Zigbee SDK
C
116
star
59

esp-mesh-lite

A lite version Wi-Fi Mesh, each node can access the network over the IP layer.
C
101
star
60

idf-installer

ESP IDF Windows Installer
Inno Setup
96
star
61

esp-insights

ESP Insights: A remote diagnostics/observability framework for connected devices
C
92
star
62

book-esp32c3-iot-projects

《ESP32-C3 物联网工程开发实战》配套代码
Swift
91
star
63

esp-rainmaker-android

ESP RainMaker Android app sources
Java
87
star
64

esp-thread-br

Espressif Thread Border Router SDK
C
84
star
65

usb-pids

Customer-allocated USB PIDs under the Espressif VID
Shell
80
star
66

pytest-embedded

A pytest plugin that designed for embedded testing
Python
79
star
67

esp-ali-smartliving

阿里云生活物联网平台 & 天猫精灵 IoT 开放平台
C
77
star
68

esp-lwip

Fork of lwIP (https://savannah.nongnu.org/projects/lwip/) with ESP-IDF specific patches
C
77
star
69

esp-idf-cxx

C++ wrapper classes for ESP-IDF components.
C++
70
star
70

esp-modbus

ESP-Modbus - the officially suppported library for Modbus protocol (serial RS485 + TCP over WiFi or Ethernet).
C
70
star
71

esp32-bt-lib

ESP32 Bluetooth stack (below HCI layer) precompiled libraries
67
star
72

esp8266-nonos-sample-code

C
66
star
73

esp-qcloud

基于 ESP-IDF 原生开发接入腾讯 IoT Explorer,支持 ESP32/ESP32S2,快速实现腾讯连连控制。
C
65
star
74

esp32c3-direct-boot-example

Example of ESP32-C3 (rev. 3 and later) "direct boot" feature.
CMake
64
star
75

esp-wasmachine

The Machine which can run WASM applications.
C
51
star
76

svd

SVD files for Espressif devices
51
star
77

freertos-gdb

Python module for operating with freeRTOS kernel objects in GDB
Python
48
star
78

esp-moonlight

C
48
star
79

binutils-esp32ulp

Binutils fork with support for the ESP32 ULP co-processor
C
46
star
80

xtensa-isa-doc

TeX
45
star
81

openocd-on-esp32

OpenOCD port running on ESP32-S3 microcontrollers
C
45
star
82

esp-rainmaker-ios

ESP RainMaker iOS app sources
Swift
41
star
83

esp-privilege-separation

Espressif Privilege Separation Framework
C
40
star
84

esp-adf-libs

C
38
star
85

idf-component-manager

Tool for installing ESP-IDF components
Python
38
star
86

ESP8266_RTOS_ALINK_DEMO

Alink 1.0 早期版本
Assembly
36
star
87

esp-launchpad

Configurable Browser-based Image Flasher
CSS
35
star
88

esp-wolfssl

WolfSSL port for ESP-IDF & ESP8266_RTOS_SDK
C
35
star
89

esp-joylink

Demo project for JD joylink, support esp32 & esp8266.
C
34
star
90

esp31-smsemu

C
34
star
91

esp-faq

Python
33
star
92

esp8266-alink-v1.0

alink v1.0
C
32
star
93

esp32-alink-demo

Demo project for alink, include embed and SDS
C
30
star
94

esp32-iotivity

Guide you to make your ESP32 support OCF/OIC.
C
29
star
95

newlib-esp32

Version of newlib used in ESP32 ROM and ESP-IDF
C
29
star
96

idf-env

idf-env tool helps set up and manage ESP-IDF installations
Rust
29
star
97

esp8266-alink-sds

Demo project for alink SDS
C
27
star
98

esp-cryptoauthlib

Release only fork of https://github.com/MicrochipTech/cryptoauthlib
C
27
star
99

esp-wdf

Espressif WASM Development Framework.
C
27
star
100

esp32-c3-book-en

Read the book here:
HTML
26
star