From a9e4429f9f3b88d9ab25b498f52a5e1b5b0e53b1 Mon Sep 17 00:00:00 2001
From: lumapu
Date: Thu, 8 Dec 2022 21:08:58 +0100
Subject: [PATCH] system clock was too fast included display builds into zip
removed 10s info from index.html
---
scripts/getVersion.py | 27 ++++++++++++++++++++++++++-
src/defines.h | 2 +-
src/publisher/pubMqtt.h | 2 +-
src/utils/scheduler.h | 5 ++++-
src/web/html/index.html | 21 +++++++++++++++++----
5 files changed, 49 insertions(+), 8 deletions(-)
diff --git a/scripts/getVersion.py b/scripts/getVersion.py
index 21406418..ffcc2714 100644
--- a/scripts/getVersion.py
+++ b/scripts/getVersion.py
@@ -51,13 +51,26 @@ def readVersion(path, infile):
os.mkdir(path + "firmware/")
sha = os.getenv("SHA",default="sha")
+
versionout = version[:-1] + "_esp8266_" + sha + ".bin"
src = path + ".pio/build/esp8266-release/firmware.bin"
dst = path + "firmware/" + versionout
os.rename(src, dst)
gzip_bin(dst, dst + ".gz")
+
+ versionout = version[:-1] + "_esp8266_nokia5110_" + sha + ".bin"
+ src = path + ".pio/build/esp8266-nokia5110/firmware.bin"
+ dst = path + "firmware/" + versionout
+ os.rename(src, dst)
+ gzip_bin(dst, dst + ".gz")
+
+ versionout = version[:-1] + "_esp8266_ssd1306_" + sha + ".bin"
+ src = path + ".pio/build/esp8266-ssd1306/firmware.bin"
+ dst = path + "firmware/" + versionout
+ os.rename(src, dst)
+ gzip_bin(dst, dst + ".gz")
- versionout = version[:-1] + "_esp8266_1m_" + sha + ".bin"
+ versionout = version[:-1] + "_esp8285_" + sha + ".bin"
src = path + ".pio/build/esp8285-release/firmware.bin"
dst = path + "firmware/" + versionout
os.rename(src, dst)
@@ -69,6 +82,18 @@ def readVersion(path, infile):
os.rename(src, dst)
gzip_bin(dst, dst + ".gz")
+ versionout = version[:-1] + "_esp32_nokia5110_" + sha + ".bin"
+ src = path + ".pio/build/esp32-wroom32-nokia5110/firmware.bin"
+ dst = path + "firmware/" + versionout
+ os.rename(src, dst)
+ gzip_bin(dst, dst + ".gz")
+
+ versionout = version[:-1] + "_esp32_ssd1306_" + sha + ".bin"
+ src = path + ".pio/build/esp32-wroom32-ssd1306/firmware.bin"
+ dst = path + "firmware/" + versionout
+ os.rename(src, dst)
+ gzip_bin(dst, dst + ".gz")
+
# other ESP32 bin files
src = path + ".pio/build/esp32-wroom32-release/"
dst = path + "firmware/"
diff --git a/src/defines.h b/src/defines.h
index d0c7a85f..d223d764 100644
--- a/src/defines.h
+++ b/src/defines.h
@@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 5
-#define VERSION_PATCH 49
+#define VERSION_PATCH 50
//-------------------------------------
typedef struct {
diff --git a/src/publisher/pubMqtt.h b/src/publisher/pubMqtt.h
index dbea4957..9a890f86 100644
--- a/src/publisher/pubMqtt.h
+++ b/src/publisher/pubMqtt.h
@@ -236,7 +236,7 @@ class PubMqtt {
publish("version", mVersion, true);
publish("device", mDevName, true);
- publish("uptime", "0");
+ tickerMinute();
publish(mLwtTopic, mLwtOnline, true, false);
subscribe("ctrl/#");
diff --git a/src/utils/scheduler.h b/src/utils/scheduler.h
index 5e7848b1..d10b56fd 100644
--- a/src/utils/scheduler.h
+++ b/src/utils/scheduler.h
@@ -42,6 +42,7 @@ namespace ah {
mUptime = 0;
mTimestamp = 0;
mPrevMillis = millis();
+ mDiffFraq = 0;
}
void loop(void) {
@@ -53,7 +54,8 @@ namespace ah {
return;
}
mDiffSeconds = mDiff / 1000;
- mPrevMillis += (mPrevMillis * 1000);
+ mDiffFraq = mDiff % 1000;
+ mPrevMillis += (mDiffSeconds * 1000) - mDiffFraq;
checkEvery();
checkAt();
mUptime += mDiffSeconds;
@@ -132,6 +134,7 @@ namespace ah {
uint32_t mMillis, mPrevMillis, mDiff;
uint32_t mUptime;
uint8_t mDiffSeconds;
+ uint16_t mDiffFraq;
};
}
diff --git a/src/web/html/index.html b/src/web/html/index.html
index b5b55b9b..6833e10d 100644
--- a/src/web/html/index.html
+++ b/src/web/html/index.html
@@ -39,12 +39,11 @@
WiFi RSSI: dBm
- Statistics:
+ System Infos:
- Every seconds the values are updated
Discuss with us on
Discord
@@ -79,6 +78,8 @@