mirror of
https://github.com/lumapu/ahoy.git
synced 2025-07-30 14:38:27 +02:00
0.8.85 - zero
* disabled display and history for all ESPs expect ESP32S3
This commit is contained in:
parent
60dd9cfc47
commit
962e9d2831
6 changed files with 40 additions and 10 deletions
8
.github/workflows/compile_zero-export.yml
vendored
8
.github/workflows/compile_zero-export.yml
vendored
|
@ -161,12 +161,6 @@ jobs:
|
||||||
- name: Rename firmware directory
|
- name: Rename firmware directory
|
||||||
run: mv firmware ${{ steps.version_name.outputs.name }}
|
run: mv firmware ${{ steps.version_name.outputs.name }}
|
||||||
|
|
||||||
- name: Zip Artifacts
|
|
||||||
uses: vimtor/action-zip@v1.2
|
|
||||||
with:
|
|
||||||
files: ${{ steps.version_name.outputs.name }} manual/User_Manual.md manual/Getting_Started.md
|
|
||||||
dest: '${{ steps.version_name.outputs.name }}.zip'
|
|
||||||
|
|
||||||
- name: delete environment Artifacts
|
- name: delete environment Artifacts
|
||||||
uses: geekyeggo/delete-artifact@v4
|
uses: geekyeggo/delete-artifact@v4
|
||||||
with:
|
with:
|
||||||
|
@ -176,4 +170,4 @@ jobs:
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: zero-${{ steps.version_name.outputs.name }}
|
name: zero-${{ steps.version_name.outputs.name }}
|
||||||
path: '${{ steps.version_name.outputs.name }}.zip'
|
path: ${{ steps.version_name.outputs.name }} manual/User_Manual.md manual/Getting_Started.md
|
||||||
|
|
16
src/config/config_override.h
Normal file
16
src/config/config_override.h
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
#ifndef __CONFIG_OVERRIDE_H__
|
||||||
|
#define __CONFIG_OVERRIDE_H__
|
||||||
|
|
||||||
|
// save space in the ESP32 by disabling modules
|
||||||
|
|
||||||
|
#if !defined(CONFIG_IDF_TARGET_ESP32S3)
|
||||||
|
#ifdef PLUGIN_DISPLAY
|
||||||
|
#undef PLUGIN_DISPLAY
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef ENABLE_HISTORY
|
||||||
|
#undef ENABLE_HISTORY
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /*__CONFIG_OVERRIDE_H__*/
|
|
@ -183,6 +183,7 @@ typedef struct {
|
||||||
bool readGrid;
|
bool readGrid;
|
||||||
} cfgInst_t;
|
} cfgInst_t;
|
||||||
|
|
||||||
|
#if defined(PLUGIN_DISPLAY)
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t type;
|
uint8_t type;
|
||||||
bool pwrSaveAtIvOffline;
|
bool pwrSaveAtIvOffline;
|
||||||
|
@ -201,9 +202,12 @@ typedef struct {
|
||||||
uint8_t disp_dc;
|
uint8_t disp_dc;
|
||||||
uint8_t pirPin;
|
uint8_t pirPin;
|
||||||
} display_t;
|
} display_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
#if defined(PLUGIN_DISPLAY)
|
||||||
display_t display;
|
display_t display;
|
||||||
|
#endif
|
||||||
char customLink[MAX_CUSTOM_LINK_LEN];
|
char customLink[MAX_CUSTOM_LINK_LEN];
|
||||||
char customLinkText[MAX_CUSTOM_LINK_TEXT_LEN];
|
char customLinkText[MAX_CUSTOM_LINK_TEXT_LEN];
|
||||||
#if defined(ESP32)
|
#if defined(ESP32)
|
||||||
|
@ -506,6 +510,7 @@ class settings {
|
||||||
mCfg.led.high_active = LED_HIGH_ACTIVE;
|
mCfg.led.high_active = LED_HIGH_ACTIVE;
|
||||||
mCfg.led.luminance = 255;
|
mCfg.led.luminance = 255;
|
||||||
|
|
||||||
|
#if defined(PLUGIN_DISPLAY)
|
||||||
mCfg.plugin.display.pwrSaveAtIvOffline = false;
|
mCfg.plugin.display.pwrSaveAtIvOffline = false;
|
||||||
mCfg.plugin.display.contrast = 140;
|
mCfg.plugin.display.contrast = 140;
|
||||||
mCfg.plugin.display.screenSaver = 1; // default: 1 .. pixelshift for OLED for downward compatibility
|
mCfg.plugin.display.screenSaver = 1; // default: 1 .. pixelshift for OLED for downward compatibility
|
||||||
|
@ -519,6 +524,7 @@ class settings {
|
||||||
mCfg.plugin.display.disp_busy = DEF_PIN_OFF;
|
mCfg.plugin.display.disp_busy = DEF_PIN_OFF;
|
||||||
mCfg.plugin.display.disp_dc = DEF_PIN_OFF;
|
mCfg.plugin.display.disp_dc = DEF_PIN_OFF;
|
||||||
mCfg.plugin.display.pirPin = DEF_PIN_OFF;
|
mCfg.plugin.display.pirPin = DEF_PIN_OFF;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void loadAddedDefaults() {
|
void loadAddedDefaults() {
|
||||||
|
@ -785,6 +791,7 @@ class settings {
|
||||||
|
|
||||||
void jsonPlugin(JsonObject obj, bool set = false) {
|
void jsonPlugin(JsonObject obj, bool set = false) {
|
||||||
if(set) {
|
if(set) {
|
||||||
|
#if defined(PLUGIN_DISPLAY)
|
||||||
JsonObject disp = obj.createNestedObject("disp");
|
JsonObject disp = obj.createNestedObject("disp");
|
||||||
disp[F("type")] = mCfg.plugin.display.type;
|
disp[F("type")] = mCfg.plugin.display.type;
|
||||||
disp[F("pwrSafe")] = (bool)mCfg.plugin.display.pwrSaveAtIvOffline;
|
disp[F("pwrSafe")] = (bool)mCfg.plugin.display.pwrSaveAtIvOffline;
|
||||||
|
@ -802,9 +809,11 @@ class settings {
|
||||||
disp[F("busy")] = mCfg.plugin.display.disp_busy;
|
disp[F("busy")] = mCfg.plugin.display.disp_busy;
|
||||||
disp[F("dc")] = mCfg.plugin.display.disp_dc;
|
disp[F("dc")] = mCfg.plugin.display.disp_dc;
|
||||||
disp[F("pirPin")] = mCfg.plugin.display.pirPin;
|
disp[F("pirPin")] = mCfg.plugin.display.pirPin;
|
||||||
|
#endif
|
||||||
obj[F("cst_lnk")] = mCfg.plugin.customLink;
|
obj[F("cst_lnk")] = mCfg.plugin.customLink;
|
||||||
obj[F("cst_lnk_txt")] = mCfg.plugin.customLinkText;
|
obj[F("cst_lnk_txt")] = mCfg.plugin.customLinkText;
|
||||||
} else {
|
} else {
|
||||||
|
#if defined(PLUGIN_DISPLAY)
|
||||||
JsonObject disp = obj["disp"];
|
JsonObject disp = obj["disp"];
|
||||||
getVal<uint8_t>(disp, F("type"), &mCfg.plugin.display.type);
|
getVal<uint8_t>(disp, F("type"), &mCfg.plugin.display.type);
|
||||||
getVal<bool>(disp, F("pwrSafe"), &mCfg.plugin.display.pwrSaveAtIvOffline);
|
getVal<bool>(disp, F("pwrSafe"), &mCfg.plugin.display.pwrSaveAtIvOffline);
|
||||||
|
@ -822,6 +831,7 @@ class settings {
|
||||||
getVal<uint8_t>(disp, F("busy"), &mCfg.plugin.display.disp_busy);
|
getVal<uint8_t>(disp, F("busy"), &mCfg.plugin.display.disp_busy);
|
||||||
getVal<uint8_t>(disp, F("dc"), &mCfg.plugin.display.disp_dc);
|
getVal<uint8_t>(disp, F("dc"), &mCfg.plugin.display.disp_dc);
|
||||||
getVal<uint8_t>(disp, F("pirPin"), &mCfg.plugin.display.pirPin);
|
getVal<uint8_t>(disp, F("pirPin"), &mCfg.plugin.display.pirPin);
|
||||||
|
#endif
|
||||||
getChar(obj, F("cst_lnk"), mCfg.plugin.customLink, MAX_CUSTOM_LINK_LEN);
|
getChar(obj, F("cst_lnk"), mCfg.plugin.customLink, MAX_CUSTOM_LINK_LEN);
|
||||||
getChar(obj, F("cst_lnk_txt"), mCfg.plugin.customLinkText, MAX_CUSTOM_LINK_TEXT_LEN);
|
getChar(obj, F("cst_lnk_txt"), mCfg.plugin.customLinkText, MAX_CUSTOM_LINK_TEXT_LEN);
|
||||||
}
|
}
|
||||||
|
|
|
@ -708,6 +708,7 @@ class RestApi {
|
||||||
ah::ip2Char(mConfig->sys.ip.gateway, buf); obj[F("gateway")] = String(buf);
|
ah::ip2Char(mConfig->sys.ip.gateway, buf); obj[F("gateway")] = String(buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(PLUGIN_DISPLAY)
|
||||||
void getDisplay(JsonObject obj) {
|
void getDisplay(JsonObject obj) {
|
||||||
obj[F("disp_typ")] = (uint8_t)mConfig->plugin.display.type;
|
obj[F("disp_typ")] = (uint8_t)mConfig->plugin.display.type;
|
||||||
obj[F("disp_pwr")] = (bool)mConfig->plugin.display.pwrSaveAtIvOffline;
|
obj[F("disp_pwr")] = (bool)mConfig->plugin.display.pwrSaveAtIvOffline;
|
||||||
|
@ -724,6 +725,7 @@ class RestApi {
|
||||||
obj[F("disp_bsy")] = mConfig->plugin.display.disp_busy;
|
obj[F("disp_bsy")] = mConfig->plugin.display.disp_busy;
|
||||||
obj[F("pir_pin")] = mConfig->plugin.display.pirPin;
|
obj[F("pir_pin")] = mConfig->plugin.display.pirPin;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void getMqttInfo(JsonObject obj) {
|
void getMqttInfo(JsonObject obj) {
|
||||||
obj[F("enabled")] = (mConfig->mqtt.broker[0] != '\0');
|
obj[F("enabled")] = (mConfig->mqtt.broker[0] != '\0');
|
||||||
|
@ -790,7 +792,9 @@ class RestApi {
|
||||||
getRadioNrf(obj.createNestedObject(F("radioNrf")));
|
getRadioNrf(obj.createNestedObject(F("radioNrf")));
|
||||||
getSerial(obj.createNestedObject(F("serial")));
|
getSerial(obj.createNestedObject(F("serial")));
|
||||||
getStaticIp(obj.createNestedObject(F("static_ip")));
|
getStaticIp(obj.createNestedObject(F("static_ip")));
|
||||||
|
#if defined(PLUGIN_DISPLAY)
|
||||||
getDisplay(obj.createNestedObject(F("display")));
|
getDisplay(obj.createNestedObject(F("display")));
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(ESP32)
|
#if defined(ESP32)
|
||||||
getzeroExport(obj.createNestedObject(F("zeroExport")));
|
getzeroExport(obj.createNestedObject(F("zeroExport")));
|
||||||
|
|
|
@ -37,7 +37,9 @@
|
||||||
#include "html/h/visualization_html.h"
|
#include "html/h/visualization_html.h"
|
||||||
#include "html/h/about_html.h"
|
#include "html/h/about_html.h"
|
||||||
#include "html/h/wizard_html.h"
|
#include "html/h/wizard_html.h"
|
||||||
#include "html/h/history_html.h"
|
#if defined(ENABLE_HISTORY)
|
||||||
|
#include "html/h/history_html.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#define WEB_SERIAL_BUF_SIZE 2048
|
#define WEB_SERIAL_BUF_SIZE 2048
|
||||||
|
|
||||||
|
@ -77,8 +79,9 @@ class Web {
|
||||||
mWeb.on("/save", HTTP_POST, std::bind(&Web::showSave, this, std::placeholders::_1));
|
mWeb.on("/save", HTTP_POST, std::bind(&Web::showSave, this, std::placeholders::_1));
|
||||||
|
|
||||||
mWeb.on("/live", HTTP_ANY, std::bind(&Web::onLive, this, std::placeholders::_1));
|
mWeb.on("/live", HTTP_ANY, std::bind(&Web::onLive, this, std::placeholders::_1));
|
||||||
|
#if defined(ENABLE_HISTORY)
|
||||||
mWeb.on("/history", HTTP_ANY, std::bind(&Web::onHistory, this, std::placeholders::_1));
|
mWeb.on("/history", HTTP_ANY, std::bind(&Web::onHistory, this, std::placeholders::_1));
|
||||||
|
#endif
|
||||||
#ifdef ENABLE_PROMETHEUS_EP
|
#ifdef ENABLE_PROMETHEUS_EP
|
||||||
mWeb.on("/metrics", HTTP_ANY, std::bind(&Web::showMetrics, this, std::placeholders::_1));
|
mWeb.on("/metrics", HTTP_ANY, std::bind(&Web::showMetrics, this, std::placeholders::_1));
|
||||||
#endif
|
#endif
|
||||||
|
@ -588,6 +591,7 @@ class Web {
|
||||||
mConfig->serial.log2mqtt = (request->arg("log2mqtt") == "on");
|
mConfig->serial.log2mqtt = (request->arg("log2mqtt") == "on");
|
||||||
|
|
||||||
// display
|
// display
|
||||||
|
#if defined(PLUGIN_DISPLAY)
|
||||||
mConfig->plugin.display.pwrSaveAtIvOffline = (request->arg("disp_pwr") == "on");
|
mConfig->plugin.display.pwrSaveAtIvOffline = (request->arg("disp_pwr") == "on");
|
||||||
mConfig->plugin.display.graph_size = request->arg("disp_graph_size").toInt();
|
mConfig->plugin.display.graph_size = request->arg("disp_graph_size").toInt();
|
||||||
mConfig->plugin.display.rot = request->arg("disp_rot").toInt();
|
mConfig->plugin.display.rot = request->arg("disp_rot").toInt();
|
||||||
|
@ -614,7 +618,7 @@ class Web {
|
||||||
mConfig->plugin.display.disp_reset = (mConfig->plugin.display.type != DISP_TYPE_T10_EPAPER) ? DEF_PIN_OFF : request->arg("disp_rst").toInt();
|
mConfig->plugin.display.disp_reset = (mConfig->plugin.display.type != DISP_TYPE_T10_EPAPER) ? DEF_PIN_OFF : request->arg("disp_rst").toInt();
|
||||||
mConfig->plugin.display.disp_busy = (mConfig->plugin.display.type != DISP_TYPE_T10_EPAPER) ? DEF_PIN_OFF : request->arg("disp_bsy").toInt();
|
mConfig->plugin.display.disp_busy = (mConfig->plugin.display.type != DISP_TYPE_T10_EPAPER) ? DEF_PIN_OFF : request->arg("disp_bsy").toInt();
|
||||||
mConfig->plugin.display.pirPin = (mConfig->plugin.display.screenSaver != DISP_TYPE_T2_SH1106_128X64) ? DEF_PIN_OFF : request->arg("pir_pin").toInt(); // pir pin only for motion screensaver
|
mConfig->plugin.display.pirPin = (mConfig->plugin.display.screenSaver != DISP_TYPE_T2_SH1106_128X64) ? DEF_PIN_OFF : request->arg("pir_pin").toInt(); // pir pin only for motion screensaver
|
||||||
// otherweise default value
|
#endif // otherweise default value
|
||||||
|
|
||||||
mApp->saveSettings((request->arg("reboot") == "on"));
|
mApp->saveSettings((request->arg("reboot") == "on"));
|
||||||
|
|
||||||
|
@ -627,9 +631,11 @@ class Web {
|
||||||
getPage(request, PROT_MASK_LIVE, visualization_html, visualization_html_len);
|
getPage(request, PROT_MASK_LIVE, visualization_html, visualization_html_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(ENABLE_HISTORY)
|
||||||
void onHistory(AsyncWebServerRequest *request) {
|
void onHistory(AsyncWebServerRequest *request) {
|
||||||
getPage(request, PROT_MASK_HISTORY, history_html, history_html_len);
|
getPage(request, PROT_MASK_HISTORY, history_html, history_html_len);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void onAbout(AsyncWebServerRequest *request) {
|
void onAbout(AsyncWebServerRequest *request) {
|
||||||
AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html; charset=UTF-8"), about_html, about_html_len);
|
AsyncWebServerResponse *response = request->beginResponse_P(200, F("text/html; charset=UTF-8"), about_html, about_html_len);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue