Skip to content

Commit

Permalink
Merge pull request #219 from thorrak/devel
Browse files Browse the repository at this point in the history
v1.1.3 Update
  • Loading branch information
thorrak committed Aug 11, 2022
2 parents dac8067 + 0202532 commit 0152d60
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 92 deletions.
File renamed without changes.
14 changes: 14 additions & 0 deletions docs/source/changelog.rst
Expand Up @@ -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
------------------------------------------------

Expand Down
14 changes: 6 additions & 8 deletions platformio.ini
Expand Up @@ -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
Expand Down Expand Up @@ -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/lbussy/AsyncWiFiManager.git
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

Expand Down Expand Up @@ -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}


Expand Down Expand Up @@ -152,7 +150,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}


Expand Down Expand Up @@ -195,7 +193,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
Expand Down
103 changes: 19 additions & 84 deletions src/sendData.cpp
Expand Up @@ -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()
{
Expand Down Expand Up @@ -576,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
Expand Down Expand Up @@ -621,21 +556,21 @@ 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
{
Log.verbose(F("POST /%s HTTP/1.1\r\n"), lcburl.getPath().c_str());
}
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"));

Expand Down
1 change: 1 addition & 0 deletions src/wifi_setup.cpp
Expand Up @@ -73,6 +73,7 @@ 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
// 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("<style type=\"text/css\">body {background-image: url(\"data:image/svg+xml;utf8,%3Csvg%20id%3D%22Layer_1%22%20data-name%3D%22Layer%201%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20231.62%20169.18%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20width%3D%2281.067%22%20height%3D%2259.213%22%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill%3A%23f7f8fa%7D%3C%2Fstyle%3E%3C%2Fdefs%3E%3Cg%20id%3D%22tb_logo%22%3E%3Cg%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M31.77%2C13.6A29.88%2C29.88%2C0%2C0%2C1%2C74%2C13.6a2.42%2C2.42%2C0%2C0%2C0%2C3.42-3.43%2C34.73%2C34.73%2C0%2C0%2C0-49.11%2C0%2C2.42%2C2.42%2C0%2C0%2C0%2C3.42%2C3.43Z%22%2F%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M67.93%2C22.13A2.42%2C2.42%2C0%2C0%2C0%2C69.64%2C18a23.65%2C23.65%2C0%2C0%2C0-33.47%2C0%2C2.42%2C2.42%2C0%2C0%2C0%2C3.42%2C3.42%2C18.84%2C18.84%2C0%2C0%2C1%2C26.63%2C0A2.42%2C2.42%2C0%2C0%2C0%2C67.93%2C22.13Z%22%2F%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M43.91%2C25.73a2.42%2C2.42%2C0%2C0%2C0%2C3.42%2C3.43%2C7.88%2C7.88%2C0%2C0%2C1%2C11.15%2C0%2C2.43%2C2.43%2C0%2C0%2C0%2C3.43-3.43A12.75%2C12.75%2C0%2C0%2C0%2C43.91%2C25.73Z%22%2F%3E%3C%2Fg%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M103.39%2C61.76H91.7C80%2C61.76%2C70.34%2C57.24%2C63%2C48.32a45.48%2C45.48%2C0%2C0%2C1-7.38-12.7%2C3.85%2C3.85%2C0%2C0%2C1-5.36%2C0A45.31%2C45.31%2C0%2C0%2C1%2C43%2C48.19%2C35.71%2C35.71%2C0%2C0%2C1%2C14.12%2C61.76H2.42a2.42%2C2.42%2C0%2C0%2C0%2C0%2C4.84h101a2.42%2C2.42%2C0%2C0%2C0%2C0-4.84Zm-52.9%2C0H34.08A42.36%2C42.36%2C0%2C0%2C0%2C46.7%2C51.26%2C52%2C52%2C0%2C0%2C0%2C50.49%2C46Zm4.84%2C0V46a50.35%2C50.35%2C0%2C0%2C0%2C3.78%2C5.3%2C42.49%2C42.49%2C0%2C0%2C0%2C12.62%2C10.5Z%22%2F%3E%3Ccircle%20class%3D%22cls-1%22%20cx%3D%2252.91%22%20cy%3D%2232.86%22%20r%3D%222.81%22%2F%3E%3Cg%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M22.39%2C77.09A2.44%2C2.44%2C0%2C0%2C1%2C20%2C74.65V64.52a2.45%2C2.45%2C0%2C0%2C1%2C4.89%2C0V74.65A2.45%2C2.45%2C0%2C0%2C1%2C22.39%2C77.09Z%22%2F%3E%3Cpath%20class%3D%22cls-1%22%20d%3D%22M83.42%2C77.09A2.45%2C2.45%2C0%2C0%2C1%2C81%2C74.65V64.52a2.45%2C2.45%2C0%2C0%2C1%2C4.89%2C0V74.65A2.45%2C2.45%2C0%2C0%2C1%2C83.42%2C77.09Z%22%2F%3E%3C%2Fg%3E%3C%2Fg%3E%3Cuse%20xlink%3Ahref%3D%22%23tb_logo%22%20x%3D%220%22%20y%3D%220%22%2F%3E%3Cuse%20xlink%3Ahref%3D%22%23tb_logo%22%20x%3D%22115.81%22%20y%3D%220%22%2F%3E%3Cuse%20xlink%3Ahref%3D%22%23tb_logo%22%20x%3D%22-57.905%22%20y%3D%2284.59%22%2F%3E%3Cuse%20xlink%3Ahref%3D%22%23tb_logo%22%20x%3D%2257.905%22%20y%3D%2284.59%22%2F%3E%3Cuse%20xlink%3Ahref%3D%22%23tb_logo%22%20x%3D%22173.715%22%20y%3D%2284.59%22%2F%3E%3C%2Fsvg%3E\")}</style>");
Expand Down

0 comments on commit 0152d60

Please sign in to comment.