Giter Club home page Giter Club logo

esp8266_wifi_v2.x's Introduction

OpenEVSE WiFi

OpenEVSE ESP8266 WIFI serial to EmonCMS link

OpenEVSE_WiFi.jpg


Requirements

  • ESP-12E module with 4M Flash

OpenEVSE User Guide

WiFi Setup

On first boot, OpenEVSE should broadcast a WiFI AP OpenEVSE_XXX. Connect to this AP (default password: openevse) and the captive portal should forward you to the log-in page. If this does not happen navigate to http://192.168.4.1

Note: You may need to disable mobile data if connecting via a Android 6 device

Wifi connect Wifi setup

  • Select your WiFi network from list of available networks
  • Enter WiFi PSK key then click Connect
  • OpenEVSE should now connect to local wifi network and return local IP address.
  • Browse to local IP address by clicking the hyperlink (assuming your computer is on the same WiFi network) On future boot up OpenEVSE will automatically connect to this network.

Note: on some networks it's possible to browse to the OpenEVSE using hostname http://openevse or on windows http://openevse.local

If re-connection fails (e.g. network cannot be found) the OpenEVSE will automatically revert back to WiFi AP mode after a short while to allow a new network to be re-configued if required. Re-connection to existing network will be attempted every 5min.

Holding the boot button at startup (for about 10's) will force AP mode. This is useful when trying to connect the unit to a new WiFi network.

Emoncms

OpenEVSE can post its status values (e.g amp, temp1, temp2, temp3, pilot, status) to emoncms.org or any other Emoncms server (e.g. emonPi) using Emoncms API. Data will be posted every 30s.

Data ca be posted using HTTP or HTTPS. For HTTPS the Emoncms server must support HTTPS (emoncms.org does, emonPi does not).Due to the limited resources on the ESP the SSL SSH-1 fingerprint for the Emoncms server must be manually entered and regularly updated.

Note: the emoncms.org fingerprint will change every 90 days when the SSL certificate is renewed.

Currently emoncms.org only supports numerical node names, other emoncms servers e.g. emonPi and data.openevse does support alphanumeric node naming.

3. MQTT

OpenEVSE Status via MQTT

OpenEVSE can post its status values (e.g. amp, temp1, temp2, temp3, pilot, status) to an MQTT server. Data will be published as a sub-topic of base topic.E.g <base-topic>/amp. Data is published to MQTT every 30s.

  • Enter MQTT server host and base-topic
  • (Optional) Enter server authentication details if required
  • Click connect
  • After a few seconds Connected: No should change to Connected: Yes if connection is successful. Re-connection will be attempted every 10s. A refresh of the page may be needed.

Note: emon/xxxx should be used as the base-topic if posting to emonPi MQTT server if you want the data to appear in emonPi Emoncms. See emonPi MQTT docs.

RAPI

RAPI commands can be used to control and check the status of all OpenEVSE functions. A full list of RAPI commands can be found in the OpenEVSE plus source code. RAPI commands can be issued via the web-interface, HTTP and MQTT.

RAPI via web interface

Enter RAPI commands directly into to web interface, RAPI responce is printed in return:

RAPI over MQTT

RAPI commands can be issued via MQTT messages. The RAPI command should be published to the following MQTT:

<base-topic>/rapi/in/<$ rapi-command> payload

e.g assuming base-topic of openevse to following command will set current to 13A:

openevse/rapi/in/$SC 13

The payload can be left blankc if the RAPI command does not require a payload e.g.

openevse/rapi/in/$GC

The responce from the RAPI command is published by the OpenEVSE back to the same sub-topic and can be received by subscribing to:

<base-topic>/rapi/out/#

e.g. $OK

See video demo of RAPI over MQTT

RAPI over HTTP

RAPI (rapid API) commands can also be issued directly via a single HTTP request.

Assuming 192.168.0.108 is the local IP address of the OpenEVSE ESP.

Eg.the RAPI command to set charging rate to 13A:

http://192.168.0.108/r?rapi=%24SC+13

To sleep (pause a charge) issue RAPI command $FS

http://192.168.0.108/r?rapi=%24FS

To enable (start / resume a charge) issue RAPI command $FE

http://192.168.0.108/r?rapi=%24FE

There is also an OpenEVSE RAPI command python library.

Admin (Authentication)

HTTP Authentication (highly recomended) can be enabled by saving admin config by default username and password.

HTTP authentication is required for all HTTP requests including input API

Firmware update

Pre-compiled .bin's can be uploaded via the web interface, see OpenEVSE Wifi releases

Note: the SPIFFS file-system (web page, CSS, java script and images) cannot currently be updated via web interface. They must be uploaded via serial see below.


Firmware Compile & Upload Instructions

The code for the ESP8266 can be compiled and uploaded using PlatformIO or Arduino IDE. PlatformIO is the easiest to get started.

Using PlatformIO

For more detailed ESP8266 Arduino core specific PlatfomIO notes see: https://github.com/esp8266/Arduino#using-platformio

a. Install PlatformIO command line

The easiest way if running Linux is to install use the install script, this installed pio via python pip and installs pip if not present. See PlatformIO installation docs. Or PlatformIO IDE can be used :

$ sudo python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"

b. And / Or use PlatformIO IDE

Standalone built on GitHub Atom IDE, or use PlatformIO Atom IDE plug-in if you already have Atom installed. The IDE is nice, easy and self-explanitory.

Download PlatfomIO IDE

2. Clone this repo

$ git clone https://github.com/chris1howell/OpenEVSE_RAPI_WiFi_ESP8266

3. Compile

$ cd OpenEVSE_RAPI_WiFi_ESP8266
$ pio run

The first time platformIO is ran the espressif arduino tool chain and all the required libs will be installed if required.

3. Upload

  • Put ESP into bootloader mode
    • On other ESP boards (Adafruit HUZZAH) press and hold GPIO0 button then press Reset, LED should light dimly to indicate bootloader mode
a.) Compile & Upload main program:

$ pio run -t upload

b.) Upload data folder to the file system (html, CSS etc.) (SPIFFS):
  • Put ESP back into bootloder mode, see above

$ pio run -t uploadfs

See PlatfomIO docs regarding SPIFFS uploading

c.) OTA upload over local network (optional advanced)

$ pio run -t upload --upload-port <LOCAL-ESP-IP-ADDRESS>

Upload SPIFFS filesystem over OTA (and don't flash):

pio run -e emonesp_spiffs -t upload --upload-port <LOCAL-ESP-IP-ADDRESS>

OTA uses port 8266. See PlatformIO ESP OTA docs:


Using Arduino IDE

1. Install ESP for Arduino with Boards Manager

From: https://github.com/esp8266/Arduino

Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. ESP Arduino packages are available for Windows, Mac OS, and Linux (32 and 64 bit).

  • Install Arduino 1.6.8 from the Arduino website.
  • Start Arduino and open Preferences window.
  • Enter http://arduino.esp8266.com/stable/package_esp8266com_index.json into Additional Board Manager URLs field. You can add multiple URLs, separating them with commas.
  • Open Boards Manager from Tools > Board menu and install esp8266 platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).

2. Install ESP filesystem file uploader

From: https://github.com/esp8266/Arduino/blob/master/doc/filesystem.md

3. Compile and Upload

  • Open EmonESP.ino in the Arduino IDE.
  • Compile and Upload as normal
  • Upload home.html web page using the ESP8266 Sketch Data Upload tool under Arduino tools.

Licence

GNU General Public License

esp8266_wifi_v2.x's People

Contributors

chris1howell avatar glynhudson avatar kronenpj avatar lincomatic avatar slyremarks 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.