Skip to content

Commit 4aa9d89

Browse files
authored
Merge pull request #207 from OpenEVSE/espidf4
Platform IO ESP32 core 4.4
2 parents 139d881 + 917734b commit 4aa9d89

File tree

13 files changed

+184
-1495
lines changed

13 files changed

+184
-1495
lines changed

.github/workflows/build.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+
13
name: Build/Release OpenEVSE
24

35
on:
@@ -17,6 +19,7 @@ jobs:
1719
env:
1820
- openevse_nodemcu-32s
1921
- openevse_esp-wrover-kit
22+
- openevse_esp-wrover-kit_latest
2023
- openevse_huzzah32_dev
2124
- openevse_huzzah32
2225
- openevse_featheresp32

.gitignore

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

9292
*.bin
93-

platformio.ini

Lines changed: 64 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,9 @@ debug_flags =
6262
#-D ENABLE_PROFILE
6363
src_build_flags =
6464
# -D ARDUINOJSON_USE_LONG_LONG
65-
# -D ENABLE_ASYNC_WIFI_SCAN
65+
# -D ENABLE_ASYNC_WIFI_SCAN
6666
build_flags =
67+
-D ESP32
6768
-D CS_PLATFORM=CS_P_ESP32
6869
-D MG_ENABLE_SSL=1
6970
-D MG_ENABLE_HTTP_STREAMING_MULTIPART=1
@@ -77,6 +78,7 @@ build_flags =
7778
#-D CS_ENABLE_DEBUG
7879
#-D MBEDTLS_DEBUG_C
7980
-D MG_ENABLE_SNTP=1
81+
#-D ENABLE_DEBUG_MICROTASKS
8082
-D CS_PLATFORM=CS_P_ESP32
8183
-D AO_CUSTOM_WS ; ArduinoOcpp: don't use built-in WS library
8284
-D AO_CUSTOM_CONSOLE ; ArduinoOcpp: use custom debug out
@@ -85,48 +87,57 @@ build_flags =
8587
#-D ENABLE_DEBUG_MONGOOSE_HTTP_CLIENT
8688
-D RAPI_MAX_COMMANDS=20
8789
-D BUILD_ENV_NAME="$PIOENV"
90+
-D ARDUINO_ARCH_ESP32
91+
-D USE_ESP32
92+
-D USE_ESP32_FRAMEWORK_ARDUINO
8893
build_partitions = min_spiffs.csv
89-
monitor_flags = --filter=esp32_exception_decoder
9094

9195
neopixel_lib = adafruit/Adafruit [email protected]
9296

97+
98+
[env]
9399
# specify exact Arduino ESP SDK version, requires platformio 3.5+ (curently dev version)
94100
# http://docs.platformio.org/en/latest/projectconf/section_env_general.html#platform
95101
#platform = https://github.com/platformio/platform-espressif32.git#feature/stage
96102
#platform = https://github.com/platformio/platform-espressif32.git#develop
97-
98-
#platform = espressif32
99-
100-
[env:openevse_nodemcu-32s]
101-
platform = ${common.platform}
102-
board = nodemcu-32s
103-
framework = arduino, espidf
103+
#platform = [email protected]
104+
105+
#framework = arduino, espidf
106+
framework = arduino
104107
lib_deps = ${common.lib_deps}
105108
lib_ignore = ${common.lib_ignore}
106-
src_build_flags =
107-
${common.version}.dev
108-
${common.src_build_flags}
109-
${common.debug_flags}
110-
-D WIFI_LED=2
111-
-D WIFI_LED_ON_STATE=LOW
112-
-D RAPI_PORT=Serial2
113109
build_flags =
114110
${common.build_flags}
115111
#upload_port = openevse.local
116112
upload_speed = 921600
117113
monitor_speed = 115200
118114
extra_scripts = ${common.extra_scripts}
119115
board_build.partitions = ${common.build_partitions}
116+
#platform_packages =
117+
# ; use a special branch
118+
# framework-arduinoespressif32 @ https://github.com/marcovannoord/arduino-esp32.git#idf-release/v4.0
119+
# platformio/framework-arduinoespressif32 @ ~3.10006.0
120+
monitor_flags =
121+
--filter=esp32_exception_decoder
122+
123+
[env:openevse_nodemcu-32s]
124+
board = nodemcu-32s
125+
build_flags =
126+
${common.build_flags}
127+
${common.version}.dev
128+
${common.src_build_flags}
129+
${common.debug_flags}
130+
-D WIFI_LED=2
131+
-D WIFI_LED_ON_STATE=LOW
132+
-D RAPI_PORT=Serial2
120133

