Giter Club home page Giter Club logo

esp8266-web-mqtt-io-demo's Introduction

ESP8266 Web Server + MQTT I/O Demo

Objective

Create a IoT device that can have a pretty local web server to interact with the I/Os and also MQTT to interact with the internet (Currenlty using Adafruit IO)

Phisical components

  • 1 ESP8266 web enabled microcontroller (with USB serial and power)
  • 1 DS18B20 Temperature sensor (with resistor)
  • 1 RGB Led (with 3 resistors)
  • 1 2-way relay board
  • 1 Button (with resistor)

Details

The code uses the flash file system to store the internal web page (using milligram and normalize as a pretty but light web framework). The internal web server is also Apple Web App compatible, this means that you can create a shortcut in an iOS device and it will behave as an app.

All the I/Os can be seen or controlled from the internal web page (that uses a lightweight local REST API that could also be called with simple json messages) or from MQTT pubs and subs to Adafruit IO, this allow to link it to other things using the Adafruit IFTTT channel.

The MQTT feeds that it uses are:

  • {user}/feeds/{chipId}-temp
  • {user}/feeds/{chipId}-relay1
  • {user}/feeds/{chipId}-relay2
  • {user}/feeds/{chipId}-led-rgb
  • {user}/feeds/{chipId}{user}/feeds/{chipId}-toggle-button
  • {user}/feeds/{chipId}-toggle-button-state

Web page details

  • Responsive (Desktop/Table/Phone compatible)
  • Minified
  • Uses micro frameworks
  • Uses ajax
  • Auto refreshes itself
  • Allows to edit the chipId
  • Allows to send RGB colors
  • Allows to set ON/OFF each relay
  • Shows the current temp value
  • Shows the current button value (each time the button is pressed the value changes)

TODOs

  • Use secure MQTT
  • Clean up the code

See it in action

IMAGE ALT TEXT HERE

esp8266-web-mqtt-io-demo's People

Contributors

nahog 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.