mirror of
https://github.com/lumapu/ahoy.git
synced 2025-05-11 07:56:39 +02:00
0.8.72
* fixed translation #1403 * fixed sending commands to inverters which are soft turned off #1397 * reduce switchChannel command for HMS (only each 5th cycle it will be send now)
This commit is contained in:
parent
883aefbe64
commit
14c5a7ad32
6 changed files with 28 additions and 14 deletions
|
@ -1,5 +1,10 @@
|
||||||
# Development Changes
|
# Development Changes
|
||||||
|
|
||||||
|
## 0.8.72 - 2024-02-03
|
||||||
|
* fixed translation #1403
|
||||||
|
* fixed sending commands to inverters which are soft turned off #1397
|
||||||
|
* reduce switchChannel command for HMS (only each 5th cycle it will be send now)
|
||||||
|
|
||||||
## 0.8.71 - 2024-02-03
|
## 0.8.71 - 2024-02-03
|
||||||
* fix heuristics reset
|
* fix heuristics reset
|
||||||
* fix CMT missing frames problem
|
* fix CMT missing frames problem
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
#define VERSION_MAJOR 0
|
#define VERSION_MAJOR 0
|
||||||
#define VERSION_MINOR 8
|
#define VERSION_MINOR 8
|
||||||
#define VERSION_PATCH 71
|
#define VERSION_PATCH 72
|
||||||
|
|
||||||
//-------------------------------------
|
//-------------------------------------
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -152,7 +152,6 @@ class Inverter {
|
||||||
|
|
||||||
static uint32_t *timestamp; // system timestamp
|
static uint32_t *timestamp; // system timestamp
|
||||||
static cfgInst_t *generalConfig; // general inverter configuration from setup
|
static cfgInst_t *generalConfig; // general inverter configuration from setup
|
||||||
//static IApp *app; // pointer to app interface
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -290,18 +289,18 @@ class Inverter {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool setDevControlRequest(uint8_t cmd) {
|
bool setDevControlRequest(uint8_t cmd) {
|
||||||
if(InverterStatus::PRODUCING == status) {
|
if(InverterStatus::OFF != status) {
|
||||||
mDevControlRequest = true;
|
mDevControlRequest = true;
|
||||||
devControlCmd = cmd;
|
devControlCmd = cmd;
|
||||||
//app->triggerTickSend(); // done in RestApi.h, because of "chicken-and-egg problem ;-)"
|
//app->triggerTickSend(); // done in RestApi.h, because of "chicken-and-egg problem ;-)"
|
||||||
}
|
}
|
||||||
return (InverterStatus::PRODUCING == status);
|
return (InverterStatus::OFF != status);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool setDevCommand(uint8_t cmd) {
|
bool setDevCommand(uint8_t cmd) {
|
||||||
if(InverterStatus::PRODUCING == status)
|
if(InverterStatus::OFF != status)
|
||||||
devControlCmd = cmd;
|
devControlCmd = cmd;
|
||||||
return (InverterStatus::PRODUCING == status);
|
return (InverterStatus::OFF != status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void addValue(uint8_t pos, uint8_t buf[], record_t<> *rec) {
|
void addValue(uint8_t pos, uint8_t buf[], record_t<> *rec) {
|
||||||
|
|
|
@ -9,6 +9,8 @@
|
||||||
#include "cmt2300a.h"
|
#include "cmt2300a.h"
|
||||||
#include "../hm/radio.h"
|
#include "../hm/radio.h"
|
||||||
|
|
||||||
|
#define CMT_SWITCH_CHANNEL_CYCLE 5
|
||||||
|
|
||||||
template<uint32_t DTU_SN = 0x81001765>
|
template<uint32_t DTU_SN = 0x81001765>
|
||||||
class CmtRadio : public Radio {
|
class CmtRadio : public Radio {
|
||||||
typedef Cmt2300a CmtType;
|
typedef Cmt2300a CmtType;
|
||||||
|
@ -151,6 +153,10 @@ class CmtRadio : public Radio {
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void sendSwitchChCmd(Inverter<> *iv, uint8_t ch) {
|
inline void sendSwitchChCmd(Inverter<> *iv, uint8_t ch) {
|
||||||
|
if(CMT_SWITCH_CHANNEL_CYCLE > ++mSwitchCycle)
|
||||||
|
return;
|
||||||
|
mSwitchCycle = 0;
|
||||||
|
|
||||||
/** ch:
|
/** ch:
|
||||||
* 0x00: 860.00 MHz
|
* 0x00: 860.00 MHz
|
||||||
* 0x01: 860.25 MHz
|
* 0x01: 860.25 MHz
|
||||||
|
@ -172,9 +178,10 @@ class CmtRadio : public Radio {
|
||||||
inline void getRx(void) {
|
inline void getRx(void) {
|
||||||
packet_t p;
|
packet_t p;
|
||||||
p.millis = millis() - mMillis;
|
p.millis = millis() - mMillis;
|
||||||
CmtStatus status = mCmt.getRx(p.packet, &p.len, 28, &p.rssi);
|
if(CmtStatus::SUCCESS == mCmt.getRx(p.packet, &p.len, 28, &p.rssi)) {
|
||||||
if(CmtStatus::SUCCESS == status)
|
mSwitchCycle = 0;
|
||||||
mBufCtrl.push(p);
|
mBufCtrl.push(p);
|
||||||
|
}
|
||||||
|
|
||||||
if(p.packet[9] > ALL_FRAMES) { // indicates last frame
|
if(p.packet[9] > ALL_FRAMES) { // indicates last frame
|
||||||
setExpectedFrames(p.packet[9] - ALL_FRAMES);
|
setExpectedFrames(p.packet[9] - ALL_FRAMES);
|
||||||
|
@ -188,6 +195,7 @@ class CmtRadio : public Radio {
|
||||||
bool mCmtAvail = false;
|
bool mCmtAvail = false;
|
||||||
bool mRqstGetRx = false;
|
bool mRqstGetRx = false;
|
||||||
uint32_t mMillis;
|
uint32_t mMillis;
|
||||||
|
uint8_t mSwitchCycle = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /*__HMS_RADIO_H__*/
|
#endif /*__HMS_RADIO_H__*/
|
||||||
|
|
|
@ -68,7 +68,7 @@ class RestApi {
|
||||||
DynamicJsonDocument json(128);
|
DynamicJsonDocument json(128);
|
||||||
JsonObject dummy = json.as<JsonObject>();
|
JsonObject dummy = json.as<JsonObject>();
|
||||||
if(obj[F("path")] == "ctrl")
|
if(obj[F("path")] == "ctrl")
|
||||||
setCtrl(obj, dummy, "api");
|
setCtrl(obj, dummy, "*");
|
||||||
else if(obj[F("path")] == "setup")
|
else if(obj[F("path")] == "setup")
|
||||||
setSetup(obj, dummy);
|
setSetup(obj, dummy);
|
||||||
}
|
}
|
||||||
|
@ -839,10 +839,12 @@ class RestApi {
|
||||||
}
|
}
|
||||||
jsonOut[F("id")] = jsonIn[F("id")];
|
jsonOut[F("id")] = jsonIn[F("id")];
|
||||||
|
|
||||||
if(strncmp("api", clientIP, 3) != 0) {
|
if(mConfig->sys.adminPwd[0] != '\0') {
|
||||||
if(mApp->isProtected(clientIP)) {
|
if(strncmp("*", clientIP, 1) != 0) { // no call from API (MqTT)
|
||||||
jsonOut[F("error")] = F(INV_IS_PROTECTED);
|
if(mApp->isProtected(clientIP)) {
|
||||||
return false;
|
jsonOut[F("error")] = F(INV_IS_PROTECTED);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -871,7 +871,7 @@
|
||||||
{
|
{
|
||||||
"token": "BTN_CLEAR",
|
"token": "BTN_CLEAR",
|
||||||
"en": "clear",
|
"en": "clear",
|
||||||
"de": "l&ouuml;schen"
|
"de": "löschen"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"token": "BTN_AUTOSCROLL",
|
"token": "BTN_AUTOSCROLL",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue