From 491c5318356a3b2e8eb1193395916141ece883d3 Mon Sep 17 00:00:00 2001 From: John Date: Sun, 3 Jul 2022 23:28:34 -0400 Subject: [PATCH 1/4] Correct length check --- src/tilt/tiltScanner.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tilt/tiltScanner.cpp b/src/tilt/tiltScanner.cpp index b7fd078..47a9c26 100644 --- a/src/tilt/tiltScanner.cpp +++ b/src/tilt/tiltScanner.cpp @@ -15,9 +15,7 @@ tiltScanner tilt_scanner; void MyAdvertisedDeviceCallbacks::onResult(NimBLEAdvertisedDevice *advertisedDevice) { - // uint8_t color = tilt_scanner.load_tilt_from_advert_hex(advertisedDevice.getManufacturerData()); - - if (advertisedDevice->getManufacturerData().length() > 4) + if (advertisedDevice->getManufacturerData().length() >= 24) { if (advertisedDevice->getManufacturerData()[0] == 0x4c && advertisedDevice->getManufacturerData()[1] == 0x00 && advertisedDevice->getManufacturerData()[2] == 0x02 && advertisedDevice->getManufacturerData()[3] == 0x15) From b208e94b0dbe8952c83538d40ead451df66c5456 Mon Sep 17 00:00:00 2001 From: John Date: Sun, 3 Jul 2022 23:28:50 -0400 Subject: [PATCH 2/4] Add Arduino 2.0 compatiblity --- platformio.ini | 16 +++++++++------- src/wifi_setup.cpp | 10 +++++----- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/platformio.ini b/platformio.ini index 4a019bb..b0838ad 100644 --- a/platformio.ini +++ b/platformio.ini @@ -16,7 +16,7 @@ [common] platform = espressif32 -platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.6 +; platform_packages = framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#1.0.6 framework = arduino ; As the framework has grown, min_spiffs no longer has enough space. We're now ; requiring 16MB of flash space for most builds (which comes standard with the @@ -66,10 +66,12 @@ lib_deps = https://github.com/thorrak/Arduino-Log.git ; // Need this until ArduinoLog merges https://github.com/thijse/Arduino-Log/pull/23 https://github.com/lbussy/esptelnet.git https://github.com/me-no-dev/ESPAsyncWebServer.git - https://github.com/lbussy/AsyncWiFiManager.git + ; https://github.com/lbussy/AsyncWiFiManager.git + https://github.com/tzapu/WiFiManager.git ;#feature_asyncwebserver h2zero/NimBLE-Arduino @ 1.3.4 ; https://github.com/h2zero/NimBLE-Arduino.git 256dpi/MQTT @ 2.4.8 - https://github.com/lbussy/LCBUrl.git + https://github.com/thorrak/LCBUrl.git ; // Need this until Lee merges https://github.com/lbussy/LCBUrl/pull/31 + ; https://github.com/lbussy/LCBUrl.git ;https://github.com/DJMarlow/Parse-SDK-Arduino.git https://github.com/lbussy/Parse-SDK-Arduino.git#fix_warnings @@ -83,7 +85,7 @@ build_type = release ; debug [env:lcd_ssd1306] ; Small OLED Board board = lolin_d32 platform = ${common.platform} -platform_packages = ${common.platform_packages} +; platform_packages = ${common.platform_packages} framework = ${common.framework} ; For the "OLED" variant, we can't guarantee we have more than 4MB of flash. Use ; huge_app to get us the space - but at the cost of being able to update OTA. @@ -109,7 +111,7 @@ build_type = ${common.build_type} [env:d32_pro_tft] ; Lolin ESP32 + ILI TFT board = lolin_d32_pro platform = ${common.platform} -platform_packages = ${common.platform_packages} +; platform_packages = ${common.platform_packages} framework = ${common.framework} board_build.partitions = large_spiffs_16MB.csv upload_speed = ${common.upload_speed} @@ -157,7 +159,7 @@ build_type = ${common.build_type} ; https://github.com/Bodmer/TFT_eSPI board = esp32dev platform = ${common.platform} -platform_packages = ${common.platform_packages} +; platform_packages = ${common.platform_packages} framework = ${common.framework} ; The T-Display has 4MB of flash. Use huge_app to get us the space - but ; at the cost of being able to update OTA. @@ -196,7 +198,7 @@ build_type = ${common.build_type} board = m5stick-c board_build.f_cpu = 240000000L platform = ${common.platform} -platform_packages = ${common.platform_packages} +; platform_packages = ${common.platform_packages} framework = ${common.framework} board_build.partitions = ${common.board_build.partitions} upload_speed = 1500000 diff --git a/src/wifi_setup.cpp b/src/wifi_setup.cpp index cdde786..dd50e9c 100644 --- a/src/wifi_setup.cpp +++ b/src/wifi_setup.cpp @@ -3,10 +3,10 @@ #include #include #include -#include +#include #include "bridge_lcd.h" #include "jsonconfig.h" -#include "http_server.h" // Make sure this include is after AsyncWiFiManager +#include "http_server.h" // Make sure this include is after WiFiManager #include "serialhandler.h" #include "wifi_setup.h" @@ -19,7 +19,7 @@ void saveParamsCallback() { shouldSaveConfig = true; } -void apCallback(AsyncWiFiManager *myWiFiManager) { +void apCallback(WiFiManager *myWiFiManager) { // Callback to display the WiFi LCD notification and set bandwidth Log.verbose(F("Entered config mode: SSID: %s, IP: %s\r\n"), myWiFiManager->getConfigPortalSSID().c_str(), WiFi.softAPIP().toString().c_str()); lcd.display_wifi_connect_screen(myWiFiManager->getConfigPortalSSID().c_str(), WIFI_SETUP_AP_PASS); @@ -58,7 +58,7 @@ void initWiFi() { WiFi.mode(WIFI_STA); // Explicitly set mode, ESP defaults to STA+AP - AsyncWiFiManager wm; + WiFiManager wm; #if ARDUINO_LOG_LEVEL == 6 wm.setDebugOutput(true); // Use debug if we are at max log level #else @@ -78,7 +78,7 @@ void initWiFi() { wm.setCustomHeadElement(""); // config.mdnsID is the default name that will appear on the form - AsyncWiFiManagerParameter custom_mdns_name("mdns", "Device (mDNS) Name", config.mdnsID, 20); + WiFiManagerParameter custom_mdns_name("mdns", "Device (mDNS) Name", config.mdnsID, 20); wm.addParameter(&custom_mdns_name); if (!wm.autoConnect(WIFI_SETUP_AP_NAME, WIFI_SETUP_AP_PASS)) { From 268c6942158d6641798e0783ac9b435c931a6752 Mon Sep 17 00:00:00 2001 From: John Date: Sun, 24 Jul 2022 15:44:16 -0400 Subject: [PATCH 3/4] Convert TFT to 4MB partition size --- 4mb_no_ota.csv | 5 +++++ platformio.ini | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 4mb_no_ota.csv diff --git a/4mb_no_ota.csv b/4mb_no_ota.csv new file mode 100644 index 0000000..e65048e --- /dev/null +++ b/4mb_no_ota.csv @@ -0,0 +1,5 @@ +# Name, Type, SubType, Offset, Size, Flags +nvs, data, nvs, 0x9000, 0x5000, +otadata, data, ota, 0xe000, 0x2000, +app0, app, ota_0, 0x10000, 0x320000, +spiffs, data, spiffs, 0x330000,0xD0000, \ No newline at end of file diff --git a/platformio.ini b/platformio.ini index b0838ad..09db2c6 100644 --- a/platformio.ini +++ b/platformio.ini @@ -35,7 +35,7 @@ monitor_rts = 1 build_flags = ; Do not use spaces around the "=" here, will give you a builder not found error !python tools/git_rev.py ; Pick up git information for version (disabled), branch, and commit (in version.cpp) - -D PIO_SRC_TAG=1.1.1 ; Increment versions shown in about.htm page (from version.cpp) + -D PIO_SRC_TAG=1.1.2 ; Increment versions shown in about.htm page (from version.cpp) ; Async TCP Settings: -D CONFIG_ASYNC_TCP_RUNNING_CORE=1 ; per: https://github.com/me-no-dev/ESPAsyncWebServer/issues/731#issuecomment-628163515 -D CONFIG_ASYNC_TCP_USE_WDT=1 @@ -70,7 +70,7 @@ lib_deps = https://github.com/tzapu/WiFiManager.git ;#feature_asyncwebserver h2zero/NimBLE-Arduino @ 1.3.4 ; https://github.com/h2zero/NimBLE-Arduino.git 256dpi/MQTT @ 2.4.8 - https://github.com/thorrak/LCBUrl.git ; // Need this until Lee merges https://github.com/lbussy/LCBUrl/pull/31 + https://github.com/thorrak/LCBUrl.git ; // Need this until Lee merges https://github.com/lbussy/LCBUrl/pull/43 ; https://github.com/lbussy/LCBUrl.git ;https://github.com/DJMarlow/Parse-SDK-Arduino.git https://github.com/lbussy/Parse-SDK-Arduino.git#fix_warnings @@ -113,7 +113,11 @@ board = lolin_d32_pro platform = ${common.platform} ; platform_packages = ${common.platform_packages} framework = ${common.framework} -board_build.partitions = large_spiffs_16MB.csv +; There's issues with the way that BrewFlasher flashes the bootloader with the latest esptool, meaning we can't use +; the 16MB boards unless we define a new devicefamily. I really don't want to do that, so we'll go back to 4MB. +; board_build.partitions = large_spiffs_16MB.csv +board_build.partitions = 4mb_no_ota.csv +; board_build.partitions = ${common.board_build.partitions} upload_speed = ${common.upload_speed} monitor_speed = ${common.monitor_speed} monitor_filters = ${common.monitor_filters} From d2ee5ad2bb9b4302156b3fcbd289eb2410eff2f2 Mon Sep 17 00:00:00 2001 From: John Date: Mon, 25 Jul 2022 20:28:08 -0400 Subject: [PATCH 4/4] Disable devel build --- .github/{workflows => workflows_disabled}/build-devel.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows => workflows_disabled}/build-devel.yml (100%) diff --git a/.github/workflows/build-devel.yml b/.github/workflows_disabled/build-devel.yml similarity index 100% rename from .github/workflows/build-devel.yml rename to .github/workflows_disabled/build-devel.yml