Skip to content

Commit

Permalink
Merge pull request #198 from Qrome/release/2.18
Browse files Browse the repository at this point in the history
Release/2.18
  • Loading branch information
Qrome committed Oct 10, 2021
2 parents c0243dd + 314d4da commit 6135f75
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion marquee/TimeDB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -178,4 +180,3 @@ String TimeDB::zeroPad(int number) {
return String(number);
}
}

29 changes: 14 additions & 15 deletions marquee/marquee.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

#include "Settings.h"

#define VERSION "2.16"
#define VERSION "2.18"

#define HOSTNAME "CLOCK-"
#define CONFIG "/conf.txt"
Expand Down Expand Up @@ -108,7 +108,6 @@ static const char WEB_ACTIONS2[] PROGMEM = "<a class='w3-bar-item w3-button' hre

static const char WEB_ACTION3[] PROGMEM = "</a><a class='w3-bar-item w3-button' href='/systemreset' onclick='return confirm(\"Do you want to reset to default weather settings?\")'><i class='fas fa-undo'></i> Reset Settings</a>"
"<a class='w3-bar-item w3-button' href='/forgetwifi' onclick='return confirm(\"Do you want to forget to WiFi connection?\")'><i class='fas fa-wifi'></i> Forget WiFi</a>"
"<a class='w3-bar-item w3-button' href='/restart'><i class='fas fa-sync'></i> Restart</a>"
"<a class='w3-bar-item w3-button' href='/update'><i class='fas fa-wrench'></i> Firmware Update</a>"
"<a class='w3-bar-item w3-button' href='https://github.com/Qrome/marquee-scroller' target='_blank'><i class='fas fa-question-circle'></i> About</a>";

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -629,11 +623,6 @@ void handleForgetWifi() {
ESP.restart();
}

void restartEsp() {
redirectHome();
ESP.restart();
}

void handleBitcoinConfigure() {
if (!athentication()) {
return server.requestAuthentication();
Expand Down Expand Up @@ -1121,8 +1110,8 @@ void displayWeatherData() {
html += "</div>";
html += "<div class='w3-cell w3-container' style='width:100%'><p>";
html += weatherClient.getCondition(0) + " (" + weatherClient.getDescription(0) + ")<br>";
html += temperature + " " + getTempSymbol() + "<br>";
html += weatherClient.getHigh(0) + "/" + weatherClient.getLow(0) + " " + getTempSymbol() + "<br>";
html += temperature + " " + getTempSymbol(true) + "<br>";
html += weatherClient.getHigh(0) + "/" + weatherClient.getLow(0) + " " + getTempSymbol(true) + "<br>";
html += time + "<br>";
html += "<a href='https://www.google.com/maps/@" + weatherClient.getLat(0) + "," + weatherClient.getLon(0) + ",10000m/data=!3m1!1e3' target='_BLANK'><i class='fas fa-map-marker' style='color:red'></i> Map It!</a><br>";
html += "</p></div></div><hr>";
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 6135f75

Please sign in to comment.