Browse Source

0.8.51

* fix translation #1346
* further improve sending active power control command faster #1332
* added history protection mask
pull/1356/head
lumapu 9 months ago
parent
commit
76fa30503d
  1. 45
      ahoy.code-workspace
  2. 1
      scripts/auto_firmware_version.py
  3. 5
      src/CHANGES.md
  4. 2
      src/app.cpp
  5. 4
      src/app.h
  6. 5
      src/appInterface.h
  7. 8
      src/config/settings.h
  8. 2
      src/defines.h
  9. 5
      src/hm/hmInverter.h
  10. 8
      src/hm/hmSystem.h
  11. 2
      src/utils/scheduler.h
  12. 3
      src/web/RestApi.h
  13. 2
      src/web/html/index.html
  14. 6
      src/web/html/setup.html
  15. 6
      src/web/lang.json

45
ahoy.code-workspace

@ -1,45 +0,0 @@
{
"folders": [
{
"path": "."
},
{
"path": "src"
}
],
"settings": {
"files.associations": {
"algorithm": "cpp",
"array": "cpp",
"chrono": "cpp",
"deque": "cpp",
"format": "cpp",
"forward_list": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
"iterator": "cpp",
"list": "cpp",
"memory": "cpp",
"queue": "cpp",
"random": "cpp",
"regex": "cpp",
"vector": "cpp",
"xhash": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xmemory": "cpp",
"xstring": "cpp",
"xtree": "cpp",
"xutility": "cpp",
"*.tcc": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"string_view": "cpp",
"sstream": "cpp",
"istream": "cpp",
"ostream": "cpp"
},
"editor.formatOnSave": false
}
}

1
scripts/auto_firmware_version.py

@ -22,6 +22,7 @@ def get_firmware_specifier_build_flag():
build_version = "g0000000"
build_flag = "-D AUTO_GIT_HASH=\\\"" + build_version[1:] + "\\\" "
build_flag += "-DENV_NAME=\\\"" + env["PIOENV"] + "\\\" ";
print ("Firmware Revision: " + build_version)
return (build_flag)

5
src/CHANGES.md

@ -1,5 +1,10 @@
# Development Changes
## 0.8.51 - 2024-01-10
* fix translation #1346
* further improve sending active power control command faster #1332
* added history protection mask
## 0.8.50 - 2024-01-09
* merge PR: added history charts to web #1336
* merge PR: small display changes #1339

2
src/app.cpp

