From 3b6fbd0286e7d71f55fe644fce2258077453d483 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 9 Aug 2022 08:52:51 -0400 Subject: [PATCH 1/6] Strip out setCountry as it is causing crashes --- platformio.ini | 4 ++-- src/wifi_setup.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index 09db2c6..0074c51 100644 --- a/platformio.ini +++ b/platformio.ini @@ -152,7 +152,7 @@ build_flags = ;-D CONFIG_BT_NIMBLE_MEM_ALLOC_MODE_EXTERNAL=1 ; Use PSRAM for NimBLE lib_deps = ${common.lib_deps} - bodmer/TFT_eSPI @ 2.4.11 ; https://github.com/Bodmer/TFT_eSPI.git + bodmer/TFT_eSPI @ 2.4.72 ; https://github.com/Bodmer/TFT_eSPI.git build_type = ${common.build_type} @@ -195,7 +195,7 @@ build_flags = -DLOAD_GFXFF=1 lib_deps = ${common.lib_deps} - bodmer/TFT_eSPI @ 2.4.11 ; https://github.com/Bodmer/TFT_eSPI.git + bodmer/TFT_eSPI @ 2.4.72 ; https://github.com/Bodmer/TFT_eSPI.git build_type = ${common.build_type} [env:m5stickc] ; M5Stack M5Stick-C diff --git a/src/wifi_setup.cpp b/src/wifi_setup.cpp index dd50e9c..8a4ba50 100644 --- a/src/wifi_setup.cpp +++ b/src/wifi_setup.cpp @@ -73,7 +73,8 @@ void initWiFi() { // wm.setWiFiAutoReconnect(true); // Enable auto reconnect (should remove need for reconnectWiFi()) wm.setWiFiAPChannel(1); // Pick the most common channel, safe for all countries wm.setCleanConnect(true); // Always disconnect before connecting - wm.setCountry("US"); // US country code is most restrictive, use for all countries + // Commenting out setCountry until https://github.com/tzapu/WiFiManager/issues/1309 is fixed + //wm.setCountry("US"); // US country code is most restrictive, use for all countries wm.setCustomHeadElement(""); From 37cd0cde3274a84c1b59d578699fc343e9ae0a21 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 9 Aug 2022 10:17:28 -0400 Subject: [PATCH 2/6] Disable auto-release for now --- .github/{workflows => workflows_disabled}/build.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{workflows => workflows_disabled}/build.yml (100%) diff --git a/.github/workflows/build.yml b/.github/workflows_disabled/build.yml similarity index 100% rename from .github/workflows/build.yml rename to .github/workflows_disabled/build.yml From 2529d8b4a9ab479e65b8a1b41a7e54a558138981 Mon Sep 17 00:00:00 2001 From: John Date: Tue, 9 Aug 2022 10:17:47 -0400 Subject: [PATCH 3/6] Clean up --- src/sendData.cpp | 80 ------------------------------------------------ 1 file changed, 80 deletions(-) diff --git a/src/sendData.cpp b/src/sendData.cpp index 02bb7e4..b81aac0 100644 --- a/src/sendData.cpp +++ b/src/sendData.cpp @@ -341,86 +341,6 @@ bool dataSendHandler::http_send_json(const char * url, const char * payload) return true; } -// bool dataSendHandler::send_to_taplistio() -// { -// StaticJsonDocument<192> j; -// char payload_string[192]; -// int httpResponseCode; -// bool result = true; - -// // See if it's our time to send. -// if (!send_taplistio) { -// return false; -// } else if (send_lock) { -// return false; -// } - -// // Attempt to send. -// send_taplistio = false; -// send_lock = true; - -// if (WiFiClass::status() != WL_CONNECTED) { -// Log.verbose(F("taplist.io: Wifi not connected, skipping send.\r\n")); -// taplistioTicker.once(config.taplistioPushEvery, [](){send_taplistio = true;}); -// send_lock = false; -// return false; -// } - -// char userAgent[128]; -// snprintf(userAgent, sizeof(userAgent), -// "tiltbridge/%s (branch %s; build %s)", -// version(), -// branch(), -// build() -// ); - -// for (uint8_t i = 0; i < TILT_COLORS; i++) { - -// if (!tilt_scanner.tilt(i)->is_loaded()) { -// continue; -// } - -// j["Color"] = tilt_color_names[i]; -// j["Temp"] = tilt_scanner.tilt(i)->converted_temp(false); -// j["SG"] = tilt_scanner.tilt(i)->converted_gravity(false); -// j["temperature_unit"] = "F"; -// j["gravity_unit"] = "G"; - -// serializeJson(j, payload_string); - -// http.setFollowRedirects(HTTPC_FORCE_FOLLOW_REDIRECTS); -// http.setConnectTimeout(6000); -// http.setReuse(false); -// secureClient.setInsecure(); - -// Log.verbose(F("taplist.io: Sending %s Tilt to %s\r\n"), tilt_color_names[i], config.taplistioURL); - -// if (!http.begin(secureClient, config.taplistioURL)) { -// Log.error(F("taplist.io: Unable to create secure connection to %s\r\n"), config.taplistioURL); -// result = false; -// break; -// } - -// http.addHeader(F("Content-Type"), F("application/json")); -// http.setUserAgent(userAgent); -// httpResponseCode = http.POST(payload_string); - -// if (httpResponseCode < HTTP_CODE_OK || httpResponseCode > HTTP_CODE_NO_CONTENT) { -// Log.error(F("taplist.io: send %s Tilt failed (%d): %s. Response:\r\n%s\r\n"), -// tilt_color_names[i], -// httpResponseCode, -// http.errorToString(httpResponseCode).c_str(), -// http.getString().c_str()); -// result = false; -// } else { -// Log.verbose(F("taplist.io: %s Tilt: success!\r\n"), tilt_color_names[i]); -// } -// } - -// taplistioTicker.once(config.taplistioPushEvery, [](){send_taplistio = true;}); -// send_lock = false; -// return result; -// } bool dataSendHandler::send_to_google() { From 99d2c6d2bdc2b9918f2b4c44f7b878a7cacda52c Mon Sep 17 00:00:00 2001 From: John Date: Tue, 9 Aug 2022 10:19:37 -0400 Subject: [PATCH 4/6] Incorporate setCountry fix for WiFiManager --- platformio.ini | 8 ++++---- src/wifi_setup.cpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/platformio.ini b/platformio.ini index 0074c51..ed73280 100644 --- a/platformio.ini +++ b/platformio.ini @@ -66,12 +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/tzapu/WiFiManager.git ;#feature_asyncwebserver + https://github.com/thorrak/WiFiManager.git#setcountry-patch ; Need this until tablatronix merges https://github.com/tzapu/WiFiManager/pull/1470 + ; 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/43 - ; https://github.com/lbussy/LCBUrl.git + ; 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 diff --git a/src/wifi_setup.cpp b/src/wifi_setup.cpp index 8a4ba50..2f135c3 100644 --- a/src/wifi_setup.cpp +++ b/src/wifi_setup.cpp @@ -74,7 +74,7 @@ void initWiFi() { wm.setWiFiAPChannel(1); // Pick the most common channel, safe for all countries wm.setCleanConnect(true); // Always disconnect before connecting // Commenting out setCountry until https://github.com/tzapu/WiFiManager/issues/1309 is fixed - //wm.setCountry("US"); // US country code is most restrictive, use for all countries + wm.setCountry("US"); // US country code is most restrictive, use for all countries wm.setCustomHeadElement(""); From 6d19cf0ab07f0fc52329e1bf34e8a6a3301aad32 Mon Sep 17 00:00:00 2001 From: John Date: Wed, 10 Aug 2022 23:02:16 -0400 Subject: [PATCH 5/6] Remove use of deprecated interface --- src/sendData.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/sendData.cpp b/src/sendData.cpp index b81aac0..89fd361 100644 --- a/src/sendData.cpp +++ b/src/sendData.cpp @@ -496,6 +496,21 @@ void dataSendHandler::connect_mqtt() } } +String lcburl_getAfterPath(LCBUrl url) // Get anything after the path +{ + String afterpath = ""; + + if (url.getQuery().length() > 0) { + afterpath = "?" + url.getQuery(); + } + + if (url.getFragment().length() > 0) { + afterpath = afterpath + "#" + url.getFragment(); + } + + return afterpath; +} + bool dataSendHandler::send_to_url(const char *url, const char *apiKey, const char *dataToSend, const char *contentType, bool checkBody, const char* bodyCheck) { // This handles the generic act of sending data to an endpoint @@ -541,11 +556,11 @@ bool dataSendHandler::send_to_url(const char *url, const char *apiKey, const cha Log.verbose(F("Connected to: %s.\r\n"), lcburl.getHost().c_str()); // Open POST connection - if (lcburl.getAfterPath().length() > 0) + if (lcburl_getAfterPath(lcburl).length() > 0) { Log.verbose(F("POST /%s%s HTTP/1.1\r\n"), lcburl.getPath().c_str(), - lcburl.getAfterPath().c_str()); + lcburl_getAfterPath(lcburl).c_str()); } else { @@ -553,9 +568,9 @@ bool dataSendHandler::send_to_url(const char *url, const char *apiKey, const cha } client.print(F("POST /")); client.print(lcburl.getPath().c_str()); - if (lcburl.getAfterPath().length() > 0) + if (lcburl_getAfterPath(lcburl).length() > 0) { - client.print(lcburl.getAfterPath().c_str()); + client.print(lcburl_getAfterPath(lcburl).c_str()); } client.println(F(" HTTP/1.1")); From 02025322d618b98b9b7aab77f5f6d96b80070c6a Mon Sep 17 00:00:00 2001 From: John Date: Wed, 10 Aug 2022 23:02:33 -0400 Subject: [PATCH 6/6] Update version --- docs/source/changelog.rst | 14 ++++++++++++++ platformio.ini | 10 ++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index dddd7c9..10134d8 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -2,6 +2,20 @@ Changelog ######### + +v1.1.3 - Aug 18, 2022 - Fix WiFi Manager +---------------------------------------- + +- Fix WiFiManager (Resolves "white screen" loop on D32 builds) +- Update/lock library versions + + +v1.1.2 - Jul 26, 2022 - Fix TFT Firmware +---------------------------------------- + +- Change to using 4MB partition scheme for TFT firmware + + v1.1.1 - Feb 18, 2022 - TiltBridge Cloud Support ------------------------------------------------ diff --git a/platformio.ini b/platformio.ini index ed73280..eb30781 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.2 ; Increment versions shown in about.htm page (from version.cpp) + -D PIO_SRC_TAG=1.1.3 ; 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 @@ -66,12 +66,10 @@ 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/thorrak/WiFiManager.git#setcountry-patch ; Need this until tablatronix merges https://github.com/tzapu/WiFiManager/pull/1470 - ; https://github.com/tzapu/WiFiManager.git ;#feature_asyncwebserver + https://github.com/tzapu/WiFiManager.git#e0c5fb7daf4c44f2753fdc7325b9d47ad154ed30 ;#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/43 - https://github.com/lbussy/LCBUrl.git + lbussy/LCBUrl @ ^1.1.7 ;https://github.com/DJMarlow/Parse-SDK-Arduino.git https://github.com/lbussy/Parse-SDK-Arduino.git#fix_warnings @@ -104,7 +102,7 @@ build_flags = -DDISABLE_OTA_UPDATES lib_deps = ${common.lib_deps} - https://github.com/ThingPulse/esp8266-oled-ssd1306.git + https://github.com/ThingPulse/esp8266-oled-ssd1306.git#4.3.0 build_type = ${common.build_type}