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
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.
10
8
11
9
[**See this repo for the older V2.x ESP8266 version**](https://github.com/openevse/ESP8266_WiFi_v2.x/)
12
10
@@ -35,7 +33,7 @@ Live demo: https://openevse.openenergymonitor.org
@@ -286,109 +284,106 @@ Admin HTTP Authentication (highly recommended) can be enabled by saving admin co
286
284
287
285
### Hardware reset
288
286
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.
290
288
291
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*
292
290
293
291
### Firmware update
294
292
295
293
See [OpenEVSE Wifi releases](https://github.com/OpenEVSE/ESP32_WiFi_v3.x/releases) for latest stable pre-compiled update releases.
296
294
297
-
## Via Web Interface
295
+
####Via Web Interface
298
296
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.
300
298
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:
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:
308
306
309
307
`platformio run -t upload --upload-port <IP-ADDRESS>`
310
308
311
-
## Via USB Serial Programmer
309
+
####Via USB Serial Programmer
312
310
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):
316
312
317
-
### Firmware Compile & Upload
313
+
`esptool.py write_flash 0x000000 firmware.bin`
318
314
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.
320
316
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
322
318
319
+
## Compiling and uploading firmware
323
320
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.
325
322
326
-
For more detailed ESP8266 Arduino core specific PlatfomIO notes see: https://github.com/esp8266/Arduino#using-platformio
323
+
### Building the GUI static assets
327
324
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).
329
326
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/
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.
333
330
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:
335
332
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.
Now you are ready to compile and upload to the ESP32.
343
346
347
+
### Compile and upload using PlatformIO
344
348
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
346
350
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
350
352
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).
354
354
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
356
356
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)
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).
362
363
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:
364
365
365
-
```shell
366
-
git submodule update --init
367
-
cd gui
368
-
npm install
366
+
```
367
+
pio run -t upload
369
368
```
370
369
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:
372
371
373
-
```shell
374
-
cd gui
375
-
npm run build
372
+
```
373
+
pio run -e openevse_huzzah32 -t upload
376
374
```
377
375
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*
381
377
382
378
***
383
379
384
-
### Troubleshooting
385
-
380
+
## Troubleshooting
386
381
387
-
####Uploading issues
382
+
### Uploading issues
388
383
389
384
- Double check device is in bootloder mode
390
385
- 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:
392
387
393
388
`$ esptool.py erase_flash`
394
389
@@ -402,13 +397,13 @@ Erasing flash (this may take a while)...
402
397
Erase took 8.0 seconds
403
398
```
404
399
405
-
**Fully erase ESP**
400
+
### Fully erase ESP
406
401
407
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