Major Update

- Added proper Automated naming scheme for firmware files.
Looks awesome now :)
- changed "easynetwork" to "openiris" in project_config.cpp
This commit is contained in:
ZanzyTHEbar 2022-09-09 22:49:11 +01:00
parent 30067f7648
commit dcaefbccac
4 changed files with 68 additions and 13 deletions

View File

@ -119,7 +119,7 @@ void ProjectConfig::load()
} }
/* Device Config */ /* Device Config */
this->config.device.name = getString("deviceName", "easynetwork").c_str(); this->config.device.name = getString("deviceName", "openiris").c_str();
this->config.device.OTAPassword = getString("OTAPassword", "12345678").c_str(); this->config.device.OTAPassword = getString("OTAPassword", "12345678").c_str();
this->config.device.OTAPort = getInt("OTAPort", 3232); this->config.device.OTAPort = getInt("OTAPort", 3232);
//! No need to load the JSON strings or bools, they are generated and used on the fly //! No need to load the JSON strings or bools, they are generated and used on the fly
@ -155,7 +155,7 @@ void ProjectConfig::load()
} }
/* AP Config */ /* AP Config */
this->config.ap_network.ssid = getString("apSSID", "easynetwork").c_str(); this->config.ap_network.ssid = getString("apSSID", "openiris").c_str();
this->config.ap_network.password = getString("apPass", "12345678").c_str(); this->config.ap_network.password = getString("apPass", "12345678").c_str();
this->config.ap_network.channel = getUInt("apChannel", 1); this->config.ap_network.channel = getUInt("apChannel", 1);

View File

@ -75,6 +75,8 @@ monitor_filters =
time time
default default
esp32_exception_decoder esp32_exception_decoder
release_version = 0.0.1 ; increase this value every release build
build_flags = build_flags =
@ -102,18 +104,20 @@ build_flags =
-DCORE_DEBUG_LEVEL=4 -DCORE_DEBUG_LEVEL=4
!python tools\git_rev.py ; add git revision to build as preprocessor defines
-DBOARD_HAS_PSRAM -DBOARD_HAS_PSRAM
-DASYNCWEBSERVER_REGEX ; add regex support to AsyncWebServer -DASYNCWEBSERVER_REGEX
-mfix-esp32-psram-cache-issue -mfix-esp32-psram-cache-issue
build_unflags = -Os build_unflags = -Os
; board_build.partitions = min_spiffs.csv ; board_build.partitions = min_spiffs.csv
board_build.partitions = huge_app.csv board_build.partitions = huge_app.csv
lib_ldf_mode = deep+ lib_ldf_mode = deep+
upload_speed = 921600 upload_speed = 921600
release_version = 0.0.1 ; increase this value every release build
lib_deps = lib_deps =
esp32-camera esp32-camera
leftcoast/LC_baseTools@^1.5 leftcoast/LC_baseTools@^1.5
@ -123,6 +127,7 @@ lib_deps =
https://github.com/bblanchon/ArduinoJson.git https://github.com/bblanchon/ArduinoJson.git
build_type = debug build_type = debug
extra_scripts = pre:tools/customname.py
[env:esp32Cam] [env:esp32Cam]
platform = ${common.platform} platform = ${common.platform}
@ -153,6 +158,7 @@ build_flags = ${common.build_flags}
-DPCLK_GPIO_NUM=${pinoutsESPCAM.PCLK_GPIO_NUM} ; Set the PCLK pin -DPCLK_GPIO_NUM=${pinoutsESPCAM.PCLK_GPIO_NUM} ; Set the PCLK pin
-DDEBUG_MODE=1 ; Set the debug mode -DDEBUG_MODE=1 ; Set the debug mode
-DVERSION=0
build_unflags = ${common.build_unflags} build_unflags = ${common.build_unflags}
board_build.partitions = ${common.board_build.partitions} board_build.partitions = ${common.board_build.partitions}
@ -160,6 +166,7 @@ lib_ldf_mode = ${common.lib_ldf_mode}
upload_speed = ${common.upload_speed} upload_speed = ${common.upload_speed}
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
build_type = ${common.build_type} build_type = ${common.build_type}
extra_scripts = ${common.extra_scripts}
[env:esp32Cam_release] [env:esp32Cam_release]
platform = ${common.platform} platform = ${common.platform}
@ -179,6 +186,7 @@ lib_ldf_mode = ${common.lib_ldf_mode}
upload_speed = ${common.upload_speed} upload_speed = ${common.upload_speed}
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
build_type = release build_type = release
extra_scripts = ${common.extra_scripts}
; Experimental OTA Environment - do not select unless you know what you are doing ; Experimental OTA Environment - do not select unless you know what you are doing
[env:esp32Cam_OTA] [env:esp32Cam_OTA]
@ -191,13 +199,11 @@ build_flags =
-DCORE_DEBUG_LEVEL=1 -DCORE_DEBUG_LEVEL=1
-DDEBUG_ESP_OTA -DDEBUG_ESP_OTA
-DVERSION=${common.release_version} -DVERSION=${common.release_version}
lib_deps = lib_deps = ${common.lib_deps}
${common.lib_deps}
upload_speed = ${common.upload_speed} upload_speed = ${common.upload_speed}
monitor_speed = ${common.monitor_speed} monitor_speed = ${common.monitor_speed}
monitor_rts = ${common.monitor_rts} monitor_rts = ${common.monitor_rts}
monitor_dtr = ${common.monitor_dtr} monitor_dtr = ${common.monitor_dtr}
; extra_scripts = ${common.extra_scripts}
board_build.partitions = ${common.board_build.partitions} board_build.partitions = ${common.board_build.partitions}
lib_ldf_mode = ${common.lib_ldf_mode} lib_ldf_mode = ${common.lib_ldf_mode}
upload_port = 192.168.1.38 upload_port = 192.168.1.38
@ -206,6 +212,7 @@ upload_flags =
--port=3232 --port=3232
--auth=12345678 --auth=12345678
build_type = release build_type = release
extra_scripts = ${common.extra_scripts}
[env:wrover] [env:wrover]
platform = ${common.platform} platform = ${common.platform}
@ -242,10 +249,10 @@ build_unflags = ${common.build_unflags}
board_build.partitions = ${common.board_build.partitions} board_build.partitions = ${common.board_build.partitions}
lib_ldf_mode = ${common.lib_ldf_mode} lib_ldf_mode = ${common.lib_ldf_mode}
upload_speed = ${common.upload_speed} upload_speed = ${common.upload_speed}
lib_deps = lib_deps = ${common.lib_deps}
${common.lib_deps}
;upload_port = COM6 ;upload_port = COM6
build_type = ${common.build_type} build_type = ${common.build_type}
extra_scripts = ${common.extra_scripts}
[env:wrover_release] [env:wrover_release]
platform = ${common.platform} platform = ${common.platform}
@ -266,6 +273,7 @@ upload_speed = ${common.upload_speed}
lib_deps = ${common.lib_deps} lib_deps = ${common.lib_deps}
upload_port = COM6 upload_port = COM6
build_type = release build_type = release
extra_scripts = ${common.extra_scripts}
; Experimental OTA Environment - do not select unless you know what you are doing ; Experimental OTA Environment - do not select unless you know what you are doing
[env:wrover_OTA] [env:wrover_OTA]
@ -278,13 +286,11 @@ build_flags =
-DCORE_DEBUG_LEVEL=1 -DCORE_DEBUG_LEVEL=1
-DDEBUG_ESP_OTA -DDEBUG_ESP_OTA
-DVERSION=${common.release_version} -DVERSION=${common.release_version}
lib_deps = lib_deps = ${common.lib_deps}
${common.lib_deps}
upload_speed = ${common.upload_speed} upload_speed = ${common.upload_speed}
monitor_speed = ${common.monitor_speed} monitor_speed = ${common.monitor_speed}
monitor_rts = ${common.monitor_rts} monitor_rts = ${common.monitor_rts}
monitor_dtr = ${common.monitor_dtr} monitor_dtr = ${common.monitor_dtr}
; extra_scripts = ${common.extra_scripts}
board_build.partitions = ${common.board_build.partitions} board_build.partitions = ${common.board_build.partitions}
lib_ldf_mode = ${common.lib_ldf_mode} lib_ldf_mode = ${common.lib_ldf_mode}
upload_port = 192.168.1.38 upload_port = 192.168.1.38
@ -293,3 +299,4 @@ upload_flags =
--port=3232 --port=3232
--auth=12345678 --auth=12345678
build_type = release build_type = release
extra_scripts = ${common.extra_scripts}

