mirror of
https://github.com/lumapu/ahoy.git
synced 2025-04-28 17:56:21 +02:00
Merge branch 'development03' into feature/newAsyncWebserver
This commit is contained in:
commit
b19aeaae5f
11 changed files with 146 additions and 58 deletions
2
.github/workflows/compile_development.yml
vendored
2
.github/workflows/compile_development.yml
vendored
|
@ -92,7 +92,7 @@ jobs:
|
|||
matrix:
|
||||
variant:
|
||||
- opendtufusion-de
|
||||
- opendtufusion-16MB-de
|
||||
#- opendtufusion-16MB-de #not needed, only the partions.bin is different and can be used from english build
|
||||
- esp8266-de
|
||||
- esp8266-all-de
|
||||
- esp8266-prometheus-de
|
||||
|
|
104
.github/workflows/compile_release.yml
vendored
104
.github/workflows/compile_release.yml
vendored
|
@ -7,34 +7,34 @@ on:
|
|||
- '**.md' # Do no build on *.md changes
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build Environments
|
||||
check:
|
||||
name: Check Repository
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository == 'lumapu/ahoy' && github.ref_name == 'main'
|
||||
continue-on-error: false
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
build-en:
|
||||
name: Build (EN)
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: false
|
||||
strategy:
|
||||
matrix:
|
||||
variant:
|
||||
- opendtufusion
|
||||
- opendtufusion-16MB
|
||||
- esp8266
|
||||
- esp8266-all
|
||||
- esp8266-minimal
|
||||
- esp8266-prometheus
|
||||
- esp8285
|
||||
- esp32-wroom32
|
||||
- esp32-wroom32-minimal
|
||||
- esp32-wroom32-prometheus
|
||||
- esp32-wroom32-ethernet
|
||||
- esp32-s2-mini
|
||||
- esp32-c3-mini
|
||||
- opendtufusion
|
||||
- opendtufusion-ethernet
|
||||
- esp8266-de
|
||||
- esp8266-prometheus-de
|
||||
- esp8285-de
|
||||
- esp32-wroom32-de
|
||||
- esp32-wroom32-prometheus-de
|
||||
- esp32-wroom32-ethernet-de
|
||||
- esp32-s2-mini-de
|
||||
- esp32-c3-mini-de
|
||||
- opendtufusion-de
|
||||
- opendtufusion-ethernet-de
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: benjlevesque/short-sha@v3.0
|
||||
|
@ -69,6 +69,11 @@ jobs:
|
|||
- name: Run PlatformIO
|
||||
run: pio run -d src -e ${{ matrix.variant }}
|
||||
|
||||
- name: Compress .elf
|
||||
uses: edgarrc/action-7z@v1
|
||||
with:
|
||||
args: 7z a -t7z -mx=9 src/.pio/build/${{ matrix.variant }}/firmware.elf.7z ./src/.pio/build/${{ matrix.variant }}/firmware.elf
|
||||
|
||||
- name: Rename Firmware
|
||||
run: python scripts/getVersion.py ${{ matrix.variant }} >> $GITHUB_OUTPUT
|
||||
|
||||
|
@ -78,11 +83,76 @@ jobs:
|
|||
name: ${{ matrix.variant }}
|
||||
path: firmware/*
|
||||
|
||||
build-de:
|
||||
name: Build (DE)
|
||||
needs: check
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: false
|
||||
strategy:
|
||||
matrix:
|
||||
variant:
|
||||
- opendtufusion-de
|
||||
#- opendtufusion-16MB-de #not needed, only the partions.bin is different and can be used from english build
|
||||
- esp8266-de
|
||||
- esp8266-all-de
|
||||
- esp8266-prometheus-de
|
||||
- esp8285-de
|
||||
- esp32-wroom32-de
|
||||
- esp32-wroom32-prometheus-de
|
||||
- esp32-s2-mini-de
|
||||
- esp32-c3-mini-de
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: benjlevesque/short-sha@v3.0
|
||||
id: short-sha
|
||||
with:
|
||||
length: 7
|
||||
|
||||
- name: Cache Pip
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.x"
|
||||
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
python -m pip install setuptools --upgrade pip
|
||||
pip install --upgrade platformio
|
||||
|
||||
- name: Run PlatformIO
|
||||
run: pio run -d src -e ${{ matrix.variant }}
|
||||
|
||||
- name: Compress .elf
|
||||
uses: edgarrc/action-7z@v1
|
||||
with:
|
||||
args: 7z a -t7z -mx=9 src/.pio/build/${{ matrix.variant }}/firmware.elf.7z ./src/.pio/build/${{ matrix.variant }}/firmware.elf
|
||||
|
||||
- name: Rename Firmware
|
||||
run: python scripts/getVersion.py ${{ matrix.variant }} >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Create Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.variant }}
|
||||
path: firmware/*
|
||||
|
||||
release:
|
||||
name: Create Release
|
||||
needs: [build-en, build-de]
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build]
|
||||
continue-on-error: false
|
||||
permissions:
|
||||
contents: write
|
||||
|
@ -140,7 +210,7 @@ jobs:
|
|||
|
||||
deploy:
|
||||
name: Deploy Environments to fw.ahoydtu.de
|
||||
needs: [build, release]
|
||||
needs: [build-en, build-de, release]
|
||||
runs-on: ubuntu-latest
|
||||
continue-on-error: false
|
||||
steps:
|
||||
|
|
Binary file not shown.
|
@ -1,5 +1,19 @@
|
|||
# Development Changes
|
||||
|
||||
# RELEASE 0.8.140 - 2024-08-16
|
||||
|
||||
## 0.8.139 - 2024-08-15
|
||||
* fix reload after save for WiFi configurations (5s -> 20s)
|
||||
|
||||
## 0.8.138 - 2024-08-15
|
||||
* fix ePaper not functional #1722
|
||||
|
||||
## 0.8.137 - 2024-08-13
|
||||
* fix storage of timezone and region #1723
|
||||
|
||||
## 0.8.136 - 2024-08-12
|
||||
* fix save settings for ESP32 devices #1720
|
||||
|
||||
## 0.8.135 - 2024-08-11
|
||||
* translated `/system` #1717
|
||||
* added default pin seetings for opendtufusion board
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
//-------------------------------------
|
||||
#define VERSION_MAJOR 0
|
||||
#define VERSION_MINOR 8
|
||||
#define VERSION_PATCH 135
|
||||
#define VERSION_PATCH 140
|
||||
//-------------------------------------
|
||||
typedef struct {
|
||||
uint8_t ch;
|
||||
|
|
|
@ -22,6 +22,9 @@ class AhoyEthernet : public AhoyWifi {
|
|||
};
|
||||
|
||||
public:
|
||||
AhoyEthernet()
|
||||
: mMode (Mode::WIRELESS) {}
|
||||
|
||||
virtual void begin() override {
|
||||
mMode = Mode::WIRELESS;
|
||||
mAp.enable();
|
||||
|
|
|
@ -329,6 +329,7 @@ monitor_filters =
|
|||
platform = espressif32@6.7.0
|
||||
board = esp32-s3-devkitc-1
|
||||
board_upload.flash_size = 16MB
|
||||
board_build.partitions = default_16MB.csv
|
||||
upload_protocol = esp-builtin
|
||||
build_flags = ${env:opendtufusion.build_flags}
|
||||
monitor_filters =
|
||||
|
|
|
@ -45,7 +45,7 @@ class Display {
|
|||
case DISP_TYPE_T4_SSD1306_128X32: mMono = new DisplayMono128X32(); break; // SSD1306_128X32 (0.91")
|
||||
case DISP_TYPE_T5_SSD1306_64X48: mMono = new DisplayMono64X48(); break; // SSD1306_64X48 (0.66" - Wemos OLED Shield)
|
||||
case DISP_TYPE_T6_SSD1309_128X64: mMono = new DisplayMono128X64(); break; // SSD1309_128X64 (2.42")
|
||||
#if defined(ESP32) && !defined(ETHERNET)
|
||||
#if defined(ESP32)
|
||||
case DISP_TYPE_T10_EPAPER:
|
||||
mMono = NULL; // ePaper does not use this
|
||||
mRefreshCycle = 0;
|
||||
|
@ -73,7 +73,7 @@ class Display {
|
|||
}
|
||||
|
||||
void loop() {
|
||||
#if defined(ESP32) && !defined(ETHERNET)
|
||||
#if defined(ESP32)
|
||||
if ((nullptr != mCfg) && (DISP_TYPE_T10_EPAPER == mCfg->type)) {
|
||||
mEpaper.refreshLoop();
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ class Display {
|
|||
mLoopCnt = 0;
|
||||
}
|
||||
}
|
||||
#if defined(ESP32) && !defined(ETHERNET)
|
||||
#if defined(ESP32)
|
||||
else if (DISP_TYPE_T10_EPAPER == mCfg->type) {
|
||||
// maintain ePaper at least every 15 seconds
|
||||
if (mNewPayload || (((++mLoopCnt) % 15) == 0)) {
|
||||
|
@ -193,7 +193,7 @@ class Display {
|
|||
if (mMono ) {
|
||||
mMono->disp();
|
||||
}
|
||||
#if defined(ESP32) && !defined(ETHERNET)
|
||||
#if defined(ESP32)
|
||||
else if (DISP_TYPE_T10_EPAPER == mCfg->type) {
|
||||
mEpaper.loop((totalPower), totalYieldDay, totalYieldTotal, nrprod);
|
||||
mRefreshCycle++;
|
||||
|
@ -254,7 +254,7 @@ class Display {
|
|||
RADIO *mHmsRadio = nullptr;
|
||||
uint16_t mRefreshCycle = 0;
|
||||
|
||||
#if defined(ESP32) && !defined(ETHERNET)
|
||||
#if defined(ESP32)
|
||||
DisplayEPaper mEpaper;
|
||||
#endif
|
||||
DisplayMono *mMono = nullptr;
|
||||
|
|
|
@ -457,8 +457,8 @@ class RestApi {
|
|||
|
||||
void getHtmlReboot(AsyncWebServerRequest *request, JsonObject obj) {
|
||||
getGeneric(request, obj.createNestedObject(F("generic")));
|
||||
#if defined(ETHERNET) && defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
obj[F("refresh")] = 5;
|
||||
#if defined(ETHERNET)
|
||||
obj[F("refresh")] = (mConfig->sys.eth.enabled) ? 5 : 20;
|
||||
#else
|
||||
obj[F("refresh")] = 20;
|
||||
#endif
|
||||
|
@ -471,8 +471,8 @@ class RestApi {
|
|||
obj[F("pending")] = (bool)mApp->getSavePending();
|
||||
obj[F("success")] = (bool)mApp->getLastSaveSucceed();
|
||||
obj[F("reboot")] = (bool)mApp->getShouldReboot();
|
||||
#if defined(ETHERNET) && defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
obj[F("reload")] = 5;
|
||||
#if defined(ETHERNET)
|
||||
obj[F("reload")] = (mConfig->sys.eth.enabled) ? 5 : 20;
|
||||
#else
|
||||
obj[F("reload")] = 20;
|
||||
#endif
|
||||
|
@ -489,7 +489,7 @@ class RestApi {
|
|||
mApp->setRebootFlag();
|
||||
obj[F("html")] = F("Erase settings: success");
|
||||
#if defined(ETHERNET) && defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
obj[F("reload")] = 5;
|
||||
obj[F("reload")] = (mConfig->sys.eth.enabled) ? 5 : 20;
|
||||
#else
|
||||
obj[F("reload")] = 20;
|
||||
#endif
|
||||
|
@ -507,8 +507,8 @@ class RestApi {
|
|||
mApp->eraseSettings(true);
|
||||
mApp->setRebootFlag();
|
||||
obj[F("html")] = F("Factory reset: success");
|
||||
#if defined(ETHERNET) && defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
obj[F("reload")] = 5;
|
||||
#if defined(ETHERNET)
|
||||
obj[F("reload")] = (mConfig->sys.eth.enabled) ? 5 : 20;
|
||||
#else
|
||||
obj[F("reload")] = 20;
|
||||
#endif
|
||||
|
|
|
@ -682,31 +682,24 @@
|
|||
}
|
||||
|
||||
function parseSys(obj) {
|
||||
for(var i of [["device", "device_name"], ["ssid", "ssid"], ["ap_pwd", "ap_pwd"]])
|
||||
document.getElementsByName(i[0])[0].value = obj[i[1]];
|
||||
document.getElementsByName("hidd")[0].checked = obj["hidd"];
|
||||
document.getElementsByName("device")[0].value = obj.device_name;
|
||||
for(var i of [["ssid", "ssid"], ["ap_pwd", "ap_pwd"]])
|
||||
document.getElementsByName(i[0])[0].value = obj.network[i[1]];
|
||||
document.getElementsByName("hidd")[0].checked = obj.network.hidd;
|
||||
|
||||
document.getElementsByName("darkMode")[0].checked = obj["dark_mode"];
|
||||
document.getElementsByName("schedReboot")[0].checked = obj["sched_reboot"];
|
||||
document.getElementsByName("darkMode")[0].checked = obj.dark_mode;
|
||||
document.getElementsByName("schedReboot")[0].checked = obj.sched_reboot;
|
||||
e = document.getElementsByName("adminpwd")[0];
|
||||
if(!obj["pwd_set"])
|
||||
if(!obj.pwd_set)
|
||||
e.value = "";
|
||||
var d = document.getElementById("prot_mask");
|
||||
var a = ["Index", "{#NAV_LIVE}", "{#NAV_WEBSERIAL}", "{#NAV_SETTINGS}", "Update", "System", "{#NAV_HISTORY}"];
|
||||
var el = [];
|
||||
for(var i = 0; i < 7; i++) {
|
||||
var chk = ((obj["prot_mask"] & (1 << i)) == (1 << i));
|
||||
var chk = ((obj.prot_mask & (1 << i)) == (1 << i));
|
||||
el.push(mlCb("protMask" + i, a[i], chk))
|
||||
}
|
||||
d.append(...el);
|
||||
|
||||
var tz = []
|
||||
for(i = 0; i < 24; i += 0.5)
|
||||
tz.push([i, ((i-12 > 0) ? "+" : "") + String(i-12)]);
|
||||
document.getElementById("timezone").append(sel("timezone", tz, obj.timezone + 12))
|
||||
var region = [[0, "Europe (860 - 870 MHz)"], [1, "USA, Indonesia (905 - 925 MHz)"], [2, "Brazil (915 - 928 MHz)"]]
|
||||
document.getElementById("region").append(sel("region", region, obj.region))
|
||||
|
||||
}
|
||||
|
||||
function parseGeneric(obj) {
|
||||
|
@ -720,8 +713,15 @@
|
|||
document.getElementsByName("cstLnkTxt")[0].value = obj.cst_lnk_txt
|
||||
}
|
||||
|
||||
ts = obj["ts_now"];
|
||||
ts = obj.ts_now;
|
||||
window.setInterval("tick()", 1000);
|
||||
|
||||
var tz = []
|
||||
for(i = 0; i < 24; i += 0.5)
|
||||
tz.push([i, ((i-12 > 0) ? "+" : "") + String(i-12)]);
|
||||
document.getElementById("timezone").append(sel("timezone", tz, obj.timezone + 12))
|
||||
var region = [[0, "Europe (860 - 870 MHz)"], [1, "USA, Indonesia (905 - 925 MHz)"], [2, "Brazil (915 - 928 MHz)"]]
|
||||
document.getElementById("region").append(sel("region", region, obj.region))
|
||||
}
|
||||
|
||||
function parseStaticIp(obj) {
|
||||
|
@ -1330,23 +1330,23 @@
|
|||
|
||||
function parse(root) {
|
||||
if(null != root) {
|
||||
parseGeneric(root["generic"]);
|
||||
parseSys(root["system"]);
|
||||
parseStaticIp(root["static_ip"]);
|
||||
parseMqtt(root["mqtt"]);
|
||||
parseNtp(root["ntp"]);
|
||||
parseSun(root["sun"]);
|
||||
parseGeneric(root.generic);
|
||||
parseSys(root.system);
|
||||
parseStaticIp(root.static_ip);
|
||||
parseMqtt(root.mqtt);
|
||||
parseNtp(root.ntp);
|
||||
parseSun(root.sun);
|
||||
parsePinout(root.pinout);
|
||||
parseNrfRadio(root["radioNrf"], root["pinout"]);
|
||||
parseNrfRadio(root.radioNrf, root.pinout);
|
||||
/*IF_ESP32*/
|
||||
parseCmtRadio(root.radioCmt);
|
||||
/*ENDIF_ESP32*/
|
||||
/*IF_ETHERNET*/
|
||||
parseEth(root.eth)
|
||||
/*ENDIF_ETHERNET*/
|
||||
parseSerial(root["serial"]);
|
||||
parseSerial(root.serial);
|
||||
/*IF_PLUGIN_DISPLAY*/
|
||||
parseDisplay(root["display"], root["system"]["esp_type"], root["system"]);
|
||||
parseDisplay(root.display, root.system.esp_type, root.system);
|
||||
/*ENDIF_PLUGIN_DISPLAY*/
|
||||
getAjax("/api/inverter/list", parseIv);
|
||||
}
|
||||
|
|
|
@ -268,8 +268,8 @@ class Web {
|
|||
bool reboot = (!Update.hasError());
|
||||
|
||||
String html = F("<!doctype html><html><head><title>Update</title><meta http-equiv=\"refresh\" content=\"");
|
||||
#if defined(ETHERNET) && defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||
html += F("5");
|
||||
#if defined(ETHERNET)
|
||||
html += (mConfig->sys.eth.enabled) ? F("5") : F("20");
|
||||
#else
|
||||
html += F("20");
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue