Skip to content

Commit d418d35

Browse files
committed
Merge branch 'master' of github.com:OpenEVSE/ESP32_WiFi_V3.x into mongoose_port
2 parents 451db12 + 3a0f688 commit d418d35

File tree

1 file changed

+69
-74
lines changed

1 file changed

+69
-74
lines changed

readme.md

Lines changed: 69 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# OpenEVSE WiFi Gateway
22

3-
[![Build Status](https://travis-ci.org/OpenEVSE/ESP32_WiFi_V3.svg?branch=master)](https://travis-ci.org/OpenEVSE/ESP32_WiFi_V3.x)
4-
5-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/640ec33a27b24f6fb4fb1d7e74c7334c)](https://www.codacy.com/app/jeremy_poulter/ESP8266_WiFi_v2.x?utm_source=github.com&utm_medium=referral&utm_content=jeremypoulter/ESP8266_WiFi_v2.x&utm_campaign=Badge_Grade)
3+
[![Build Status](https://travis-ci.org/OpenEVSE/ESP32_WiFi_V3.x.svg?branch=master)](https://travis-ci.org/OpenEVSE/ESP32_WiFi_V3.x)
64

75
![main](docs/main2.png)
86

9-
The WiFi gateway uses an **ESP32** which communicates with the OpenEVSE controller via serial utilizing the existing RAPI API serial interface. The web interface UI is served directly from the ESP8266 web server and can be controlled via a connected device over the network.
7+
The WiFi gateway uses an **ESP32** which communicates with the OpenEVSE controller via serial utilizing the existing RAPI API serial interface. The web interface UI is served directly from the ESP32 web server and can be controlled via a connected device over the network.
108

119
[**See this repo for the older V2.x ESP8266 version**](https://github.com/openevse/ESP8266_WiFi_v2.x/)
1210

@@ -35,7 +33,7 @@ Live demo: https://openevse.openenergymonitor.org
3533

3634
### WiFi Module
3735

38-
- ESP32
36+
- ESP32
3937
Comming soon....
4038
- Purchase via: [OpenEVSE Store (USA/Canda)](https://store.openevse.com/collections/frontpage/products/openevse-wifi-kit) | [OpenEnergyMonitor (UK / EU)](http://shop.openenergymonitor.com/openevse-wifi-kit/)
4139
- See [OpenEVSE WiFi setup guide](https://openevse.dozuki.com/Guide/OpenEVSE+WiFi+%28Beta%29/14) for WiFi module connection instructions
@@ -64,22 +62,21 @@ Comming soon....
6462
+ [OhmConnect](#ohmconnect)
6563
* [System](#system)
6664
+ [Authentication](#authentication)
67-
+ [Firmware update](#firmware-update)
6865
+ [Hardware reset](#hardware-reset)
69-
* [Firmware Compile & Upload](#firmware-compile--upload)
70-
+ [Using PlatformIO](#using-platformio)
71-
- [a. Install PlatformIO command line](#a-install-platformio-command-line)
72-
- [b. And / Or use PlatformIO IDE](#b-and--or-use-platformio-ide)
73-
- [1. Clone this repo](#1-clone-this-repo)
74-
- [2. Compile & upload](#2-compile--upload)
75-
+ [Using Arduino IDE](#using-arduino-ide)
76-
- [1. Install ESP for Arduino with Boards Manager](#1-install-esp-for-arduino-with-boards-manager)
77-
- [2. Compile and Upload](#2-compile-and-upload)
78-
+ [Troubleshooting Upload](#troubleshooting-upload)
79-
- [Erase Flash](#erase-flash)
80-
- [Fully erase ESP](#fully-erase-esp)
81-
* [About](#about)
82-
* [Licence](#licence)
66+
+ [Firmware update](#firmware-update)
67+
- [Development Guide](#development-guide)
68+
* [Compiling and uploading firmware](#compiling-and-uploading-firmware)
69+
+ [Building GUI static assets](#building-the-gui-static-assets)
70+
+ [Compile and upload using PlatformIO](#compile-and-upload-using-platformio)
71+
- [1. Install PlatformIO](#1-install-platformio)
72+
- [2. Clone this repo](#2-clone-this-repo)
73+
- [3. Compile & upload](#3-compile--upload)
74+
* [Troubleshooting](#troubleshooting)
75+
+ [Uploading issues](#uploading-issues)
76+
+ [Fully erase ESP](#fully-erase-esp)
77+
+ [View serial debug](#view-serial-debug)
78+
- [About](#about)
79+
- [Licence](#licence)
8380

8481
<!-- tocstop -->
8582

@@ -273,6 +270,7 @@ https://player.vimeo.com/video/119419875
273270
Ohm Key can be obtained by logging in to OhmConnect, enter Settings and locate the link in "Open Source Projects"
274271
Example: https://login.ohmconnect.com/verify-ohm-hour/OpnEoVse
275272
Key: OpnEoVse
273+
276274
## System
277275

278276
![system](docs/system.png)
@@ -286,109 +284,106 @@ Admin HTTP Authentication (highly recommended) can be enabled by saving admin co
286284

287285
### Hardware reset
288286

289-
A Hardware reset can be made (all wifi and services config lost) by pressing and holding GPIO0 hardware button (on the Huzzah WiFi module) for 10s.
287+
A Hardware reset can be made (all WiFi and services config lost) by pressing and holding GPIO0 hardware button (on the Huzzah WiFi module) for 10s.
290288

291289
*Note: Holding the GPIO0 button for 5s will but the WiFi unit into AP (access point) mode to allow the WiFi network to be changed without loosing all the service config*
292290

293291
### Firmware update
294292

295293
See [OpenEVSE Wifi releases](https://github.com/OpenEVSE/ESP32_WiFi_v3.x/releases) for latest stable pre-compiled update releases.
296294

297-
## Via Web Interface
295+
#### Via Web Interface
298296

299-
This is the easiest way to update, pre-compiled firmware files `.bin` can be uploaded via the web interface: System > Update.
297+
This is the easiest way to update. Pre-compiled firmware `.bin` files can be uploaded via the web interface: System > Update.
300298

301-
If for whatever reason the web-interface won't load it's possibel to updated the firmware via CURL:
299+
If for whatever reason the web-interface won't load it's possible to update the firmware via CURL:
302300

303301
`curl -F '[email protected]' http://<IP-ADDRESS>/update && echo`
304302

305-
## Via Network OTA
303+
#### Via Network OTA
306304

307-
The firmware can also be updated via OTA over a local WiFi network usiong Arduino or Platformio
305+
The firmware can also be updated via OTA over a local WiFi network using PlatformIO:
308306

309307
`platformio run -t upload --upload-port <IP-ADDRESS>`
310308

311-
## Via USB Serial Programmer
309+
#### Via USB Serial Programmer
312310

313-
`esptool.py write_flash 0x000000 firmware.bin`
314-
315-
Or use esptool GUI (Pyflasher) avilable on windows/mac https://github.com/marcelstoer/nodemcu-pyflasher
311+
On the command line using the [esptool.py utility](https://github.com/espressif/esptool):
316312

317-
### Firmware Compile & Upload
313+
`esptool.py write_flash 0x000000 firmware.bin`
318314

319-
If required firmware can also be uploaded via serial using USB to UART cable.
315+
Or with the [NodeMCU PyFlasher](https://github.com/marcelstoer/nodemcu-pyflasher) GUI, available with pre-built executable files for windows/mac.
320316

321-
The code for the ESP8266 can be compiled and uploaded using PlatformIO or Arduino IDE. We recommend PlatformIO for its ease of use.
317+
# Development guide
322318

319+
## Compiling and uploading firmware
323320

324-
### Compile & Upload Using PlatformIO
321+
It is necessary to download and build the static web assets for the GUI before compiling and uploading to the ESP.
325322

326-
For more detailed ESP8266 Arduino core specific PlatfomIO notes see: https://github.com/esp8266/Arduino#using-platformio
323+
### Building the GUI static assets
327324

328-
#### a. Install PlatformIO command line
325+
The GUI static web assets are minified and compiled into the firmware using a combination of Webpack and a [custom python build script](scripts/extra_script.py).
329326

330-
The easiest way if running Linux is to install using the install script. See [PlatformIO installation docs](http://docs.platformio.org/en/latest/installation.html#installer-script). Or PlatformIO IDE can be used :
327+
You will need Node.js and npm installed: https://nodejs.org/en/download/
331328

332-
`$ sudo python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"`
329+
In addition, the GUI is now maintained in a [separate repository](https://nodejs.org/en/download/package-manager/) and is included as a Git submodule.
333330

334-
#### b. And / Or use PlatformIO IDE
331+
If the `gui` directory is empty, use the following to retrieve the GUI source and fetch the dependencies:
335332

336-
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-explanatory.
333+
```shell
334+
git submodule update --init
335+
cd gui
336+
npm install
337+
```
337338

338-
[Download PlatfomIO IDE](http://platformio.org/platformio-ide)
339+
To 'build' the GUI static assets, run the following from the `gui` directory:
339340

340-
#### 1. Clone this repo
341+
```shell
342+
npm run build
343+
```
341344

342-
`$ git clone https://github.com/OpenEVSE/ESP8266_WiFi_v2.x`
345+
Now you are ready to compile and upload to the ESP32.
343346

347+
### Compile and upload using PlatformIO
344348

345-
#### 2. Compile & upload
349+
For info on the Arduino core for the ESP32 using PlatformIO, see: https://github.com/espressif/arduino-esp32/blob/master/docs/platformio.md
346350

347-
- Put ESP into bootloader mode
348-
- On other ESP boards (Adafruit HUZZAH) press and hold `boot` button then press `reset`, red LED should light dimly to indicate bootloader mode.
349-
- Compile and upload using platformIO
351+
#### 1. Install PlatformIO
350352

351-
```
352-
pio run -t upload
353-
```
353+
PlatformIO can be installed as a command line utility (PlatformIO Core), a standalone IDE (PlatformIO IDO) or as an integration into other popular IDEs. Follow the [installation instructions](https://platformio.org/install).
354354

355-
*To enable to OTA upload first upload via serial using the dev environment, this enables to OTA enable build flag. See `platformio.ino*
355+
#### 2. Clone this repo
356356

357-
*Note: uploading SPIFFS is no longer required since web resources are [now embedded in the firmware](https://github.com/OpenEVSE/ESP8266_WiFi_v2.x/pull/87)
357+
`$ git clone https://github.com/OpenEVSE/ESP32_WiFi_v3.x`
358358

359-
### Building the GUI
359+
#### 3. Compile & upload
360360

361-
The GUI files are minified and compiled into the firmware using a combination of Webpack and a custom build script. You will also need Node.JS and NPM installed.
361+
- If necessary, put the ESP into bootloader mode. See [documentation on boot mode selection here](https://github.com/espressif/esptool/wiki/ESP32-Boot-Mode-Selection).
362+
- Some boards handle entering bootloader mode automatically. On other ESP boards, like the Adafruit HUZZAH 32 Breakout board, you have to press and hold a `boot` button then press a `reset` button, as [seen here](https://learn.adafruit.com/huzzah32-esp32-breakout-board/using-with-arduino-ide#blink-test-3-13).
362363

363-
In addition the GUI is now maintained in a separate repository and included as a Git submodule. If the `gui` directory is empty use the following to retrieve the GUI source and fetch the dependencies.
364+
Compile and upload using PlatformIO. To compile against the default env (for the ESP_WROVER_KIT, [docs](https://docs.platformio.org/en/latest/boards/espressif32/esp-wrover-kit.html)), run:
364365

365-
```shell
366-
git submodule update --init
367-
cd gui
368-
npm install
366+
```
367+
pio run -t upload
369368
```
370369

371-
To 'build' the GUI use the following:
370+
If you are using a different development board, you can specify one of the envs setup in `platformio.ini`, for example:
372371

373-
```shell
374-
cd gui
375-
npm run build
372+
```
373+
pio run -e openevse_huzzah32 -t upload
376374
```
377375

378-
You can then just compile and upload as above.
379-
380-
For more details see the [GUI documentation](https://github.com/OpenEVSE/openevse_wifi_gui/blob/master/readme.md)
376+
*To enable OTA updates, first upload via serial using the dev environment. This enables OTA enable build flag*
381377

382378
***
383379

384-
### Troubleshooting
385-
380+
## Troubleshooting
386381

387-
#### Uploading issues
382+
### Uploading issues
388383

389384
- Double check device is in bootloder mode
390385
- Try reducing the upload ESP baudrate
391-
- Erase flash: If you are experiencing ESP hanging in a reboot loop after upload it may be that the ESP flash has remnants of previous code (which may have the used the ESP memory in a different way). The ESP flash can be fully erased using [esptool](https://github.com/themadinventor/esptool). With the unit in bootloader mode run:
386+
- Erase flash: If you are experiencing ESP hanging in a reboot loop after upload it may be that the ESP flash has remnants of previous code (which may have the used the ESP memory in a different way). The ESP flash can be fully erased using [esptool](https://github.com/espressif/esptool). With the unit in bootloader mode run:
392387

393388
`$ esptool.py erase_flash`
394389

@@ -402,13 +397,13 @@ Erasing flash (this may take a while)...
402397
Erase took 8.0 seconds
403398
```
404399

405-
**Fully erase ESP**
400+
### Fully erase ESP
406401

407402
To fully erase all memory locations on an ESP-12 (4Mb) we need to upload a blank file to each memory location
408403

409404
`esptool.py write_flash 0x000000 blank_1MB.bin 0x100000 blank_1MB.bin 0x200000 blank_1MB.bin 0x300000 blank_1MB.bin`
410405

411-
#### View serial debug
406+
### View serial debug
412407

413408
To help debug it may be useful to enable serial debug output. To do this upload using `openevse_dev` environment e.g.
414409

@@ -420,7 +415,7 @@ To change to use serial0 (the main ESP's serial port) change `-DDEBUG_PORT=Seria
420415

421416
***
422417

423-
## About
418+
# About
424419

425420
Collaboration of [OpenEnegyMonitor](http://openenergymonitor.org) and [OpenEVSE](https://openevse.com).
426421

@@ -434,6 +429,6 @@ Contributions by:
434429
- @lincomatic
435430
- @joverbee
436431

437-
## Licence
432+
# Licence
438433

439434
GNU General Public License (GPL) V3

0 commit comments

Comments
 (0)