Giter Site home page Giter Site logo

esp-azure's Introduction

A MQTT Demo that Connects ESP device to Azure Cloud

Table of Contents

Introduction

Espressif offers a wide range of fully-certified Wi-Fi & BT modules powered by our own advanced SoCs. For more details, see Espressif Modules.

Azure cloud is one of the most wonderful clouds that collects data from lots of devices or pushes data to IoT devices. For more details, see Azure IoT Hub.

This demo demonstrates how to firstly connect your device (ESP devices or IoT devices with ESP devices inside) to Azure, using MQTT protocol, then send data to Azure as well as receive message from Azure.

Main workflow:

esp-azure-workflow

Preparation

1. Hardware

  • An ubuntu environment should be set up to build your demo;
  • Any ESP device can be used to run your demo.

2. Azure IoT Hub

HostName=yourname-ms-lot-hub.azure-devices.cn;SharedAccessKeyName=iothubowner;SharedAccessKey=zMeLQ0JTlZXVcHBVOwRFVmlFtcCz+CtbDpUPBWexbIY=
  • For step-by-step instructions, please click here.

3. Azure CLI

After that, you should be able to use azure CLI to manage your iot-device.

4. Device Connection String

  • login to Azure CLI
  • create your device, and get a device connection string. An example can be seen:
"HostName=esp-hub.azure-devices.net;DeviceId=yourdevice;SharedAccessKey=L7tvFTjFuVTQHtggEtv3rp+tKEJzQLLpDnO0edVGKCg=";

For detailed instruction, please click Here.

5. SDK

  • AZURE-SDK can be implemented to connect your ESP devices to Azure, using MQTT protocol.
  • Espressif SDK

6. Compiler

  • For ESP32 platform: Here
  • For ESP8266 platform: Here

Configuring and Building

1. Cloning Git submodules

This repo uses Git Submodules for its dependancies. To successfully clone these other repositories, after cloning this repo, use the following command in the root:

git submodule update --init --recursive

Checking Result

Please check results on both the iothub and device side:

  • az iot hub monitor-events -n [IoTHub Name] --login 'HostName=myhub.azuredevices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=12345'

  • ESP device: monitor events with command make monitor

ESP device would send data to the Azure cloud, and then you would be able to receive data at the iothub side.

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 init
    • git submodule update
    • export your compiler path
    • export your IDF path
    • get start from Here
  3. Make sure the device connection string you are using, which you get from Azure IoT Hub, is correct.

esp-azure's People

Contributors

andrejpk avatar jetstreamroysprowl avatar jitin17 avatar mahavirj avatar ustccw avatar wujiangang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.