Skip to content

Commit b039757

Browse files
committed
Merge branch 'master' into issue71/Vehicle_config_ui
2 parents 927eb6a + dbe4215 commit b039757

22 files changed

+900
-38
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,5 @@ lib/MicroDebug
9090
lib/StreamSpy
9191
lib/MicroTasks
9292

93-
.bin
93+
*.bin
94+

docs/divert-advanced.png

66.1 KB
Loading

platformio.ini

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,21 @@ data_dir = src/data
2929
default_envs = openevse_wifi_v1
3030

3131
[common]
32-
version = -DBUILD_TAG=4.0.0
32+
version = -DBUILD_TAG=4.0.1
3333
monitor_speed = 115200
3434
lib_deps =
3535
36-
36+
3737
3838
3939
4040
4141
42-
42+
4343
4444
45+
46+
lib_ignore = WebSockets ; ArduinoOcpp: don't compile built-in WS library
4547
extra_scripts = scripts/extra_script.py
4648
debug_flags =
4749
-ggdb
@@ -76,6 +78,7 @@ build_flags =
7678
#-DMBEDTLS_DEBUG_C
7779
-DMG_ENABLE_SNTP=1
7880
-DCS_PLATFORM=CS_P_ESP32
81+
-DAO_CUSTOM_WS ; ArduinoOcpp: don't use built-in WS library
7982
#-DENABLE_DEBUG
8083
#-DENABLE_DEBUG_MONGOOSE_HTTP_CLIENT
8184
build_partitions = min_spiffs.csv
@@ -95,6 +98,7 @@ platform = ${common.platform}
9598
board = nodemcu-32s
9699
framework = arduino, espidf
97100
lib_deps = ${common.lib_deps}
101+
lib_ignore = ${common.lib_ignore}
98102
src_build_flags =
99103
${common.version}.dev
100104
${common.src_build_flags}
@@ -117,6 +121,7 @@ framework = arduino, espidf
117121
lib_deps =
118122
${common.lib_deps}
119123
${common.neopixel_lib}
124+
lib_ignore = ${common.lib_ignore}
120125
src_build_flags =
121126
${common.version}.dev
122127
${common.src_build_flags}
@@ -148,6 +153,7 @@ platform = ${common.platform}
148153
board = featheresp32
149154
framework = arduino, espidf
150155
lib_deps = ${common.lib_deps}
156+
lib_ignore = ${common.lib_ignore}
151157
src_build_flags =
152158
${common.version}.dev
153159
${common.src_build_flags}
@@ -171,6 +177,7 @@ platform = ${common.platform}
171177
board = featheresp32
172178
framework = arduino, espidf
173179
lib_deps = ${common.lib_deps}
180+
lib_ignore = ${common.lib_ignore}
174181
src_build_flags =
175182
${common.version}
176183
${common.src_build_flags}
@@ -193,6 +200,7 @@ platform = ${common.platform}
193200
board = featheresp32
194201
framework = arduino, espidf
195202
lib_deps = ${common.lib_deps}
203+
lib_ignore = ${common.lib_ignore}
196204
src_build_flags =
197205
${common.version}.dev
198206
${common.src_build_flags}
@@ -217,6 +225,7 @@ lib_deps =
217225
${common.lib_deps}
218226
${common.neopixel_lib}
219227
adafruit/Adafruit MCP9808 Library @ 1.1.2
228+
lib_ignore = ${common.lib_ignore}
220229
src_build_flags =
221230
${common.version}
222231
${common.src_build_flags}
@@ -245,6 +254,7 @@ platform = ${common.platform}
245254
board = esp32-gateway
246255
framework = arduino, espidf
247256
lib_deps = ${common.lib_deps}
257+
lib_ignore = ${common.lib_ignore}
248258
src_build_flags =
249259
${common.version}
250260
${common.src_build_flags}
@@ -280,6 +290,7 @@ platform = ${common.platform}
280290
board = heltec_wifi_lora_32_V2
281291
framework = arduino, espidf
282292
lib_deps = ${common.lib_deps}
293+
lib_ignore = ${common.lib_ignore}
283294
src_build_flags =
284295
${common.version}.dev
285296
${common.src_build_flags}

