Code Monkey home page Code Monkey logo

radu7 / iot-hub-sparkfun-thingdev-client-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azure-samples/iot-hub-sparkfun-thingdev-client-app

0.0 2.0 0.0 18 KB

Application collects weather data from a DHT22 sensor and sends it to IoT hub, also take actions according to cloud-to-device message.

Home Page: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-sparkfun-esp8266-thing-dev-get-started

License: MIT License

C++ 95.55% C 4.45%

iot-hub-sparkfun-thingdev-client-app's Introduction

services platforms author
iot-hub
arduino
xshi

IoT Hub SparkFun ESP8266 Thing-Dev Client application

Build Status

This repo contains the source code to help you get familiar with Azure IoT using the Azure IoT SparkFun ESP8266 Thing-Dev Starter Kit. You will find the lesson-based tutorials on Azure.com.

This repo contains an arduino application that runs on board SparkFun ESP8266 Thing-Dev with a DHT22 temperature&humidity sensor, and then sends these data to your IoT hub. At the same time, this application receives Cloud-to-Device message from your IoT hub, and takes actions according to the C2D command.

Prepare your Azure IoT Hub

You can follow this page to create your Azure IoT hub and register your device.

Install board with your Arduino IDE

  1. Start Arduino and open Preferences window.
  2. Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.
  3. Open Boards Manager from Tools > Board menu and install esp8266 platform 2.2.0 or later.
  4. Select your ESP8266 board from Tools > Board menu after installation.

Install libraries

Install the following libraries from Sketch -> Include library -> Manage libraries

  • AzureIoTHub
  • AzureIoTUtility
  • AzureIoTProtocol_MQTT
  • ArduinoJson
  • DHT sensor library
  • Adafruit Unified Sensor

Connect your sensor with your board

Connect with a physical DHT22 sensor

You can follow the image to connect your DHT22 with your SparkFun ESP8266 Thing-Dev.

DHT22

DON'T HAVE A PHYSICAL DHT22?

You can use the application to simulate temperature&humidity data and send to your IoT hub.

  1. Open the app/config.h file.
  2. Change the SIMULATED_DATA value from false to true.

Configure and run sample application

Upload the app.ino to your board.

Input your credential information

After you successfully upload the code to your board. You will see some prompt, input your credential information according to the prompts.

Send Cloud-to-Device command

You can send a C2D message to your device. You can see the device prints out the message and blinks once receiving the message.

Send Device Method command

You can send start or stop device method command to your Pi to start/stop sending message to your IoT hub.

iot-hub-sparkfun-thingdev-client-app's People

Contributors

yuwzho avatar sldragon avatar microsoftopensource avatar msftgits avatar

Watchers

James Cloos avatar  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.