You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Copy file name to clipboardExpand all lines: readme.md
+68-71Lines changed: 68 additions & 71 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5

6
6
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.
8
8
9
9
[**See this repo for the older V2.x ESP8266 version**](https://github.com/openevse/ESP8266_WiFi_v2.x/)
10
10
@@ -33,7 +33,7 @@ Live demo: https://openevse.openenergymonitor.org
@@ -284,109 +284,106 @@ Admin HTTP Authentication (highly recommended) can be enabled by saving admin co
284
284
285
285
### Hardware reset
286
286
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.
288
288
289
289
*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*
290
290
291
291
### Firmware update
292
292
293
293
See [OpenEVSE Wifi releases](https://github.com/OpenEVSE/ESP32_WiFi_v3.x/releases) for latest stable pre-compiled update releases.
294
294
295
-
## Via Web Interface
295
+
####Via Web Interface
296
296
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.
298
298
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:
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:
306
306
307
307
`platformio run -t upload --upload-port <IP-ADDRESS>`
308
308
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):
310
312
311
313
`esptool.py write_flash 0x000000 firmware.bin`
312
314
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.
314
316
315
-
### Firmware Compile & Upload
317
+
#Development guide
316
318
317
-
If required firmware can also be uploaded via serial using USB to UART cable.
319
+
## Compiling and uploading firmware
318
320
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.
320
322
323
+
### Building the GUI static assets
321
324
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).
323
326
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/
325
328
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.
327
330
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:
To 'build' the GUI static assets, run the following from the `gui` directory:
333
340
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.
For info on the Arduino core for the ESP32 using PlatformIO, see: https://github.com/espressif/arduino-esp32/blob/master/docs/platformio.md
341
350
351
+
#### 1. Install PlatformIO
342
352
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).
344
354
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.
*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
354
360
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).
356
363
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:
358
365
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
367
368
```
368
369
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:
370
371
371
-
```shell
372
-
cd gui
373
-
npm run build
372
+
```
373
+
pio run -e openevse_huzzah32 -t upload
374
374
```
375
375
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*
379
377
380
378
***
381
379
382
-
### Troubleshooting
383
-
380
+
## Troubleshooting
384
381
385
-
####Uploading issues
382
+
### Uploading issues
386
383
387
384
- Double check device is in bootloder mode
388
385
- 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:
390
387
391
388
`$ esptool.py erase_flash`
392
389
@@ -400,13 +397,13 @@ Erasing flash (this may take a while)...
400
397
Erase took 8.0 seconds
401
398
```
402
399
403
-
**Fully erase ESP**
400
+
### Fully erase ESP
404
401
405
402
To fully erase all memory locations on an ESP-12 (4Mb) we need to upload a blank file to each memory location
0 commit comments