readme.md

Lines changed: 82 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
1-
# OpenEVSE WiFi Gateway v4
1+
# OpenEVSE WiFi ESP32 Gateway v4
22

3-
> **_NOTE:_** Breaking change! This release requires a minimum of [7.1.2](https://github.com/lincomatic/open_evse) of the OpenEVSE firmware, features may not behave as expected on older firmware.
4-
-
5-
-For the v3 that is compatible with previous EVSE firmwares, see the [v3 branch](https://github.com/OpenEVSE/ESP32_WiFi_V3.x/tree/v3). For the older v2 ESP8266 version (pre June 2020), see the [v2 firmware repository](https://github.com/openevse/ESP8266_WiFi_v2.x/)
6-
-
7-
-Instructions on updating the OpenEVSE firmware see [How to Load OpenEVSE Firmware (WinAVR)
8-
-](https://openevse.dozuki.com/Guide/How+to+Load+OpenEVSE+Firmware+(WinAVR)/7?lang=en)
3+
> **_NOTE:_** Breaking change! This release reccomends a minimum of [7.1.3](https://github.com/OpenEVSE/open_evse/releases) of the OpenEVSE firmware, features including Solar Divert and push button menus may not behave as expected on older firmware.
4+
5+
- *For the older WiFi V2.x ESP8266 version (pre June 2020), see the [v2 firmware repository](https://github.com/openevse/ESP8266_WiFi_v2.x/)*
96

107

118
![main](docs/main2.png)
129

1310
The WiFi gateway uses an **ESP32** which communicates with the OpenEVSE controller via serial RAPI API. The web UI is served directly from the ESP32 web server and can be controlled via a connected device on the local network.
1411

15-
Wired Ethernet connection is possible using [ESP32 Gateway](docs/wired-ethernet.md)
16-
17-
[**See this repo for the older V2.x ESP8266 version (pre June 2020)**](https://github.com/openevse/ESP8266_WiFi_v2.x/)
12+
**This FW also supports wired Ethernet connection using [ESP32 Gateway](docs/wired-ethernet.md)**
1813

1914
**[Live UI demo](https://openevse.openenergymonitor.org)**
2015

@@ -36,7 +31,7 @@ Wired Ethernet connection is possible using [ESP32 Gateway](docs/wired-ethernet.
3631
### OpenEVSE / EmonEVSE charging station
3732
- Purchase via: [OpenEVSE Store (USA/Canda)](https://store.openevse.com) | [OpenEnergyMonitor (UK / EU)](https://shop.openenergymonitor.com/evse/)
3833
- OpenEVSE FW [V7.1.3+ recommended](https://github.com/OpenEVSE/open_evse/releases)
39-
- All new OpenEVSE units are shipped with V4.8.0 pre-loaded (October 2017 onwards)
34+
- All new OpenEVSE units are shipped with V7.1.3 pre-loaded (April 2021 onwards)
4035

4136

4237
### ESP32 WiFi Module
@@ -62,20 +57,27 @@ Wired Ethernet connection is possible using [ESP32 Gateway](docs/wired-ethernet.
6257
* [WiFi Setup](#wifi-setup)
6358
* [Charging Mode: Eco](#charging-mode-eco)
6459
+ [Eco Mode Setup](#eco-mode-setup)
60+
+ [Eco Mode Advanced Settings](#eco-mode-advanced-settings)
6561
* [Services](#services)
6662
+ [Emoncms data logging](#emoncms-data-logging)
6763
+ [MQTT](#mqtt)
6864
- [OpenEVSE Status via MQTT](#openevse-status-via-mqtt)
69-
+ [RAPI](#rapi)
65+
+ [RAPI API (Not Recommended)](#rapi-api-not-recommended)
7066
- [RAPI via web interface](#rapi-via-web-interface)
7167
- [RAPI over MQTT](#rapi-over-mqtt)
7268
- [RAPI over HTTP](#rapi-over-http)
73-
+ [HTTP API](#http-api)
69+
+ [HTTP API (Recommended)](#http-api-recommended)
70+
- [Manual Override API](#manual-override-api)
71+
- [Schedule timers API](#schedule-timers-api)
72+
- [Status API](#status-api)
73+
- [Config API](#config-api)
7474
+ [Tesla API](#tesla-api)
7575
+ [OhmConnect](#ohmconnect)
7676
* [System](#system)
7777
+ [Authentication](#authentication)
78-
+ [Hardware reset](#hardware-reset)
78+
+ [WiFi Reset](#wifi-reset)
79+
+ [HTTP Auth Password reset](#http-auth-password-reset)
80+
+ [Hardware Factory Reset](#hardware-factory-reset)
7981
+ [Firmware update](#firmware-update)
8082
- [Via Web Interface](#via-web-interface)
8183
- [Via Network OTA](#via-network-ota)
@@ -158,7 +160,8 @@ A [OpenEnergyMonitor Solar PV Energy Monitor](https://guide.openenergymonitor.or
158160
- Grid Import (positive Import / Negative export*): `emon/emonpi/power1`
159161
- Solar PV generation (always postive): `emon/emonpi/power2`
160162

161-
**NoteL 'Grid' feed should include the power consumed by the EVSEE**
163+
**Note#1: 'Grid' feed should include the power consumed by the EVSE**
164+
**Note#2: The EVSE expects the MQTT data to update every 5-10s, perforamce will be degraded if the update interval is much faster or slower than this**
162165

163166
**CT sensor can be physically reversed on the cable to invert the reading.*
164167

@@ -168,7 +171,21 @@ Divertmode can be controlled via mqtt
168171

169172
Topic: `<base-topic>/divertmode/set`
170173
Value: `1` = Normal or `2` = Eco
171-
174+
175+
### Eco Mode Advanced Settings
176+
177+
If 'advanced' mode is toggled on the UI more solar PV divert settings will become available:
178+
179+
![eco](docs/divert-advanced.png)
180+
181+
- Required PV power ratio: specifies which fraction of the EV charging current should come from PV excess. Default value 110% (1.1)
182+
- Divert smoothing attack: controls how quickly the EVSE responds to an increase in solar PV / grid excess. Default value 40% (0.4)
183+
- Divert Smoothing decay: controls how quickly the EVSE responds to a decrease in solar PV / grid excess. Default value 5% (0.05)
184+
- Minimum charge time: the amount of time in seconds the EVSE should run for when triggered by solar PV / grid excess
185+
186+
See this [interactive spreadsheet](https://docs.google.com/spreadsheets/d/1GQEAQ5QNvNuShEsUdcrNsFC12U3pQfcD_NetoIfDoko/edit?usp=sharing) to explore how these values effect the smoothing algorithm.
187+
188+
**Caution: adjust these values at your own risk, the default values have been set to minimise wear on the EVSE contactor and the EVs chraging system. Rapid switching of the EVSE will result in increased wear on these components**
172189

173190

174191
***
@@ -216,10 +233,12 @@ MQTT setup is pre-populated with OpenEnergyMonitor [emonPi default MQTT server c
216233

217234
MQTT can also be used to control the OpenEVSE, see RAPI MQTT below.
218235

219-
### RAPI
236+
### RAPI API (Not Recommended)
220237

221238
RAPI commands can be used to control and check the status of all OpenEVSE functions. RAPI commands can be issued via the direct serial, web-interface, HTTP and MQTT. We recommend using RAPI over MQTT.
222239

240+
**IMPORTANT: It is no longer recommended to use RAPI API if EVSE also had a WiFi module fitted, since use of the RAPI API will conflict with the WiFi module, instead the HTTP API should be used to control the WiFi module instead of the controller via RAPI. User RAPI API will be disabled in future releases**
241+
223242
**A full list of RAPI commands can be found in the [OpenEVSE plus source code](https://github.com/OpenEVSE/open_evse/blob/stable/firmware/open_evse/src/rapi_proc.h).**
224243

225244
#### RAPI via web interface
@@ -232,6 +251,8 @@ Enter RAPI commands directly into to web interface (dev mode must be enabled), R
232251

233252
#### RAPI over MQTT
234253

254+
**IMPORTANT: It is no longer recommended to use RAPI API if EVSE also had a WiFi module fitted, since use of the RAPI API will conflict with the WiFi module, instead the HTTP API should be used to control the WiFi module instead of the controller via RAPI. User RAPI API will be disabled in future releases**
255+
235256
RAPI commands can be issued via MQTT messages. The RAPI command should be published to the following MQTT:
236257

237258
`<base-topic>/rapi/in/<$ rapi-command> payload`
@@ -254,6 +275,8 @@ e.g. `$OK`
254275

255276
#### RAPI over HTTP
256277

278+
**IMPORTANT: It is no longer recommended to use RAPI API if EVSE also had a WiFi module fitted, since use of the RAPI API will conflict with the WiFi module, instead the HTTP API should be used to control the WiFi module instead of the controller via RAPI. User RAPI API will be disabled in future releases**
279+
257280
RAPI (rapid API) commands can also be issued directly via a single HTTP request.
258281

259282
Using RAPI commands should be avoided if possible. WiFi server API is preferable. If RAPI must be used, avoid fast polling.
@@ -275,14 +298,55 @@ To enable (start / resume a charge) issue RAPI command `$FE`
275298

276299
There is also an [OpenEVSE RAPI command python library](https://github.com/tiramiseb/python-openevse).
277300

278-
### HTTP API
301+
### HTTP API (Recommended)
302+
303+
#### Manual Override API
304+
305+
Manual override can be used to override a charging timer or to immediately start a charge if the EVSE is in sleeping state.
306+
307+
Enable Manual Override:
308+
309+
`curl 'http://openevse-xxx/override' --data-raw '{"state":"disabled"}' `
310+
311+
Disable Manual Override:
312+
313+
`curl 'http://openevse-xxx/override' -X 'DELETE'`
314+
315+
View Manual Override status:
316+
317+
http://openevse-xxx/override
318+
319+
#### Schedule timers API
320+
321+
Example
322+
323+
```
324+
curl 'http://openevse-xxx/schedule' \
325+
--data-raw '[{"id":1,"state":"active","days":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"time":"07:00"},{"id":2,"state":"disable","days":["monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"time":"10:00"}]'
326+
```
327+
328+
View schedule timers:
329+
330+
http://openevse-xxx/schedule
331+
332+
Remove shedule timers:
333+
334+
` curl 'http://192.168.0.104/schedule/1' -X 'DELETE'`
335+
` curl 'http://192.168.0.104/schedule/2' -X 'DELETE'`
336+
337+
338+
#### Status API
339+
340+
279341

280342
Current status of the OpenEVSE in JSON format is available via: `http://openevse-xxxx/status` e.g
281343

282344
```
283345
{"mode":"STA","wifi_client_connected":1,"eth_connected":0,"net_connected":1,"srssi":-73,"ipaddress":"192.168.1.43","emoncms_connected":1,"packets_sent":22307,"packets_success":22290,"mqtt_connected":1,"ohm_hour":"NotConnected","free_heap":203268,"comm_sent":335139,"comm_success":335139,"rapi_connected":1,"amp":0,"pilot":32,"temp1":282,"temp2":-2560,"temp3":-2560,"state":254,"elapsed":3473,"wattsec":22493407,"watthour":51536,"gfcicount":0,"nogndcount":0,"stuckcount":0,"divertmode":1,"solar":390,"grid_ie":0,"charge_rate":7,"divert_update":0,"ota_update":0,"time":"2020-05-12T17:53:48Z","offset":"+0000"}
284346
```
285347

348+
#### Config API
349+
286350
Current config of the OpenEVSE in JSON format is available via `http://openevse-xxxx/config` e.g
287351

288352
```

0 commit comments

Comments
 (0)