Git Product home page Git Product logo

devopsiot's Introduction

DevOpsIoT

Integrate IoT device into DevOps culture with creating a Backend deployment to Azure

Main goal of this project

This project is about bootstrapping a device (here ESP8266) from Azure cloud eith only a little initial code without any passwords. It suits the case, when producing a piece of IoT hardware for use at innocent place an owner, it will be flashed with bootstrap code, to establish a connection to a productive environment in Azure.

How does it works

  1. The initial code contains only one endpoint. There, the ESP connects to.
  2. In Azrue a device identity will be created from transmitted MAC-Address and a new endpoint will be retransmitted together with it's new identity connection string.
  3. After ESP receives that connection, it will download the up to date flash binary (firmware) and starts flashing process imediately.
  4. The firmware contains all features (for now its only sending temperature data and faked battery values in intervals to Azure IoT Hub )
  5. ESP8266 will start as soon flash is done and connection to Internet is set up.

How to go on

This repository contains three applications.

  • Initial Code for connection to DeviceManager InitApp
  • The Firmware code IoTSolution
  • WebSite for sending commands to device IoTWeb To get this working on local machine, you have to prepare as described in the following sections.

What you need

  • First you need an ESP8266 (7/12/2e,...) - best with dev-board. Setting up your computer for accessing the hardware under windows is pretty easy. Connect it with USB, if you have a Developer-Board. Otherwise use a search-engine you prefer or have a look to this great "Instructable-Page"
  • Git - download here (as well as Git Credential Manager for Linux or Mac OS)
  • VSCode - you can install it from here or clone it from here.
  • Node.JS - Download here
  • NPM

How to setup

  1. Install Azure PowerShell
  2. Clone this repository
  3. Change to directory IoTSolution
  4. npm install
  5. npm install -g gulp
  6. modify config.json and add the COM-port, where ESP8266 is connected to
    1. open config.json
    2. open DeviceManager on Windows and have a look to the node "Connections (COM & LPT)"
    3. add the listed COM-port ID (e.g. "COM3") for your UART-Device as following "device_port": "COM3"
  7. gulp install-tools
  8. run setup-localEnvironment.ps1 in folder IoTSolution (this prepares your local environment to build and flash ESP-code to cable connected device)
  9. gulp run or with listener gulp run --listen

Congratulations! You've completed.

Important sites to read:

ToDos:

  • copy arduino-esp8266-nodemcu to node-modules/gulp-common
  • (adding boards has do be done as defined in Boards.txt - C:\Users\XXX\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\boards.txt)
  • if something goes wrong and flash is currupt: C:\Users\XXX\AppData\Local\Arduino15\packages\esp8266\tools\esptool\0.4.9/esptool.exe -cp COM3 -ce
  • also a usefull tool, in case something goes wrong is the EspExceptionDecoder

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.