From caeb06eea745abf1db9afe72bab1887b495df893 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Mon, 4 Sep 2023 16:30:21 -0600 Subject: [PATCH 1/7] Reset pin, quicker transitions --- README.md | 36 ++++++++++++++++++++++++++++++++++++ network.cpp | 6 ++++-- network.h | 1 + wallart.ino | 52 ++++++++++++++++++++++++++++++++++++++++++++-------- 4 files changed, 85 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 9d67e20..44c7781 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,31 @@ Most people, after watching it for a bit, form different ideas about what it's displaying. That's cool. +Reset +------ + +Plug the device in, +connect GND to pin A0, +and briefly press the reboot button. +It will flash orange and blue a few times +to let you know it has reset. + + +WiFi +----- + +If the red light on the board is lit, +that means it doesn't know how to connect to the WiFi. + +Get your phone or computer to connect to an access point +called "Wall Art xxxxxxxxx". +The password is "artsy fartsy", unless you changed it in the source code. +Once connected, +you should get a browser window that lets you connect. +If not, try going to http://neverssl.com/. + +You can clear the wifi information with a reset. + Network Server -------------- @@ -65,6 +90,17 @@ I suggest you set it to standard time and pretend it's in sync with the sun. * There are four pixels around the bottom that move every 5 seconds +Update +------ + +You can upload a new version of the firmware. +Reset the device, +and select the "Update" button instead of configuring WiFi. +Then you can upload the new .bin firmware file. + +You will have to reconfigure networking after this. + + Philosophy ---------- diff --git a/network.cpp b/network.cpp index e53a270..d738aff 100644 --- a/network.cpp +++ b/network.cpp @@ -7,6 +7,10 @@ WiFiManager wfm; +void network_reset() { + wfm.resetSettings(); +} + void network_setup(char *password) { String hostid = String(ESP.getEfuseMac(), HEX); String hostname = "Wall Art " + hostid; @@ -14,8 +18,6 @@ void network_setup(char *password) { wfm.setConfigPortalBlocking(false); wfm.setHostname(hostname); wfm.autoConnect(hostname.c_str(), password); - - pinMode(LED_BUILTIN, OUTPUT); } bool connected() { diff --git a/network.h b/network.h index db935c7..cb378fc 100644 --- a/network.h +++ b/network.h @@ -1,5 +1,6 @@ #pragma once +void network_reset(); void network_setup(char *password); bool connected(); void pause(uint32_t dwMs); diff --git a/wallart.ino b/wallart.ino index ae5e658..80ec608 100644 --- a/wallart.ino +++ b/wallart.ino @@ -1,9 +1,9 @@ -#include + #include #include #include #include #include -#include +#include #include "durations.h" #include "timezones.h" #include "picker.h" @@ -34,15 +34,34 @@ #define HTTPS_TIMEOUT (2 * SECOND) +#define RESET_PIN 26 + CRGB grid[GRIDLEN]; WiFiUDP ntpUDP; NTPClient timeClient(ntpUDP); +void do_reset() { + for (int i = 0; i < 8; i++) { + for (int j = 0; j < 8; j += 1) { + grid[j] = ((i+j)%2) ? (CRGB::Orange) : (CRGB::Blue); + } + FastLED.show(); + digitalWrite(LED_BUILTIN, i%2); + delay(300 * MILLISECOND); + } + network_reset(); +} + void setup() { + pinMode(RESET_PIN, INPUT_PULLUP); + pinMode(LED_BUILTIN, OUTPUT); FastLED.addLeds(grid, GRIDLEN); - // Maybe it's the plexiglass but for my build I really need to dial back the red - FastLED.setCorrection(0xc0ffff); + // Maybe it's the plexiglass, but for my build, I need to dial back the red + FastLED.setCorrection(0xd0ffff); + if (!digitalRead(RESET_PIN)) { + do_reset(); + } network_setup(WFM_PASSWORD); } @@ -230,9 +249,21 @@ void netget(int count=60) { if (https.skipResponseHeaders() != HTTP_SUCCESS) break; hue = netgetStatus(HUE_YELLOW); - int artlen = https.read((uint8_t *)NetArt, sizeof(NetArt)); - hue = netgetStatus(HUE_ORANGE); - NetArtFrames = (artlen / 3) / GRIDLEN; + size_t readBytes = 0; + for (int i = 0; i < 12; i++) { + size_t artBytesLeft = sizeof(NetArt) - readBytes; + + if (https.endOfBodyReached() || (artBytesLeft == 0)) { + hue = netgetStatus(HUE_ORANGE); + NetArtFrames = (readBytes / 3) / GRIDLEN; + break; + } + int l = https.read((uint8_t *)NetArt + readBytes, artBytesLeft); + if (-1 == l) { + break; + } + readBytes += l; + } } while(false); https.stop(); } @@ -307,7 +338,12 @@ void loop() { bool conn = connected(); bool day = true; - updateTime(); + switch (timeStatus()) { + case timeNotSet: + case timeNeedsSync: + updateTime(); + break; + } if (timeStatus() == timeSet) { int hh = hour(); day = ((hh >= DAY_BEGIN) && (hh < DAY_END)); From 04529ffab285405ab00c4d63f88171f843cd6ea4 Mon Sep 17 00:00:00 2001 From: neale Date: Fri, 13 Oct 2023 20:38:01 -0600 Subject: [PATCH 2/7] Update README.md --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 44c7781..8d4a160 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,11 @@ Then you can upload the new .bin firmware file. You will have to reconfigure networking after this. +### Uploading from CLI + + python3 esptool.py --chip esp32 --port "/dev/ttyUSB0" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 wallart.ino.bootloader.bin 0x8000 wallart.ino.partitions.bin 0xe000 boot_app0.bin 0x10000 wallart.ino.bin + + Philosophy ---------- From afa3c39fc322edb98d5cb1fa9f95d01cf91f4394 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 6 Dec 2023 10:50:31 -0700 Subject: [PATCH 3/7] TZ setup in UI --- README.md | 23 ++++++++++++++++++----- network.cpp | 29 ++++++++++++++++++++++++++--- network.h | 3 +++ wallart.ino | 48 ++++++------------------------------------------ 4 files changed, 53 insertions(+), 50 deletions(-) diff --git a/README.md b/README.md index 44c7781..d49fdc9 100644 --- a/README.md +++ b/README.md @@ -20,14 +20,27 @@ Most people, after watching it for a bit, form different ideas about what it's displaying. That's cool. + +Setup +----- + +When you turn it on, +it will come up as a new access point, +called "WallArt". +Connect to that to configure. + +Please configure the clock before the WiFi: +this will set up your time zone, +so it doesn't blind you in the middle of the night. + + Reset ------ Plug the device in, -connect GND to pin A0, -and briefly press the reboot button. -It will flash orange and blue a few times -to let you know it has reset. +and connect GND to pin A0 (right next to GND). +The red LED on the Feather board should come on immediately, +indicating it needs the network set up again. WiFi @@ -98,7 +111,7 @@ Reset the device, and select the "Update" button instead of configuring WiFi. Then you can upload the new .bin firmware file. -You will have to reconfigure networking after this. +You may have to reconfigure networking after this. Philosophy diff --git a/network.cpp b/network.cpp index d738aff..2615af2 100644 --- a/network.cpp +++ b/network.cpp @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -8,13 +9,25 @@ WiFiManager wfm; void network_reset() { + Serial.println("Resetting network"); wfm.resetSettings(); } -void network_setup(char *password) { - String hostid = String(ESP.getEfuseMac(), HEX); - String hostname = "Wall Art " + hostid; +void on_time_available(struct timeval *t) +{ + struct tm timeInfo; + getLocalTime(&timeInfo, 1000); + Serial.println(&timeInfo, "%A, %B %d %Y %H:%M:%S %Z %z "); +} +void network_setup(char *password) { + String hostname = "WallArt"; + + WiFiManagerNS::NTP::onTimeAvailable(&on_time_available); + WiFiManagerNS::init(&wfm); + + std::vector menu = {"wifi", "info", "custom", "param", "sep", "restart", "exit"}; + wfm.setMenu(menu); wfm.setConfigPortalBlocking(false); wfm.setHostname(hostname); wfm.autoConnect(hostname.c_str(), password); @@ -24,7 +37,17 @@ bool connected() { return WiFi.status() == WL_CONNECTED; } +bool timeConfigured = false; + void pause(uint32_t dwMs) { + if (connected() && !timeConfigured) { + WiFiManagerNS::configTime(); + timeConfigured = true; + } + if (!digitalRead(RESET_PIN)) { + network_reset(); + } + for (uint32_t t = 0; t < dwMs; t += 10) { wfm.process(); digitalWrite(LED_BUILTIN, !connected()); diff --git a/network.h b/network.h index cb378fc..b919c58 100644 --- a/network.h +++ b/network.h @@ -1,5 +1,8 @@ #pragma once +// Short this to ground to reset the network +#define RESET_PIN 26 + void network_reset(); void network_setup(char *password); bool connected(); diff --git a/wallart.ino b/wallart.ino index 80ec608..ee44fdd 100644 --- a/wallart.ino +++ b/wallart.ino @@ -1,18 +1,16 @@ - #include +#include #include #include #include -#include #include #include "durations.h" -#include "timezones.h" #include "picker.h" #include "network.h" #define NEOPIXEL_PIN 32 #define GRIDLEN 64 #define WFM_PASSWORD "artsy fartsy" -#define TIMEZONE TZ_US_Mountain +#define TIMEZONE TZ_US_Eastern /* * The hours when the day begins and ends. @@ -34,47 +32,19 @@ #define HTTPS_TIMEOUT (2 * SECOND) -#define RESET_PIN 26 CRGB grid[GRIDLEN]; -WiFiUDP ntpUDP; -NTPClient timeClient(ntpUDP); - -void do_reset() { - for (int i = 0; i < 8; i++) { - for (int j = 0; j < 8; j += 1) { - grid[j] = ((i+j)%2) ? (CRGB::Orange) : (CRGB::Blue); - } - FastLED.show(); - digitalWrite(LED_BUILTIN, i%2); - delay(300 * MILLISECOND); - } - network_reset(); -} - void setup() { pinMode(RESET_PIN, INPUT_PULLUP); pinMode(LED_BUILTIN, OUTPUT); + Serial.begin(19200); FastLED.addLeds(grid, GRIDLEN); // Maybe it's the plexiglass, but for my build, I need to dial back the red FastLED.setCorrection(0xd0ffff); - if (!digitalRead(RESET_PIN)) { - do_reset(); - } network_setup(WFM_PASSWORD); } -bool updateTime() { - if (timeClient.update()) { - time_t now = timeClient.getEpochTime(); - time_t local = TIMEZONE.toLocal(now); - setTime(local); - return true; - } - return false; -} - void fade(int cycles = 2) { int reps = (cycles*GRIDLEN) + random(GRIDLEN); int hue = random(256); @@ -291,7 +261,6 @@ void displayTime(unsigned long duration = 20 * SECOND) { FastLED.clear(); while (millis() < end) { - updateTime(); int hh = hour(); int mmss = now() % 3600; uint8_t hue = HUE_YELLOW; @@ -337,14 +306,9 @@ void loop() { uint8_t getprob = 4; bool conn = connected(); bool day = true; + timeStatus_t ts = timeStatus(); - switch (timeStatus()) { - case timeNotSet: - case timeNeedsSync: - updateTime(); - break; - } - if (timeStatus() == timeSet) { + if (ts == timeSet) { int hh = hour(); day = ((hh >= DAY_BEGIN) && (hh < DAY_END)); } @@ -355,7 +319,7 @@ void loop() { getprob = 16; } - if (!day || p.Pick(4)) { + if ((ts == timeSet) && (!day || p.Pick(4))) { // At night, only ever show the clock displayTime(2 * MINUTE); } else if (p.Pick(getprob)) { From fda0ef95e0d07a4a19bb2823cb4da9fc84e40bbb Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 6 Dec 2023 10:52:39 -0700 Subject: [PATCH 4/7] Merge README --- README.md | 38 +++++++++++++------------------------- 1 file changed, 13 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index d4fdb5a..73fe60c 100644 --- a/README.md +++ b/README.md @@ -24,15 +24,22 @@ That's cool. Setup ----- -When you turn it on, -it will come up as a new access point, -called "WallArt". -Connect to that to configure. +If the red light on the board is lit, +that means it doesn't know how to connect to the WiFi. -Please configure the clock before the WiFi: -this will set up your time zone, +Get your phone or computer to connect to an access point +called "WallArt". +The password is "artsy fartsy", unless you changed it in the source code. +Once connected, +you should get a browser window that lets you connect. +If not, try going to http://neverssl.com/. + +Please configure the clock before the WiFi. +This will set up your time zone, so it doesn't blind you in the middle of the night. +You can clear the wifi information with a reset. + Reset ------ @@ -43,22 +50,6 @@ The red LED on the Feather board should come on immediately, indicating it needs the network set up again. -WiFi ------ - -If the red light on the board is lit, -that means it doesn't know how to connect to the WiFi. - -Get your phone or computer to connect to an access point -called "Wall Art xxxxxxxxx". -The password is "artsy fartsy", unless you changed it in the source code. -Once connected, -you should get a browser window that lets you connect. -If not, try going to http://neverssl.com/. - -You can clear the wifi information with a reset. - - Network Server -------------- @@ -93,9 +84,6 @@ Clock At night, and sometimes during the day, it displays something like a clock. -You will need to tell it your time zone. -It doesn't do daylight saving time, sorry. -I suggest you set it to standard time and pretend it's in sync with the sun. * Each pixel in the top row is 1 hour (3600 seconds) * Each pixel in the middle row is 5 minutes (300 seconds) From dc0e6d8bf4caf57822fc0383c573afa98904d06c Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Wed, 6 Dec 2023 13:33:33 -0700 Subject: [PATCH 5/7] Add mac address display at boot --- README.md | 10 ++++++++-- wallart.ino | 57 ++++++++++++++++++++++++++++++++++++++++++----------- 2 files changed, 53 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 73fe60c..3b8f780 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,14 @@ That's cool. Setup ----- -If the red light on the board is lit, -that means it doesn't know how to connect to the WiFi. +When you first plug it in, +you will see a yellow pattern with blue or red bars around it. +The pattern is your mac address. +If the bars are red and a pixel is flashing, +that means you need to set up WiFi. + +You can also look at the back for a red LED. +If it's lit, you need to set up WiFi. Get your phone or computer to connect to an access point called "WallArt". diff --git a/wallart.ino b/wallart.ino index ee44fdd..444e56c 100644 --- a/wallart.ino +++ b/wallart.ino @@ -31,20 +31,11 @@ #define ART_PATH "/wallart/wallart.bin" #define HTTPS_TIMEOUT (2 * SECOND) +#define IMAGE_PULL_MIN_INTERVAL (5 * MINUTE) CRGB grid[GRIDLEN]; -void setup() { - pinMode(RESET_PIN, INPUT_PULLUP); - pinMode(LED_BUILTIN, OUTPUT); - Serial.begin(19200); - FastLED.addLeds(grid, GRIDLEN); - // Maybe it's the plexiglass, but for my build, I need to dial back the red - FastLED.setCorrection(0xd0ffff); - network_setup(WFM_PASSWORD); -} - void fade(int cycles = 2) { int reps = (cycles*GRIDLEN) + random(GRIDLEN); int hue = random(256); @@ -173,6 +164,26 @@ void cm5(uint8_t width=0, int cycles=200) { } } +void displayMacAddress(int cycles=40) { + uint64_t addr = ESP.getEfuseMac(); + + for (; cycles > 0; cycles -= 1) { + bool conn = connected(); + + fill_solid(grid, GRIDLEN, CHSV(conn?HUE_AQUA:HUE_RED, 128, 64)); + for (int i = 0; i < 48; i++) { + int pos = i + 8; + grid[pos] = CHSV(HUE_YELLOW, 255, ((addr>>(47-i)) & 1)?255:64); + } + grid[0] = CRGB::Black; + if (!conn && (cycles % 2)) { + grid[1] = CRGB::Black; + } + FastLED.show(); + pause(250*MILLISECOND); + } +} + // Art from the network int NetArtFrames = 0; CRGB NetArt[8][GRIDLEN]; @@ -203,17 +214,25 @@ uint8_t netgetStatus(uint8_t hue) { void netget(int count=60) { uint8_t hue = netgetStatus(HUE_BLUE); + static unsigned long nextPull = 0; // when to pull next #if defined(ART_HOSTNAME) && defined(ART_PORT) && defined(ART_PATH) - if (connected()) { + if (millis() < nextPull) { + // Let's not bombard the server + hue = HUE_ORANGE; + } else if (connected()) { WiFiClientSecure scli; + nextPull = millis() + IMAGE_PULL_MIN_INTERVAL; + hue = netgetStatus(HUE_AQUA); scli.setInsecure(); HttpClient https(scli, ART_HOSTNAME, ART_PORT); do { - if (https.get(ART_PATH) != 0) break; + String path = String(ART_PATH) + "?mac=" + String(ESP.getEfuseMac(), HEX); + Serial.println(path); + if (https.get(path) != 0) break; hue = netgetStatus(HUE_GREEN); if (https.skipResponseHeaders() != HTTP_SUCCESS) break; @@ -301,6 +320,20 @@ void displayTime(unsigned long duration = 20 * SECOND) { } } +void setup() { + pinMode(RESET_PIN, INPUT_PULLUP); + pinMode(LED_BUILTIN, OUTPUT); + Serial.begin(19200); + FastLED.addLeds(grid, GRIDLEN); + // Maybe it's the plexiglass, but for my build, I need to dial back the red + FastLED.setCorrection(0xd0ffff); + network_setup(WFM_PASSWORD); + + // Show our mac address, for debugging? + displayMacAddress(); + sparkle(); +} + void loop() { Picker p; uint8_t getprob = 4; From 3c35b5b204a1f7c0c0ed4e887306e4f641ca01aa Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Fri, 8 Dec 2023 20:37:55 -0700 Subject: [PATCH 6/7] Fully move to new NTP thingy --- README.md | 13 ++----------- network.cpp | 11 +++++++++-- network.h | 1 + timezones.h | 17 ----------------- wallart.ino | 36 ++++++++++++++++++++---------------- 5 files changed, 32 insertions(+), 46 deletions(-) delete mode 100644 timezones.h diff --git a/README.md b/README.md index 3b8f780..511a420 100644 --- a/README.md +++ b/README.md @@ -97,17 +97,8 @@ it displays something like a clock. * There are four pixels around the bottom that move every 5 seconds -Update ------- - -You can upload a new version of the firmware. -Reset the device, -and select the "Update" button instead of configuring WiFi. -Then you can upload the new .bin firmware file. - -You may have to reconfigure networking after this. - -### Uploading from CLI +Updating Firmware +----------------- python3 esptool.py --chip esp32 --port "/dev/ttyUSB0" --baud 921600 --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size 4MB 0x1000 wallart.ino.bootloader.bin 0x8000 wallart.ino.partitions.bin 0xe000 boot_app0.bin 0x10000 wallart.ino.bin diff --git a/network.cpp b/network.cpp index 2615af2..0347de4 100644 --- a/network.cpp +++ b/network.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include #include "network.h" @@ -13,11 +14,17 @@ void network_reset() { wfm.resetSettings(); } -void on_time_available(struct timeval *t) -{ + +bool time_was_accurate_once = false; +bool clock_is_set() { + return time_was_accurate_once; +} + +void on_time_available(struct timeval *t) { struct tm timeInfo; getLocalTime(&timeInfo, 1000); Serial.println(&timeInfo, "%A, %B %d %Y %H:%M:%S %Z %z "); + time_was_accurate_once = true; } void network_setup(char *password) { diff --git a/network.h b/network.h index b919c58..4143a85 100644 --- a/network.h +++ b/network.h @@ -8,3 +8,4 @@ void network_setup(char *password); bool connected(); void pause(uint32_t dwMs); void netget(int count); +bool clock_is_set(); diff --git a/timezones.h b/timezones.h deleted file mode 100644 index e7a64b2..0000000 --- a/timezones.h +++ /dev/null @@ -1,17 +0,0 @@ -#include - -TimeChangeRule usEDT = {"EDT", Second, Sun, Mar, 2, -240}; -TimeChangeRule usEST = {"EST", First, Sun, Nov, 2, -300}; -Timezone TZ_US_Eastern(usEDT, usEST); - -TimeChangeRule usCDT = {"CDT", Second, Sun, Mar, 2, -300}; -TimeChangeRule usCST = {"CST", First, Sun, Nov, 2, -360}; -Timezone TZ_US_Central(usCDT, usCST); - -TimeChangeRule usMDT = {"MDT", Second, Sun, Mar, 2, -360}; -TimeChangeRule usMST = {"MST", First, Sun, Nov, 2, -420}; -Timezone TZ_US_Mountain(usMDT, usMST); - -TimeChangeRule usPDT = {"EDT", Second, Sun, Mar, 2, -420}; -TimeChangeRule usPST = {"EST", First, Sun, Nov, 2, -480}; -Timezone TZ_US_Pacific(usPDT, usPST); diff --git a/wallart.ino b/wallart.ino index 444e56c..448f627 100644 --- a/wallart.ino +++ b/wallart.ino @@ -10,7 +10,6 @@ #define NEOPIXEL_PIN 32 #define GRIDLEN 64 #define WFM_PASSWORD "artsy fartsy" -#define TIMEZONE TZ_US_Eastern /* * The hours when the day begins and ends. @@ -274,18 +273,22 @@ void spinner(int count=32) { } } -void displayTime(unsigned long duration = 20 * SECOND) { - if (timeStatus() != timeSet) return; +void displayTime(unsigned long duration = 20*SECOND) { + if (!clock_is_set()) return; unsigned long end = millis() + duration; + FastLED.clear(); while (millis() < end) { - int hh = hour(); - int mmss = now() % 3600; + struct tm info; + getLocalTime(&info); + + int hh = info.tm_hour; + int mmss = (info.tm_min * 60) + info.tm_sec; uint8_t hue = HUE_YELLOW; // Top: Hours - if (isPM()) { + if (hh >= 12) { hue = HUE_ORANGE; hh -= 12; } @@ -298,10 +301,10 @@ void displayTime(unsigned long duration = 20 * SECOND) { // Outer: 5s uint8_t s = (mmss/5) % 5; - grid[64 - 7 - 1] = CHSV(HUE_PURPLE, 128, (s==1)?96:0); - grid[64 - 15 - 1] = CHSV(HUE_PURPLE, 128, (s==2)?96:0); - grid[64 - 8 - 1] = CHSV(HUE_PURPLE, 128, (s==3)?96:0); - grid[64 - 0 - 1] = CHSV(HUE_PURPLE, 128, (s==4)?96:0); + grid[64 - 7 - 1] = CHSV(HUE_GREEN, 128, (s==1)?96:0); + grid[64 - 15 - 1] = CHSV(HUE_GREEN, 128, (s==2)?96:0); + grid[64 - 8 - 1] = CHSV(HUE_GREEN, 128, (s==3)?96:0); + grid[64 - 0 - 1] = CHSV(HUE_GREEN, 128, (s==4)?96:0); for (int i = 0; i < 12; i++) { // Omit first and last position on a row @@ -339,11 +342,11 @@ void loop() { uint8_t getprob = 4; bool conn = connected(); bool day = true; - timeStatus_t ts = timeStatus(); - if (ts == timeSet) { - int hh = hour(); - day = ((hh >= DAY_BEGIN) && (hh < DAY_END)); + if (clock_is_set()) { + struct tm info; + getLocalTime(&info); + day = ((info.tm_hour >= DAY_BEGIN) && (info.tm_hour < DAY_END)); } FastLED.setBrightness(day?DAY_BRIGHTNESS:NIGHT_BRIGHTNESS); @@ -352,8 +355,9 @@ void loop() { getprob = 16; } - if ((ts == timeSet) && (!day || p.Pick(4))) { - // At night, only ever show the clock + if (!day && clock_is_set()) { + displayTime(); + } else if (p.Pick(4) && clock_is_set()) { displayTime(2 * MINUTE); } else if (p.Pick(getprob)) { netget(); From d91aa4cfc72962e0c4aca26f2b28de942b071e7a Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Sat, 9 Dec 2023 08:04:37 -0700 Subject: [PATCH 7/7] Add setup option to upload new firmware --- network.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network.cpp b/network.cpp index 0347de4..f72e252 100644 --- a/network.cpp +++ b/network.cpp @@ -33,7 +33,7 @@ void network_setup(char *password) { WiFiManagerNS::NTP::onTimeAvailable(&on_time_available); WiFiManagerNS::init(&wfm); - std::vector menu = {"wifi", "info", "custom", "param", "sep", "restart", "exit"}; + std::vector menu = {"wifi", "info", "custom", "param", "sep", "update", "restart", "exit"}; wfm.setMenu(menu); wfm.setConfigPortalBlocking(false); wfm.setHostname(hostname);