121134
[env:openevse_esp-wrover-kit]
122-
platform = ${common.platform}
123135
board = esp-wrover-kit
124-
framework = arduino, espidf
125136
lib_deps =
126137
${common.lib_deps}
127138
${common.neopixel_lib}
128-
lib_ignore = ${common.lib_ignore}
129-
src_build_flags =
139+
build_flags =
140+
${common.build_flags}
130141
${common.version}.dev
131142
${common.src_build_flags}
132143
${common.debug_flags}
@@ -138,30 +149,26 @@ src_build_flags =
138149
-D RED_LED=0
139150
-D GREEN_LED=2
140151
-D BLUE_LED=4
141-
build_flags =
142-
${common.build_flags}
143152
-D RX1=25
144153
-D TX1=27
145-
-ggdb
146154
#upload_port = openevse.local
147155
#upload_protocol = espota
148156
upload_speed = 2000000
149157
#upload_protocol = ftdi
150-
monitor_speed = 115200
151-
extra_scripts = ${common.extra_scripts}
152-
board_build.partitions = ${common.build_partitions}
153-
lib_extra_dirs = lib
154158

155159
# export PLATFORMIO_UPLOAD_PORT=172.16.0.157
156160
# export PLATFORMIO_UPLOAD_FLAGS="-p 3232"
161+
162+
163+
[env:openevse_esp-wrover-kit_latest]
164+
extends = env:openevse_esp-wrover-kit
165+
platform = espressif32
166+
157167
[env:openevse_huzzah32_dev]
158-
platform = ${common.platform}
159168
board = featheresp32
160-
framework = arduino, espidf
161-
lib_deps = ${common.lib_deps}
162-
lib_ignore = ${common.lib_ignore}
163-
src_build_flags =
169+
build_flags =
164170
${common.version}.dev
171+
${common.build_flags}
165172
${common.src_build_flags}
166173
${common.debug_flags}
167174
-D WIFI_LED=13
@@ -170,21 +177,11 @@ src_build_flags =
170177
-D WIFI_BUTTON_PRESSED_STATE=LOW
171178
-D RAPI_PORT=Serial
172179
-D DEBUG_PORT=Serial2
173-
-D SERIAL_RX_PULLUP_PIN=3
174-
build_flags =
175-
${common.build_flags}
176-
upload_speed = 921600
177-
monitor_speed = 115200
178-
extra_scripts = ${common.extra_scripts}
179-
board_build.partitions = ${common.build_partitions}
180180

181181
[env:openevse_huzzah32]
182-
platform = ${common.platform}
183182
board = featheresp32
184-
framework = arduino, espidf
185-
lib_deps = ${common.lib_deps}
186-
lib_ignore = ${common.lib_ignore}
187-
src_build_flags =
183+
build_flags =
184+
${common.build_flags}
188185
${common.version}
189186
${common.src_build_flags}
190187
-D WIFI_LED=13
@@ -193,46 +190,27 @@ src_build_flags =
193190
-D WIFI_BUTTON_PRESSED_STATE=LOW
194191
-D RAPI_PORT=Serial
195192
-D DEBUG_PORT=Serial2
196-
-D SERIAL_RX_PULLUP_PIN=3
197-
build_flags =
198-
${common.build_flags}
199-
upload_speed = 921600
200-
monitor_speed = 115200
201-
extra_scripts = ${common.extra_scripts}
202-
board_build.partitions = ${common.build_partitions}
203193

204194
[env:openevse_featheresp32]
205-
platform = ${common.platform}
206195
board = featheresp32
207-
framework = arduino, espidf
208-
lib_deps = ${common.lib_deps}
209-
lib_ignore = ${common.lib_ignore}
210-
src_build_flags =
196+
build_flags =
197+
${common.build_flags}
211198
${common.version}.dev
212199
${common.src_build_flags}
213200
${common.debug_flags}
214201
-D WIFI_LED=LED_BUILTIN
215202
-D WIFI_BUTTON=LED_BUILTIN
216203
-D RAPI_PORT=Serial2
217204
-D ENABLE_DEBUG_LED
218-
build_flags =
219-
${common.build_flags}
220-
#upload_port = openevse.local
221-
upload_speed = 921600
222-
monitor_speed = 115200
223-
extra_scripts = ${common.extra_scripts}
224-
board_build.partitions = ${common.build_partitions}
225205

226206
[env:openevse_wifi_v1]
227-
platform = ${common.platform}
228207
board = esp32dev
229-
framework = arduino, espidf
230208
lib_deps =
231209
${common.lib_deps}
232210
${common.neopixel_lib}
233211
adafruit/Adafruit MCP9808 Library @ 1.1.2
234-
lib_ignore = ${common.lib_ignore}
235-
src_build_flags =
212+
build_flags =
213+
${common.build_flags}
236214
${common.version}
237215
${common.src_build_flags}
238216
${common.debug_flags}
@@ -243,27 +221,18 @@ src_build_flags =
243221
-D WIFI_BUTTON_PRESSED_STATE=LOW
244222
-D RAPI_PORT=Serial
245223
-D DEBUG_PORT=Serial1
246-
-D SERIAL_RX_PULLUP_PIN=3
247224
-D I2C_SDA=21
248225
-D I2C_SCL=22
249226
-D ENABLE_MCP9808
250227
-D ENABLE_PN532
251-
build_flags =
252-
${common.build_flags}
253228
-D TX1=16
254-
upload_speed = 921600
255-
monitor_speed = 115200
256-
extra_scripts = ${common.extra_scripts}
257-
board_build.partitions = ${common.build_partitions}
229+
upload_command = curl -F firmware=@$SOURCE http://$UPLOAD_PORT/update --progress-bar | cat
258230

