Coder Social home page Coder Social logo

azure-iot-hub-field-gateway-arduino-nodemcu's Introduction

Temperature, Pressure and Light Sensor Streaming over MQTT

Platform

This project implemented on the NodeMCU V2.0 (also known as V1.0) on the ESP8266, ESP-12E chip using the Arduino Firmware

Schema

Streams data in the following JSON formats

  1. Maker Den. (MQTT Namespace gb/device/type)

    {"Dev":"DeviceId","Geo":"2011","Type":"temp","Unit":"c","Val":[27.30,25848],"Utc":"2015-12-06T23:06:08","Id":84} {"Dev":"DeviceId","Geo":"2011","Type":"kPa","Unit":"kPa","Val":[101.00,25824],"Utc":"2015-12-06T23:06:19","Id":85} {"Dev":"DeviceId","Geo":"2011","Type":"light","Unit":"l","Val":[99.00,25840],"Utc":"2015-12-06T23:06:19","Id":86}

  2. Azure IoT Hub Field Gateway. (MQTT Namespace iothub/#)

    {"Dev":"DeviceId","Geo":"2011","Celsius":27,"hPa":1016,"Light":99,"Utc":"2015-12-06T23:07:04","Id":103}

##Physical Board

  1. NodeMCU v2 - Lua based ESP8266 development kit
  2. BMP180 Barometric Pressure Sensor
  3. Adafruit Mini 8x8 LED Matrix w/I2C Backpack
  4. 1 x Light Dependent Resistor
  5. 1 x 10k resistor

schematic

Software Requirements

  1. On Windows, Mac and Linux you will need to install the latest CP210x USB to UART Bridge VCP Drivers.
  2. Arduino IDE 1.6.5 As at Dec, 2015, Arduino 1.6.6 has several issues, so to stick with 1.6.5
  3. As at Dec 2015, ESP8266 Board Manager 2.0.0 or better required.

##Arduino on ESP8266 Arduino on ESP8266 Project

Add NodeMCU to Arduino IDE

  1. Add Additional Board Manager URLs: File -> Preferences. Add http://arduino.esp8266.com/stable/package_esp8266com_index.json
  2. Restart Arduino IDE
  3. Add ESP8266 Board: Tools -> Board -> Board Manager -> Search ESP8266 -> Install
  4. Select NodeMUC Board: Tools -> Board -> NodeMCU 1.0 (ESP-12E module)
  5. Set Port and Upload Speed: Tools. Note, you may need to try different port speeds to sucessfully flash the device. Faster is better as each time you upload the code to the NodeMCU you are uploading the complete ROM not just your code.

##Project Files

  1. SetEEPROMConfiguration.ino - Set your Wi-Fi SSID and password (up to two can be specified - ground pin 7 to select the second Wi-Fi), plus the device id, MQTT server name, and geo location. Deploy this app to the NodeMCU to write configuration settings to EPROM
  2. MakerDenNodeMCU.ino - This is the main application, it will read configuration setting from the EPROM, manages sensor readings and publishing to MQTT

##Subscripting to MQTT Data

Install Mosquiotto client tools from the download page. Install Open SSL and PThread libraries as per set up instructions.

  1. To subscribe to Maker Den data

    mosquitto_sub.exe -h YourMqttServer -t gb/#

  2. To subscribe to IoT Hub data

    mosquitto_sub.exe -h YourMqttServer -t iothub/#

IoT Dashboard

The IoT Dashboard allows you to visualise the data streamed to a MQTT service running in an Azure Virtual Machine.

IoT Dashboard

You can install the IoT Dashboard from here. Note, you will need to allow to run from unknown publisher.

azure-iot-hub-field-gateway-arduino-nodemcu's People

Contributors

gloveboxes avatar

Watchers

 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.