From 3569000520757df0bcfb4ddd7d275626dde80c0f Mon Sep 17 00:00:00 2001 From: ZanzyTHEbar Date: Sun, 1 Jan 2023 21:07:24 +0000 Subject: [PATCH] fix OTA management --- ESP/platformio.ini | 166 ++++++++++++++++++++++-------------------- ESP/tools/version.txt | 2 +- 2 files changed, 87 insertions(+), 81 deletions(-) diff --git a/ESP/platformio.ini b/ESP/platformio.ini index 0286ab9..753a60f 100644 --- a/ESP/platformio.ini +++ b/ESP/platformio.ini @@ -18,11 +18,14 @@ mdnsname = "openiristracker" channel = 1 ap_ssid = "EyeTrackVR" ap_password = "test" -otapassword = "12345678" -otaserverport = 3232 enableadhoc = 0 adhocchannel = 1 + +[ota] enableota = 1 +otaserverip = "" +otapassword = "12345678" +otaserverport = 3232 [ESP_GITHUB_OTA] maxfilenamelen = 64 @@ -237,28 +240,31 @@ build_flags = ${ESP_GITHUB_OTA.build_flags} !python tools/autoversioning.py !python tools/git_rev.py - -DOTA_SERVER_PORT=${wifi.OTAServerPort} + -DENABLE_ADHOC=${wifi.enableADHOC} -DADHOC_CHANNEL=${wifi.adhocChannel} -DWIFI_CHANNEL=${wifi.channel} - -DENABLE_OTA=${wifi.enableOTA} - -DDEBUG_ESP_PORT=Serial ; set the debug port - '-DMDNS_HOSTNAME=${wifi.mDNSName}' ; Set the OTA password - '-DOTA_PASSWORD=${wifi.OTAPassword}' ; Set the OTA password - '-DWIFI_SSID=${wifi.ssid}' ; Set the users wifi network name - '-DWIFI_PASSWORD=${wifi.password}' ; Set the users wifi network password - '-DWIFI_AP_SSID=${wifi.ap_ssid}' ; Set the users wifi network name + -DDEBUG_ESP_PORT=Serial ; set the debug port + '-DMDNS_HOSTNAME=${wifi.mDNSName}' ; Set the OTA password + '-DWIFI_SSID=${wifi.ssid}' ; Set the users wifi network name + '-DWIFI_PASSWORD=${wifi.password}' ; Set the users wifi network password + '-DWIFI_AP_SSID=${wifi.ap_ssid}' ; Set the users wifi network name '-DWIFI_AP_PASSWORD=${wifi.ap_password}' ; Set the users wifi network password - -O2 ; optimize for speed - -DASYNCWEBSERVER_REGEX ; enable regex in asyncwebserver + + -DENABLE_OTA=${ota.enableota} + -DOTA_SERVER_PORT=${ota.otaserverport} + '-DOTA_PASSWORD=${ota.otapassword}' ; Set the OTA password + '-DOTA_IP=${ota.otaserverip}' ; Set the OTA password + -O2 ; optimize for speed + -DASYNCWEBSERVER_REGEX ; enable regex in asyncwebserver # Comment these out if you are not using psram - -DBOARD_HAS_PSRAM ; enable psram + -DBOARD_HAS_PSRAM ; enable psram -mfix-esp32-psram-cache-issue ; fix for psram ;build_unflags = -Os ; disable optimization for size lib_ldf_mode = deep+ -upload_speed = 115200 ;115200 is used for compatability - if you are on windows and want the code to flash faster use 921600 +upload_speed = 115200 ;115200 is used for compatability - if you are on windows and want the code to flash faster use 921600 lib_deps = ;esp32-camera leftcoast/LC_baseTools@^1.5 @@ -285,10 +291,10 @@ lib_deps = build_type = ${common.build_type} extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} - -DCORE_DEBUG_LEVEL=4 ; set the debug level - -DDEBUG_MODE=1 ; Set the debug mode - ; CAMERA PINOUT DEFINITIONS - ${pinoutsAIThinker.build_flags} + -DCORE_DEBUG_LEVEL=4 ; set the debug level + -DDEBUG_MODE=1 ; Set the debug mode + ; CAMERA PINOUT DEFINITIONS + ${pinoutsAIThinker.build_flags} [env:esp32AIThinker_release] platform = ${common.platform} @@ -305,10 +311,10 @@ lib_deps = build_type = release extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} - -DDEBUG_MODE=0 ; Set the debug mode - -DCORE_DEBUG_LEVEL=1 - ; CAMERA PINOUT DEFINITIONS - ${pinoutsAIThinker.build_flags} + -DDEBUG_MODE=0 ; Set the debug mode + -DCORE_DEBUG_LEVEL=1 + ; CAMERA PINOUT DEFINITIONS + ${pinoutsAIThinker.build_flags} ; Experimental OTA Environment - do not select unless you know what you are doing [env:esp32AIThinker_OTA] @@ -316,11 +322,11 @@ platform = ${common.platform} board = esp32cam framework = ${common.framework} build_flags = ${common.build_flags} - -DDEBUG_MODE=0 ; Set the debug mode - -DCORE_DEBUG_LEVEL=1 - -DDEBUG_ESP_OTA - ; CAMERA PINOUT DEFINITIONS - ${pinoutsAIThinker.build_flags} + -DDEBUG_MODE=0 ; Set the debug mode + -DCORE_DEBUG_LEVEL=1 + -DDEBUG_ESP_OTA + ; CAMERA PINOUT DEFINITIONS + ${pinoutsAIThinker.build_flags} lib_deps = ${common.lib_deps} upload_speed = ${common.upload_speed} @@ -329,11 +335,11 @@ monitor_rts = ${common.monitor_rts} monitor_dtr = ${common.monitor_dtr} board_build.partitions = ${common.board_build.partitions} lib_ldf_mode = ${common.lib_ldf_mode} -upload_port = 192.168.1.38 +upload_port = ${ota.otaserverip} upload_protocol = espota upload_flags = - --port=3232 - --auth=12345678 + --port=${ota.otaserverport} + --auth=${ota.otapassword} build_type = release extra_scripts = ${common.extra_scripts} @@ -393,11 +399,11 @@ monitor_rts = ${common.monitor_rts} monitor_dtr = ${common.monitor_dtr} board_build.partitions = ${common.board_build.partitions} lib_ldf_mode = ${common.lib_ldf_mode} -upload_port = 192.168.1.38 +upload_port = ${ota.otaserverip} upload_protocol = espota upload_flags = - --port=3232 - --auth=12345678 + --port=${ota.otaserverport} + --auth=${ota.otapassword} build_type = release extra_scripts = ${common.extra_scripts} @@ -417,9 +423,9 @@ lib_deps = ${common.lib_deps} build_type = ${common.build_type} extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} - -DDEBUG_MODE=1 ; Set the debug mode - ; CAMERA PINOUT DEFINITIONS - ${pinoutsESPCam.build_flags} + -DDEBUG_MODE=1 ; Set the debug mode + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESPCam.build_flags} [env:esp32Cam_release] platform = ${common.platform} @@ -436,10 +442,10 @@ lib_deps = ${common.lib_deps} build_type = release extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} - -DDEBUG_MODE=0 ; Set the debug mode - -DCORE_DEBUG_LEVEL=1 - ; CAMERA PINOUT DEFINITIONS - ${pinoutsESPCam.build_flags} + -DDEBUG_MODE=0 ; Set the debug mode + -DCORE_DEBUG_LEVEL=1 + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESPCam.build_flags} ; Experimental OTA Environment - do not select unless you know what you are doing [env:esp32Cam_OTA] @@ -447,11 +453,11 @@ platform = ${common.platform} board = esp32cam framework = ${common.framework} build_flags = ${common.build_flags} - -DDEBUG_MODE=0 ; Set the debug mode - -DCORE_DEBUG_LEVEL=1 - -DDEBUG_ESP_OTA - ; CAMERA PINOUT DEFINITIONS - ${pinoutsESPCam.build_flags} + -DDEBUG_MODE=0 ; Set the debug mode + -DCORE_DEBUG_LEVEL=1 + -DDEBUG_ESP_OTA + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESPCam.build_flags} lib_deps = ${common.lib_deps} upload_speed = ${common.upload_speed} @@ -461,11 +467,11 @@ monitor_dtr = ${common.monitor_dtr} ;build_unflags = ${common.build_unflags} board_build.partitions = ${common.board_build.partitions} ; uncomment this to use the min_spiffs partition table, great for using OTA lib_ldf_mode = ${common.lib_ldf_mode} -upload_port = 192.168.1.38 +upload_port = ${ota.otaserverip} upload_protocol = espota upload_flags = - --port=3232 - --auth=12345678 + --port=${ota.otaserverport} + --auth=${ota.otapassword} build_type = release extra_scripts = ${common.extra_scripts} @@ -487,9 +493,9 @@ lib_deps = ${common.lib_deps} build_type = ${common.build_type} extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} - -DDEBUG_MODE=1 ; Set the debug mode - ; CAMERA PINOUT DEFINITIONS - ${pinoutsESP-EYE.build_flags} + -DDEBUG_MODE=1 ; Set the debug mode + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESP-EYE.build_flags} [env:esp_eye_release] platform = ${common.platform} @@ -508,10 +514,10 @@ lib_deps = ${common.lib_deps} build_type = release extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} - -DDEBUG_MODE=0 ; Set the debug mode - -DCORE_DEBUG_LEVEL=1 - ; CAMERA PINOUT DEFINITIONS - ${pinoutsESP-EYE.build_flags} + -DDEBUG_MODE=0 ; Set the debug mode + -DCORE_DEBUG_LEVEL=1 + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESP-EYE.build_flags} ; Experimental OTA Environment - do not select unless you know what you are doing [env:esp_eye_OTA] @@ -521,11 +527,11 @@ framework = ${common.framework} ;board_build.f_flash = 80000000L ;board_build.flash_mode = qio build_flags = ${common.build_flags} - -DDEBUG_MODE=0 ; Set the debug mode - -DCORE_DEBUG_LEVEL=1 - -DDEBUG_ESP_OTA - ; CAMERA PINOUT DEFINITIONS - ${pinoutsESP-EYE.build_flags} + -DDEBUG_MODE=0 ; Set the debug mode + -DCORE_DEBUG_LEVEL=1 + -DDEBUG_ESP_OTA + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESP-EYE.build_flags} lib_deps = ${common.lib_deps} upload_speed = ${common.upload_speed} monitor_speed = ${common.monitor_speed} @@ -534,11 +540,11 @@ monitor_speed = ${common.monitor_speed} ;build_unflags = ${common.build_unflags} board_build.partitions = ${common.board_build.partitions} ; uncomment this to use the min_spiffs partition table, great for using OTA lib_ldf_mode = ${common.lib_ldf_mode} -upload_port = 192.168.1.38 +upload_port = ${ota.otaserverip} upload_protocol = espota upload_flags = - --port=3232 - --auth=12345678 + --port=${ota.otaserverport} + --auth=${ota.otapassword} build_type = release extra_scripts = ${common.extra_scripts} @@ -558,10 +564,10 @@ lib_deps = build_type = ${common.build_type} extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} - -DCORE_DEBUG_LEVEL=4 ; set the debug level - -DDEBUG_MODE=1 ; Set the debug mode - ; CAMERA PINOUT DEFINITIONS - ${pinoutsESPWROVER.build_flags} + -DCORE_DEBUG_LEVEL=4 ; set the debug level + -DDEBUG_MODE=1 ; Set the debug mode + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESPWROVER.build_flags} [env:wrover_release] platform = ${common.platform} board = esp-wrover-kit @@ -578,10 +584,10 @@ lib_deps = build_type = ${common.build_type} extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} - -DDEBUG_MODE=0 ; Set the debug mode - -DCORE_DEBUG_LEVEL=1 - ; CAMERA PINOUT DEFINITIONS - ${pinoutsESPWROVER.build_flags} + -DDEBUG_MODE=0 ; Set the debug mode + -DCORE_DEBUG_LEVEL=1 + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESPWROVER.build_flags} [env:wrover_OTA] platform = ${common.platform} @@ -596,16 +602,16 @@ lib_ldf_mode = ${common.lib_ldf_mode} upload_speed = ${common.upload_speed} lib_deps = ${common.lib_deps} -build_type = release extra_scripts = ${common.extra_scripts} build_flags = ${common.build_flags} - -DDEBUG_MODE=0 ; Set the debug mode - -DCORE_DEBUG_LEVEL=1 - -DDEBUG_ESP_OTA - ; CAMERA PINOUT DEFINITIONS - ${pinoutsESPWROVER.build_flags} -upload_port = 192.168.1.38 + -DDEBUG_MODE=0 ; Set the debug mode + -DCORE_DEBUG_LEVEL=1 + -DDEBUG_ESP_OTA + ; CAMERA PINOUT DEFINITIONS + ${pinoutsESPWROVER.build_flags} +upload_port = ${ota.otaserverip} upload_protocol = espota upload_flags = - --port=3232 - --auth=12345678 + --port=${ota.otaserverport} + --auth=${ota.otapassword} +build_type = release diff --git a/ESP/tools/version.txt b/ESP/tools/version.txt index 9a8b562..dffa71b 100644 --- a/ESP/tools/version.txt +++ b/ESP/tools/version.txt @@ -1 +1 @@ -v1.10.10 \ No newline at end of file +v2.1.10 \ No newline at end of file