Giter Site home page Giter Site logo

esp8266-mqtt-client's Introduction

ESP8266-MQTT-client


August 2016 ESP-DIG Release 1.3

The same code improvement as done for the Sonoff node:

- auto-reconnect and fall-back to alternate SSI for Wifi
- Debug mode can be activated on compilation

July 2016. SONOFF client new release 1.2

Auto-recovery for wifi was added. Also fallback to a second Access Point (SSI) was added. The node will try to connect to the main SSI for 20 seconds, then try the second SSI and so on. If no second SSI is present fill in the same SSI-data for SSI_A and SSI_B.


July 2016. SONOFF client new release 1.1

Client software was adapted to include the node number in MQTT clientID. This is to prevent issues when using multiple nodes. An MQTT "will" was added to indicate nodes disconnecting.


June 2016. SONOFF client added.

Client software was adapted to function on a commercial hardware platform: sonoff by Itead. This yields a small and cheap unit to switch mains power. More info can be found in the wiki.


A wifi based MQTT client

This MQTT client will connect over Wifi to the MQTT broker and controls a digital output (LED, relay):

  • toggle output and send status message on local button press
  • receive messages from the MQTT broker to control output, change settings and query state
  • periodically send status messages

Several nodes can operate within the same network; each node has a unique node ID. On startup the node operates with default values, as set during compilation. Hardware used is a ESP8266 WiFi module that connects directly to the MQTT broker.

Message structure is equal to the RFM69-based gateway/node sytem by the same author. This means both type of gateway/nodes can be used in a single Openhab system. For a decription of the message format look for the explanation pdf in the RFM69 gateway section.

The MQTT topic is /home/esp_gw/direction/nodeid/devid where direction is "sb" towards the node and "nb" towards the MQTT broker.

Defined devices are:

  • 0 uptime: read uptime in minutes
  • 1 interval: read/set transmission interval for push messages
  • 2 RSSI: read signal strength
  • 3 version: read software version
  • 5 ACK: read/set acknowledge message after a 'set' request
  • 6 toggle: read/set select toggle / timer function
  • 7 timer: read/set timer interval in seconds
  • 10 IP: read IP address of node
  • 16 actuator: read/set LED or relay output
  • 40 button: tx only: message sent when button pressed
  • 92 error: tx only: device not supported
  • 91 error: tx only: syntax error
  • 99 wakeup: tx only: first message sent on node startup

Hardware connections:

  • pin 0 is connected to a button that switches to GND, pullup to VCC
  • pin 2 is connected to LED and current limiting resistor to GND

Version 1.2 by [email protected] June 2016

esp8266-mqtt-client's People

Contributors

computourist avatar gautenk avatar

Watchers

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