GithubHelp home page GithubHelp logo

hapklaar / esp8266_wattson Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oh2mp/esp8266_wattson

0.0 0.0 0.0 3.71 MB

ESP8266 based MQTT gateway for DIY Kyoto Wattson

C++ 71.84% CSS 11.43% HTML 16.72%

esp8266_wattson's Introduction

ESP8266 Wattson

ESP8266 based MQTT gateway for DIY Kyoto Wattson

Wattson

DIY Kyoto Wattson is a wireless three phase Electricity monitor that came to the market about 2010. The manufacturer did not provide other software than "Holmes" for Windows. I reverse engineered the serial protocol in 2011 by eavesdropping the serial traffic from the USB. Then I wrote a Linux daemon for it. The daemon worked well all these years but I got an idea that it should use just ESP8266 and MQTT. The graph could be drawn by Grafana.

The device has a Mini-USB connector and looks as a generic USB serial port with 19200 8N1 to the computer. I thought that the ESP could be connected directly to the serial line of the device "after" the USB circuit. That was a quite easy hack. See Hardware.md.

The sketch sends the current power consumption with MQTT every 3 seconds. It also keeps it internal clock in UTC with NTP. The MQTT packet is a JSON like this example:

{"type":8,"p"=1234000}

The type=8 comes for my "standard" that is explained at ESP32 BLE2MQTT docs and parameter p is power in milliwatts.

It will add the device's serial number at the end of the topic. Eg. if the topic base is set as wattson and the serial number is s123456, the MQTT topic will be wattson/s123456

There you can find also an example how to configure Mosquitto, InfluxDB and Telegraf.

You will need also the Arduino ESP8266 filesystem uploader and upload the html and css files in data directory to SPIFFS.


Portal mode

This contains a quite similar portal as many other of my ESP sketches. If the GPIO14 is grounded, the ESP switches to the portal mode. Connect to WiFi ESP8266 Wattson, accept that there's no internet connection and take your browser to http://192.168.4.1/

The portal mode has a timeout. The unit will reboot after 2 minutes of inactivity. There's almost no sanity checks for the data sent from the forms. This is not a public web service and if you want to mess up your board or try to make a denial of service using eg. buffer overflows, feel free to do so.

Sample screenshots from the portal

Wifi config Other config


esp8266_wattson's People

Contributors

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