@ -53,7 +53,7 @@ void app::setup() {
mCommunication.setup(&mTimestamp, &mConfig->serial.debug, &mConfig->serial.privacyLog, &mConfig->serial.printWholeTrace, &mConfig->inst.gapMs);
mCommunication.addPayloadListener(std::bind(&app::payloadEventListener, this, std::placeholders::_1, std::placeholders::_2));
mCommunication.addPowerLimitAckListener([this] (Inverter<> *iv) { mMqtt.setPowerLimitAck(iv); });
mSys.setup(&mTimestamp, &mConfig->inst);
mSys.setup(&mTimestamp, &mConfig->inst, this);
for (uint8_t i = 0; i < MAX_NUM_INVERTERS; i++) {
initInverter(i);
}

4
src/app.h

@ -307,6 +307,10 @@ class app : public IApp, public ah::Scheduler {
#endif /* defined(ETHERNET) */
void updateNtp(void);
void triggerTickSend() {
once(std::bind(&app::tickSend, this), 0, "tSend");
}
void tickCalcSunrise(void);
void tickIVCommunication(void);
void tickSun(void);

5
src/appInterface.h

@ -1,5 +1,5 @@
//-----------------------------------------------------------------------------
// 2022 Ahoy, https://ahoydtu.de
// 2024 Ahoy, https://ahoydtu.de
// Creative Commons - https://creativecommons.org/licenses/by-nc-sa/4.0/deed
//-----------------------------------------------------------------------------
@ -7,7 +7,6 @@
#define __IAPP_H__
#include "defines.h"
#include "hm/hmSystem.h"
#if defined(ETHERNET)
#include "AsyncWebServer_ESP32_W5500.h"
#else
@ -47,6 +46,8 @@ class IApp {
virtual void getSchedulerInfo(uint8_t *max) = 0;
virtual void getSchedulerNames() = 0;
virtual void triggerTickSend() = 0;
virtual bool getRebootRequestState() = 0;
virtual bool getSettingsValid() = 0;
virtual void setMqttDiscoveryFlag() = 0;

8
src/config/settings.h

@ -39,9 +39,9 @@
#define PROT_MASK_SETUP 0x0008
#define PROT_MASK_UPDATE 0x0010
#define PROT_MASK_SYSTEM 0x0020
#define PROT_MASK_API 0x0040
#define PROT_MASK_MQTT 0x0080
#define PROT_MASK_HISTORY 0x0100
#define PROT_MASK_HISTORY 0x0040
#define PROT_MASK_API 0x0080
#define PROT_MASK_MQTT 0x0100
#define DEF_PROT_INDEX 0x0001
#define DEF_PROT_LIVE 0x0000
@ -49,9 +49,9 @@
#define DEF_PROT_SETUP 0x0008
#define DEF_PROT_UPDATE 0x0010
#define DEF_PROT_SYSTEM 0x0020
#define DEF_PROT_HISTORY 0x0000
#define DEF_PROT_API 0x0000
#define DEF_PROT_MQTT 0x0000
#define DEF_PROT_HISTORY 0x0000
typedef struct {

2
src/defines.h

@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 8
#define VERSION_PATCH 50
#define VERSION_PATCH 51
//-------------------------------------
typedef struct {

5
src/hm/hmInverter.h

@ -1,5 +1,5 @@
//-----------------------------------------------------------------------------
// 2024 Ahoy, https://www.mikrocontroller.net/topic/525778
// 2024 Ahoy, https://ahoydtu.de
// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/4.0/deed
//-----------------------------------------------------------------------------
@ -14,6 +14,7 @@
#define MAX_GRID_LENGTH 150
#include "hmDefines.h"
#include "../appInterface.h"
#include "HeuristicInv.h"
#include "../hms/hmsDefines.h"
#include <memory>
@ -150,6 +151,7 @@ class Inverter {
static uint32_t *timestamp; // system timestamp
static cfgInst_t *generalConfig; // general inverter configuration from setup
static IApp *app; // pointer to app interface
public:
@ -286,6 +288,7 @@ class Inverter {
if(isConnected) {
mDevControlRequest = true;
devControlCmd = cmd;
app->triggerTickSend();
}
return isConnected;
}

8
src/hm/hmSystem.h

@ -1,11 +1,12 @@
//-----------------------------------------------------------------------------
// 2023 Ahoy, https://github.com/lumpapu/ahoy
// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
// 2024 Ahoy, https://ahoydtu.de
// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/4.0/deed
//-----------------------------------------------------------------------------
#ifndef __HM_SYSTEM_H__
#define __HM_SYSTEM_H__
#include "../appInterface.h"
#include "hmInverter.h"
#include <functional>
@ -14,9 +15,10 @@ class HmSystem {
public:
HmSystem() {}
void setup(uint32_t *timestamp, cfgInst_t *config) {
void setup(uint32_t *timestamp, cfgInst_t *config, IApp *app) {
mInverter[0].timestamp = timestamp;
mInverter[0].generalConfig = config;
mInverter[0].app = app;
}
void addInverter(uint8_t id, std::function<void(Inverter<> *iv)> cb) {

2
src/utils/scheduler.h

@ -121,7 +121,7 @@ namespace ah {
uint16_t mTsMillis;
private:
inline uint8_t addTicker(scdCb c, uint32_t timeout, uint32_t reload, bool isTimestamp, const char *name) {
uint8_t addTicker(scdCb c, uint32_t timeout, uint32_t reload, bool isTimestamp, const char *name) {
for (uint8_t i = 0; i < MAX_NUM_TICKER; i++) {
if (!mTickerInUse[i]) {
mTickerInUse[i] = true;

3
src/web/RestApi.h

@ -1,6 +1,6 @@
//-----------------------------------------------------------------------------
// 2024 Ahoy, https://ahoydtu.de
// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
// Creative Commons - https://creativecommons.org/licenses/by-nc-sa/4.0/deed
//-----------------------------------------------------------------------------
#ifndef __WEB_API_H__
@ -255,6 +255,7 @@ class RestApi {
obj[F("ts_now")] = mApp->getTimestamp();
obj[F("version")] = String(mApp->getVersion());
obj[F("build")] = String(AUTO_GIT_HASH);
obj[F("env")] = String(ENV_NAME);
obj[F("menu_prot")] = mApp->getProtection(request);
obj[F("menu_mask")] = (uint16_t)(mConfig->sys.protectionMask );
obj[F("menu_protEn")] = (bool) (strlen(mConfig->sys.adminPwd) > 0);

2
src/web/html/index.html

@ -26,7 +26,7 @@
<li>{#DISCUSS} <a href="https://discord.gg/WzhxEY62mB">Discord</a></li>
<li>{#REPORT} <a href="https://github.com/lumapu/ahoy/issues" target="_blank">{#ISSUES}</a></li>
<li>{#CONTRIBUTE} <a href="https://github.com/lumapu/ahoy/blob/main/User_Manual.md" target="_blank">{#DOCUMENTATION}</a></li>
<li><a href="https://nightly.link/lumapu/ahoy/workflows/compile_development/development03/ahoydtu_dev.zip" target="_blank">Download</a> & Test {#DEV_FIRMWARE}, <a href="https://github.com/lumapu/ahoy/blob/development03/src/CHANGES.md" target="_blank">{#DEV_CHANGELOG}</a></li>
<li><a href="https://fw.ahoydtu.de/dev/" target="_blank">Download</a> & Test {#DEV_FIRMWARE}, <a href="https://github.com/lumapu/ahoy/blob/development03/src/CHANGES.md" target="_blank">{#DEV_CHANGELOG}</a></li>
<li>{#DON_MAKE} <a href="https://paypal.me/lupusch" target="_blank">{#DONATION}</a></li>
</ul>
</div>

6
src/web/html/setup.html

@ -254,7 +254,7 @@
<div class="col-12 col-sm-9"><input type="text" name="mqttUser"/></div>
</div>
<div class="row mb-3">
<div class="col-12 col-sm-3 my-2">{MQTT_PASSWORD}</div>
<div class="col-12 col-sm-3 my-2">{#MQTT_PASSWORD}</div>
<div class="col-12 col-sm-9"><input type="password" name="mqttPwd"/></div>
</div>
<div class="row mb-3">
@ -630,9 +630,9 @@
if(!obj["pwd_set"])
e.value = "";
var d = document.getElementById("prot_mask");
var a = ["Index", "{#NAV_LIVE}", "{#NAV_WEBSERIAL}", "{#NAV_SETTINGS}", "Update", "System"];
var a = ["Index", "{#NAV_LIVE}", "{#NAV_WEBSERIAL}", "{#NAV_SETTINGS}", "Update", "System", "{#NAV_HISTORY}"];
var el = [];
for(var i = 0; i < 6; i++) {
for(var i = 0; i < 7; i++) {
var chk = ((obj["prot_mask"] & (1 << i)) == (1 << i));
el.push(mlCb("protMask" + i, a[i], chk))
}

6
src/web/lang.json

@ -136,7 +136,7 @@
{
"token": "REBOOT_AT_MIDNIGHT",
"en": "Reboot Ahoy at midnight",
"de": "um Mitternacht neu starten"
"de": "mitternachts neu starten"
},
{
"token": "DARK_MODE",
@ -291,7 +291,7 @@
{
"token": "INV_RESET_MAX_MIDNIGHT",
"en": "Reset 'max' values at midnight",
"de": "Maximalwerte bei Sonnenuntergang zur&uuml;cksetzen"
"de": "Maximalwerte mitternachts zur&uuml;cksetzen"
},
{
"token": "INV_START_WITHOUT_TIME",
@ -1096,7 +1096,7 @@
{
"token": "APC",
"en": "APC",
"de": "Begr."
"de": "Limit"
},
{
"token": "ALARMS",

Loading…
Cancel
Save