Skip to content

Commit bec0927

Browse files
committed
Re-arrange compiling docs, add links to docs
Create a distinct 'Development Guide' to accompany the existing 'User Guide' and move the sections on compiling/uploading/troubleshooting to be in this new section. Expand on some of the notes regarding compiling and uploading. Add some additional links to relevant documentation throughout the Development Guide. Change some instances and references from ESP8266 to be ESP32 relevant.
1 parent 32bc5fc commit bec0927

File tree

1 file changed

+68
-71
lines changed

1 file changed

+68
-71
lines changed

readme.md

Lines changed: 68 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
![main](docs/main2.png)
66

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

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

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

3434
### WiFi Module
3535

36-
- ESP32
36+
- ESP32
3737
Comming soon....
3838
- 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/)
3939
- See [OpenEVSE WiFi setup guide](https://openevse.dozuki.com/Guide/OpenEVSE+WiFi+%28Beta%29/14) for WiFi module connection instructions
@@ -62,22 +62,21 @@ Comming soon....
6262
+ [OhmConnect](#ohmconnect)
6363
* [System](#system)
6464
+ [Authentication](#authentication)
65-
+ [Firmware update](#firmware-update)
6665
+ [Hardware reset](#hardware-reset)
67-
* [Firmware Compile & Upload](#firmware-compile--upload)
68-
+ [Using PlatformIO](#using-platformio)
69-
- [a. Install PlatformIO command line](#a-install-platformio-command-line)
70-
- [b. And / Or use PlatformIO IDE](#b-and--or-use-platformio-ide)
71-
- [1. Clone this repo](#1-clone-this-repo)
72-
- [2. Compile & upload](#2-compile--upload)
73-
+ [Using Arduino IDE](#using-arduino-ide)
74-
- [1. Install ESP for Arduino with Boards Manager](#1-install-esp-for-arduino-with-boards-manager)
75-
- [2. Compile and Upload](#2-compile-and-upload)
76-
+ [Troubleshooting Upload](#troubleshooting-upload)
77-
- [Erase Flash](#erase-flash)
78-
- [Fully erase ESP](#fully-erase-esp)
79-
* [About](#about)
80-
* [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)
8180

8281
<!-- tocstop -->
8382

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

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

285285
### Hardware reset
286286

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

289289
*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*
290290

291291
### Firmware update
292292

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

295-
## Via Web Interface
295+
#### Via Web Interface
296296

297-
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.
298298

299-
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:
300300

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

303-
## Via Network OTA
303+
#### Via Network OTA
304304

305-
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:
306306

307307
`platformio run -t upload --upload-port <IP-ADDRESS>`
308308

309-
## Via USB Serial Programmer
309+
#### Via USB Serial Programmer
310+
311+
On the command line using the [esptool.py utility](https://github.com/espressif/esptool):
310312

311313
`esptool.py write_flash 0x000000 firmware.bin`
312314

313-
Or use esptool GUI (Pyflasher) avilable on windows/mac https://github.com/marcelstoer/nodemcu-pyflasher
315+
Or with the [NodeMCU PyFlasher](https://github.com/marcelstoer/nodemcu-pyflasher) GUI, available with pre-built executable files for windows/mac.
314316

315-
### Firmware Compile & Upload
317+
# Development guide
316318

317-
If required firmware can also be uploaded via serial using USB to UART cable.
319+
## Compiling and uploading firmware
318320

319-
The code for the ESP8266 can be compiled and uploaded using PlatformIO or Arduino IDE. We recommend PlatformIO for its ease of use.
321+
It is necessary to download and build the static web assets for the GUI before compiling and uploading to the ESP.
320322

323+
### Building the GUI static assets
321324

322-
### Compile & Upload Using PlatformIO
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).
323326

324-
For more detailed ESP8266 Arduino core specific PlatfomIO notes see: https://github.com/esp8266/Arduino#using-platformio
327+
You will need Node.js and npm installed: https://nodejs.org/en/download/
325328

326-
#### a. Install PlatformIO command line
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.
327330

328-
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 :
331+
If the `gui` directory is empty, use the following to retrieve the GUI source and fetch the dependencies:
329332

330-
`$ sudo python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"`
333+
```shell
334+
git submodule update --init
335+
cd gui
336+
npm install
337+
```
331338

332-
#### b. And / Or use PlatformIO IDE
339+
To 'build' the GUI static assets, run the following from the `gui` directory:
333340

334-
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.
341+
```shell
342+
npm run build
343+
```
335344

336-
[Download PlatfomIO IDE](http://platformio.org/platformio-ide)
345+
Now you are ready to compile and upload to the ESP32.
337346

338-
#### 1. Clone this repo
347+
### Compile and upload using PlatformIO
339348

340-
`$ git clone https://github.com/OpenEVSE/ESP8266_WiFi_v2.x`
349+
For info on the Arduino core for the ESP32 using PlatformIO, see: https://github.com/espressif/arduino-esp32/blob/master/docs/platformio.md
341350

351+
#### 1. Install PlatformIO
342352

343-
#### 2. Compile & upload
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).
344354

345-
- Put ESP into bootloader mode
346-
- On other ESP boards (Adafruit HUZZAH) press and hold `boot` button then press `reset`, red LED should light dimly to indicate bootloader mode.
347-
- Compile and upload using platformIO
355+
#### 2. Clone this repo
348356

349-
```
350-
pio run -t upload
351-
```
357+
`$ git clone https://github.com/OpenEVSE/ESP32_WiFi_v3.x`
352358

353-
*To enable to OTA upload first upload via serial using the dev environment, this enables to OTA enable build flag. See `platformio.ino*
359+
#### 3. Compile & upload
354360

355-
*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)
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).
356363

357-
### Building the GUI
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:
358365

359-
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.
360-
361-
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.
362-
363-
```shell
364-
git submodule update --init
365-
cd gui
366-
npm install
366+
```
367+
pio run -t upload
367368
```
368369

369-
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:
370371

371-
```shell
372-
cd gui
373-
npm run build
372+
```
373+
pio run -e openevse_huzzah32 -t upload
374374
```
375375

376-
You can then just compile and upload as above.
377-
378-
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*
379377

380378
***
381379

382-
### Troubleshooting
383-
380+
## Troubleshooting
384381

385-
#### Uploading issues
382+
### Uploading issues
386383

387384
- Double check device is in bootloder mode
388385
- Try reducing the upload ESP baudrate
389-
- 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:
390387

391388
`$ esptool.py erase_flash`
392389

@@ -400,13 +397,13 @@ Erasing flash (this may take a while)...
400397
Erase took 8.0 seconds
401398
```
402399

403-
**Fully erase ESP**
400+
### Fully erase ESP
404401

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

407404
`esptool.py write_flash 0x000000 blank_1MB.bin 0x100000 blank_1MB.bin 0x200000 blank_1MB.bin 0x300000 blank_1MB.bin`
408405

409-
#### View serial debug
406+
### View serial debug
410407

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

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

419416
***
420417

421-
## About
418+
# About
422419

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

@@ -432,6 +429,6 @@ Contributions by:
432429
- @lincomatic
433430
- @joverbee
434431

435-
## Licence
432+
# Licence
436433

437434
GNU General Public License (GPL) V3

0 commit comments

Comments
 (0)