23
ESP/tools/customname.py Normal file
View File

@ -0,0 +1,23 @@
# Description: Custom name for firmware
Import("env")
my_flags = env.ParseFlags(env['BUILD_FLAGS'])
defines = dict()
for x in my_flags.get("CPPDEFINES"):
if type(x) is tuple:
(k,v) = x
defines[k] = v
elif type(x) is list:
k = x[0]
v = x[1]
defines[k] = v
else:
defines[x] = "" # empty value
# defines.get("PIO_SRC_TAG") - tag name
# strip quotes needed for shell escaping
s = lambda x: x.replace('"', "")
env.Replace(
PROGNAME="%s-%s-%s-%s-%s" %
(s(defines.get("PIO_SRC_NAM")), s(defines.get("VERSION")), str(env["BOARD"]),
s(defines.get("PIO_SRC_REV")), s(defines.get("PIO_SRC_BRH"))))

25
ESP/tools/git_rev.py Normal file
View File

@ -0,0 +1,25 @@
import subprocess
# Get Git project name
projcmd = "git rev-parse --show-toplevel"
project = subprocess.check_output(projcmd, shell=True).decode().strip()
project = project.split("/")
project = project[len(project)-1]
# Get 0.0.0 version from latest Git tag
# tagcmd = "git describe --tags --abbrev=0"
# version = subprocess.check_output(tagcmd, shell=True).decode().strip()
# Get latest commit short from Git
revcmd = "git log --pretty=format:'%h' -n 1"
commit = subprocess.check_output(revcmd, shell=True).decode().strip()
# Get branch name from Git
branchcmd = "git rev-parse --abbrev-ref HEAD"
branch = subprocess.check_output(branchcmd, shell=True).decode().strip()
# Make all available for use in the macros
print("-DPIO_SRC_NAM={0}".format(project))
# print("-DPIO_SRC_TAG={0}".format(version))
print("-DPIO_SRC_REV={0}".format(commit))
print("-DPIO_SRC_BRH={0}".format(branch))