259231
[env:openevse_esp32-gateway]
260232
#For hardware older than RevE
261-
platform = ${common.platform}
262233
board = esp32-gateway
263-
framework = arduino, espidf
264-
lib_deps = ${common.lib_deps}
265-
lib_ignore = ${common.lib_ignore}
266-
src_build_flags =
234+
build_flags =
235+
${common.build_flags}
267236
${common.version}
268237
${common.src_build_flags}
269238
-D WIFI_LED=33
@@ -274,46 +243,40 @@ src_build_flags =
274243
-D RAPI_PORT=Serial2
275244
-D ENABLE_WIRED_ETHERNET
276245
-D RANDOM_SEED_CHANNEL=1
277-
build_flags =
278-
${common.build_flags}
279-
upload_speed = 115200
280-
monitor_speed = 115200
281-
extra_scripts = ${common.extra_scripts}
282246
# https://github.com/espressif/arduino-esp32/blob/master/libraries/WiFi/examples/ETH_LAN8720/ETH_LAN8720.ino
283-
board_build.partitions = ${common.build_partitions}
284247

285248
[env:openevse_esp32-gateway-e]
286249
# Tested working with hardware RevE and RevF
287250
#https://github.com/OpenEVSE/ESP32_WiFi_V3.x/blob/master/docs/wired-ethernet.md
288251
extends = env:openevse_esp32-gateway
289-
framework = arduino, espidf
290252
build_flags =
291253
${common.build_flags}
254+
${common.version}
255+
${common.src_build_flags}
256+
-D WIFI_LED=33
257+
-D WIFI_LED_ON_STATE=HIGH
258+
-D WIFI_BUTTON=34
259+
-D WIFI_BUTTON_PRESSED_STATE=LOW
260+
-D DEBUG_PORT=Serial
261+
-D RAPI_PORT=Serial2
262+
-D ENABLE_WIRED_ETHERNET
263+
-D RANDOM_SEED_CHANNEL=1
292264
-D RX2=16
293265
-D TX2=32
294266
board_build.extra_flags = "-DARDUINO_ESP32_GATEWAY=\'E\'"
295267
upload_speed = 921600
296268

297269
[env:openevse_esp32-heltec-wifi-lora-v2]
298-
platform = ${common.platform}
299270
board = heltec_wifi_lora_32_V2
300-
framework = arduino, espidf
301-
lib_deps = ${common.lib_deps}
302-
lib_ignore = ${common.lib_ignore}
303-
src_build_flags =
304-
${common.version}.dev
271+
build_flags =
272+
${common.build_flags}
305273
${common.src_build_flags}
274+
${common.version}.dev
275+
-D DEBUG_PORT=Serial
306276
-D WIFI_LED=25
307-
-D WIFI_BUTTON=2
308277
-D WIFI_LED_ON_STATE=HIGH
278+
-D WIFI_BUTTON=2
279+
-D WIFI_BUTTON_PRESSED_STATE=LOW
309280
-D RAPI_PORT=Serial1
310-
build_flags =
311-
${common.build_flags}
312281
-D RX1=25
313282
-D TX1=27
314-
#upload_port = openevse.local
315-
#upload_speed = 921600
316-
upload_protocol = esptool
317-
monitor_speed = 115200
318-
extra_scripts = ${common.extra_scripts}
319-
board_build.partitions = ${common.build_partitions}

src/evse_monitor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ EvseMonitor::EvseMonitor(OpenEVSEClass &openevse) :
169169
_session_complete(EVSE_MONITOR_SESSION_COMPLETE_MASK, EVSE_MONITOR_SESSION_COMPLETE_TRIGGER),
170170
_count(0),
171171
_heartbeat(false),
172+
_firmware_version(""),
172173
#ifdef ENABLE_MCP9808
173174
_mcp9808(),
174175
#endif

src/lcd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "openevse.h"
99
#include "input.h"
1010
#include "app_config.h"
11-
#include <time.h>
11+
#include <sys/time.h>
1212

1313
static void IGNORE(int ret) {
1414
}

src/main.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ loop() {
172172
ota_loop();
173173
rapiSender.loop();
174174
divert_current_loop();
175+
176+
Profile_Start(MicroTask);
175177
MicroTask.update();
178+
Profile_End(MicroTask, 10);
176179

177180
if(OpenEVSE.isConnected())
178181
{
@@ -262,12 +265,6 @@ void event_send(JsonDocument &event)
262265
void hardware_setup()
263266
{
264267
debug_setup();
265-
266-
#ifdef SERIAL_RX_PULLUP_PIN
267-
// https://forums.adafruit.com/viewtopic.php?f=57&t=153553&p=759890&hilit=esp32+serial+pullup#p769168
268-
pinMode(SERIAL_RX_PULLUP_PIN, INPUT_PULLUP);
269-
#endif
270-
271268
enableLoopWDT();
272269
}
273270

0 commit comments

Comments
 (0)