diff --git a/README.md b/README.md index 4dde0f3..ed5b586 100644 --- a/README.md +++ b/README.md @@ -39,8 +39,8 @@ Double Wide LED version: https://www.thingiverse.com/thing:2989552 ## Upgrading from version 2.5 or Higher Version 2.5 introduced the ability to upgrade pre-compiled firmware from a binary file. In version 2.6 and on you should find binary files that can be uploaded to your marque scrolling clock via the web interface. From the main menu in the web interface select "Firmware Update" and follow the prompts. -* **marquee.ino.d1_mini_2.16.bin** - compiled for Wemos D1 Mini and standard 4x1 LED (default) -* **marquee.ino.d1_mini_wide_2.16.bin** - compiled for Wemos D1 Mini and double wide 8x1 LED display +* **marquee.ino.d1_mini_2.18.bin** - compiled for Wemos D1 Mini and standard 4x1 LED (default) +* **marquee.ino.d1_mini_wide_2.18.bin** - compiled for Wemos D1 Mini and double wide 8x1 LED display ## Compiling and Loading to Wemos D1 It is recommended to use Arduino IDE. You will need to configure Arduino IDE to work with the Wemos board and USB port and installed the required USB drivers etc. diff --git a/marquee.ino.d1_mini_2.16.bin b/marquee.ino.d1_mini_2.18.bin similarity index 55% rename from marquee.ino.d1_mini_2.16.bin rename to marquee.ino.d1_mini_2.18.bin index 8f1efe3..60224cb 100644 Binary files a/marquee.ino.d1_mini_2.16.bin and b/marquee.ino.d1_mini_2.18.bin differ diff --git a/marquee.ino.d1_mini_wide_2.16.bin b/marquee.ino.d1_mini_wide_2.18.bin similarity index 57% rename from marquee.ino.d1_mini_wide_2.16.bin rename to marquee.ino.d1_mini_wide_2.18.bin index 23e284f..e1fcd7e 100644 Binary files a/marquee.ino.d1_mini_wide_2.16.bin and b/marquee.ino.d1_mini_wide_2.18.bin differ diff --git a/marquee/TimeDB.cpp b/marquee/TimeDB.cpp index 5293462..c38dc8d 100644 --- a/marquee/TimeDB.cpp +++ b/marquee/TimeDB.cpp @@ -75,6 +75,8 @@ time_t TimeDB::getTime() client.stop(); //stop client Serial.println(result); + int timeStart = result.lastIndexOf('{'); // trim response to start of JSON -- issue 194 + result = result.substring(timeStart); char jsonArray [result.length() + 1]; result.toCharArray(jsonArray, sizeof(jsonArray)); jsonArray[result.length() + 1] = '\0'; @@ -178,4 +180,3 @@ String TimeDB::zeroPad(int number) { return String(number); } } - diff --git a/marquee/marquee.ino b/marquee/marquee.ino index 5368201..5f9d535 100644 --- a/marquee/marquee.ino +++ b/marquee/marquee.ino @@ -27,7 +27,7 @@ #include "Settings.h" -#define VERSION "2.16" +#define VERSION "2.18" #define HOSTNAME "CLOCK-" #define CONFIG "/conf.txt" @@ -108,7 +108,6 @@ static const char WEB_ACTIONS2[] PROGMEM = " Reset Settings" " Forget WiFi" - " Restart" " Firmware Update" " About"; @@ -316,7 +315,6 @@ void setup() { server.on("/savepihole", handleSavePihole); server.on("/systemreset", handleSystemReset); server.on("/forgetwifi", handleForgetWifi); - server.on("/restart", restartEsp); server.on("/configure", handleConfigure); server.on("/configurebitcoin", handleBitcoinConfigure); server.on("/configurewideclock", handleWideClockConfigure); @@ -447,11 +445,7 @@ void loop() { if (Wide_Clock_Style == "1") { // On Wide Display -- show the current temperature as well String currentTemp = weatherClient.getTempRounded(0); - String timeSpacer = " "; - if (currentTemp.length() >= 3) { - timeSpacer = " "; - } - currentTime += timeSpacer + currentTemp + getTempSymbol(); + currentTime += " " + currentTemp + getTempSymbol(); } if (Wide_Clock_Style == "2") { currentTime += secondsIndicator(false) + TimeDB.zeroPad(second()); @@ -629,11 +623,6 @@ void handleForgetWifi() { ESP.restart(); } -void restartEsp() { - redirectHome(); - ESP.restart(); -} - void handleBitcoinConfigure() { if (!athentication()) { return server.requestAuthentication(); @@ -1121,8 +1110,8 @@ void displayWeatherData() { html += ""; html += "

"; html += weatherClient.getCondition(0) + " (" + weatherClient.getDescription(0) + ")
"; - html += temperature + " " + getTempSymbol() + "
"; - html += weatherClient.getHigh(0) + "/" + weatherClient.getLow(0) + " " + getTempSymbol() + "
"; + html += temperature + " " + getTempSymbol(true) + "
"; + html += weatherClient.getHigh(0) + "/" + weatherClient.getLow(0) + " " + getTempSymbol(true) + "
"; html += time + "
"; html += " Map It!
"; html += "


"; @@ -1220,13 +1209,23 @@ void flashLED(int number, int delayTime) { } String getTempSymbol() { + return getTempSymbol(false); +} + +String getTempSymbol(bool forWeb) { String rtnValue = "F"; if (IS_METRIC) { rtnValue = "C"; } + if (forWeb) { + rtnValue = "°" + rtnValue; + } else { + rtnValue = char(247) + rtnValue; + } return rtnValue; } + String getSpeedSymbol() { String rtnValue = "mph"; if (IS_METRIC) {