diff --git a/.github/workflows/pio-build.yaml b/.github/workflows/pio-build.yaml index 3115156..f4cc7ef 100644 --- a/.github/workflows/pio-build.yaml +++ b/.github/workflows/pio-build.yaml @@ -36,9 +36,7 @@ jobs: git config --global advice.detachedHead false - name: Run PlatformIO - #run: pio run -e gravity-release -e gravity-perf -e gravity-debug - run: pio run -e gravity-release -e gravity-perf - #run: pio run -e gravity-release + run: pio run -e gravity-release -e gravity-perf -e gravity32-release - uses: EndBug/add-and-commit@v7 # You can change this to use a specific version. https://github.com/marketplace/actions/add-commit with: diff --git a/html/config.htm b/html/config.htm index 0371175..aa94f50 100644 --- a/html/config.htm +++ b/html/config.htm @@ -374,10 +374,10 @@ -
+
- @@ -390,7 +390,7 @@
-
+
@@ -555,8 +555,7 @@ function checkHeader(input) { console.log( cfg ); if(cfg["platform"]=="esp32") { - $('#esp32-tilt').removeClass('d-none'); - $('#esp32-ota').addClass('d-none'); + $('#ble').prop('disabled', false); $("#ble").val(cfg["ble"]); } diff --git a/html/config.min.htm b/html/config.min.htm index acbb4bc..6eddb1b 100644 --- a/html/config.min.htm +++ b/html/config.min.htm @@ -1 +1 @@ -Beer Gravity Monitor

Temperature Format:





Gravity Format:


(C) Copyright 2021-22 Magnus Persson
\ No newline at end of file +Beer Gravity Monitor

Temperature Format:





Gravity Format:


(C) Copyright 2021-22 Magnus Persson
\ No newline at end of file diff --git a/part32.csv b/part32.csv new file mode 100644 index 0000000..7bfc12a --- /dev/null +++ b/part32.csv @@ -0,0 +1,13 @@ +# Name,Type,SubType,Offset,Size,Flags +nvs,data,nvs,0x9000,0x5000 +otadata,data,ota,0xe000,0x2000 +app0,app,ota_0,0x10000,0x1c0000 +app1,app,ota_1,0x1d0000,0x1c000 +spiffs,data,spiffs,0x1ec000,0x70000 + +# Name, Type, SubType, Offset, Size, Flags +#nvs, data, nvs, 0x9000, 0x5000, +#otadata, data, ota, 0xe000, 0x2000, +#app0, app, ota_0, 0x10000, 0x140000, # 1310720 +#app1, app, ota_1, 0x150000,0x140000, # 1310720 +#spiffs, data, spiffs, 0x290000,0x170000, # 1507328 \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index 12cade9..aa3d090 100644 --- a/platformio.ini +++ b/platformio.ini @@ -20,9 +20,8 @@ framework = arduino board = d1_mini build_unflags = build_flags = - -Wl,-Map,output.map -D BAUD=${common_env_data.monitor_speed} - -D ACTIVATE_OTA + -D ACTIVATE_OTA #-D DEBUG_ESP_HTTP_CLIENT #-D DEBUG_ESP_HTTP_SERVER #-D DEBUG_ESP_PORT=Serial @@ -34,7 +33,7 @@ build_flags = -D EMBED_HTML # If this is not used the html files needs to be on the file system (can be uploaded) -D USER_SSID=\""\"" # =\""myssid\"" -D USER_SSID_PWD=\""\"" # =\""mypwd\"" - -D CFG_APPVER="\"0.8.0\"" + -D CFG_APPVER="\"0.8.10\"" lib_deps = # Switched to forks for better version control. # Using local copy of these libraries #https://github.com/jrowberg/i2cdevlib.git# @@ -61,6 +60,7 @@ extra_scripts = build_unflags = ${common_env_data.build_unflags} build_flags = + -Wl,-Map,output.map ${common_env_data.build_flags} #-D PIO_FRAMEWORK_ARDUINO_ENABLE_EXCEPTIONS #-D SKIP_SLEEPMODE @@ -123,12 +123,15 @@ board = ${common_env_data.board} build_type = release board_build.filesystem = littlefs -[env:gravity32-perf] +[env:gravity32-release] framework = arduino -# platformio only supports v1.0.6 of the esp32 libs. -platform = espressif32 +platform = espressif32 # platformio only supports v1.0.6 of the esp32 libs. # tasmota port of v2.0.2 #platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.1/platform-tasmota-espressif32-2.0.2.1.zip +#platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2idf/platform-espressif32-2.0.3.zip +#platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.3/platform-espressif32-2.0.2.3.zip +#platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2.2/platform-tasmota-espressif32-2.0.2.zip +#platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.2idf/platform-espressif32-2.0.2.zip upload_speed = ${common_env_data.upload_speed} monitor_speed = ${common_env_data.monitor_speed} extra_scripts = @@ -138,14 +141,27 @@ extra_scripts = build_unflags = ${common_env_data.build_unflags} build_flags = - ${common_env_data.build_flags} + -Wl,-Map,output.map + ${common_env_data.build_flags} -D COLLECT_PERFDATA -D LOG_LEVEL=5 + -D CFG_DISABLE_LOGGING # Turn off verbose/notice logging to reduce size and dont overload uart. + -D GYRO_DISABLE_LOGGING + -D CALC_DISABLE_LOGGING + -D HELPER_DISABLE_LOGGING + -D PUSH_DISABLE_LOGGING + -D TSEN_DISABLE_LOGGING + -D WIFI_DISABLE_LOGGING + -D WEB_DISABLE_LOGGING + -D MAIN_DISABLE_LOGGING lib_deps = ${common_env_data.lib_deps} -board = nodemcu-32s + https://github.com/lorol/LITTLEFS#1.0.6 + https://github.com/h2zero/NimBLE-Arduino#1.3.7 +board = featheresp32 build_type = release +board_build.partitions = part32.csv # No room for OTA using this partition setup, use this for dev/test for now. #build_type = debug -#board_build.filesystem = littlefs -board_build.filesystem = spiffs +board_build.filesystem = littlefs +#board_build.filesystem = spiffs monitor_filters = esp32_exception_decoder \ No newline at end of file diff --git a/script/copy_firmware.py b/script/copy_firmware.py index 2dadc13..02661ac 100644 --- a/script/copy_firmware.py +++ b/script/copy_firmware.py @@ -18,8 +18,8 @@ def after_build(source, target, env): target = dir + "/bin/firmware.bin" if name == "gravity-perf" : target = dir + "/bin/firmware-perf.bin" - if name == "gravity32-perf" : - target = dir + "/bin/firmware32-perf.bin" + if name == "gravity32-release" : + target = dir + "/bin/firmware32.bin" print( "Copy file : " + source + " -> " + target ) shutil.copyfile( source, target ) diff --git a/src/ble.hpp b/src/ble.hpp index 599f118..ade8cf9 100644 --- a/src/ble.hpp +++ b/src/ble.hpp @@ -26,10 +26,10 @@ SOFTWARE. #if defined (ESP32) +#include +#include #include #include -#include "NimBLEDevice.h" -#include "NimBLEBeacon.h" class BleSender { private: diff --git a/src/wifi.cpp b/src/wifi.cpp index 34368ee..a1644c7 100644 --- a/src/wifi.cpp +++ b/src/wifi.cpp @@ -240,7 +240,11 @@ bool WifiConnection::updateFirmware() { WiFiClientSecure wifiSecure; HTTPUpdateResult ret; String serverPath = myConfig.getOtaURL(); +#if defined (ESP8266) serverPath += "firmware.bin"; +#else // defined (ESP32) + serverPath += "firmware32.bin"; +#endif if (serverPath.startsWith("https://")) { wifiSecure.setInsecure();