Skip to content

Commit

Permalink
0.7.28
Browse files Browse the repository at this point in the history
* fix MI inverter support #1078
  • Loading branch information
lumapu committed Aug 8, 2023
1 parent 6156145 commit c59d26d
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 42 deletions.
2 changes: 1 addition & 1 deletion scripts/getVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def readVersion(path, infile):
dst = path + "firmware/" + versionout
os.rename(src, dst)

versionout = version[:-1] + "_" + sha + "esp32_ethernet.bin"
versionout = version[:-1] + "_" + sha + "_esp32_ethernet.bin"
src = path + ".pio/build/esp32-wroom32-ethernet-release/firmware.bin"
dst = path + "firmware/" + versionout
os.rename(src, dst)
Expand Down
3 changes: 3 additions & 0 deletions src/CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Development Changes

## 0.7.28 - 2023-08-08
* fix MI inverter support #1078

## 0.7.27 - 2023-08-08
* added compile option for ethernet #886
* fix ePaper configuration, missing `Busy`-Pin #1075
Expand Down
78 changes: 39 additions & 39 deletions src/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,38 +47,38 @@ void app::setup() {
}
#endif
#ifdef ETHERNET
delay(1000);
DPRINT(DBG_INFO, F("mEth setup..."));
DSERIAL.flush();
mEth.setup(mConfig, &mTimestamp, [this](bool gotIp) { this->onNetwork(gotIp); }, [this](bool gotTime) { this->onNtpUpdate(gotTime); });
DBGPRINTLN(F("done..."));
DSERIAL.flush();
delay(1000);
DPRINT(DBG_INFO, F("mEth setup..."));
DSERIAL.flush();
mEth.setup(mConfig, &mTimestamp, [this](bool gotIp) { this->onNetwork(gotIp); }, [this](bool gotTime) { this->onNtpUpdate(gotTime); });
DBGPRINTLN(F("done..."));
DSERIAL.flush();
#endif // ETHERNET

#if !defined(ETHERNET)
#if defined(AP_ONLY)
mInnerLoopCb = std::bind(&app::loopStandard, this);
#else
mInnerLoopCb = std::bind(&app::loopWifi, this);
#endif
#if defined(AP_ONLY)
mInnerLoopCb = std::bind(&app::loopStandard, this);
#else
mInnerLoopCb = std::bind(&app::loopWifi, this);
#endif
#endif /* !defined(ETHERNET) */

#if !defined(ETHERNET)
mWifi.setup(mConfig, &mTimestamp, std::bind(&app::onNetwork, this, std::placeholders::_1));
#if !defined(AP_ONLY)
everySec(std::bind(&ahoywifi::tickWifiLoop, &mWifi), "wifiL");
#endif
#endif /* defined(ETHERNET) */
#if !defined(ETHERNET)
mWifi.setup(mConfig, &mTimestamp, std::bind(&app::onNetwork, this, std::placeholders::_1));
#if !defined(AP_ONLY)
everySec(std::bind(&ahoywifi::tickWifiLoop, &mWifi), "wifiL");
#endif
#endif /* defined(ETHERNET) */

mSys.setup(&mTimestamp);
mSys.addInverters(&mConfig->inst);
if(mConfig->nrf.enabled) {
if (mConfig->nrf.enabled) {
mPayload.setup(this, &mSys, &mNrfRadio, &mStat, mConfig->nrf.maxRetransPerPyld, &mTimestamp);
mPayload.enableSerialDebug(mConfig->serial.debug);
mPayload.enableSerialDebug(mConfig->serial.debug);
mPayload.addPayloadListener(std::bind(&app::payloadEventListener, this, std::placeholders::_1, std::placeholders::_2));

mMiPayload.setup(this, &mSys, &mNrfRadio, &mStat, mConfig->nrf.maxRetransPerPyld, &mTimestamp);
mMiPayload.enableSerialDebug(mConfig->serial.debug);
mMiPayload.enableSerialDebug(mConfig->serial.debug);
mMiPayload.addPayloadListener(std::bind(&app::payloadEventListener, this, std::placeholders::_1, std::placeholders::_2));
}

Expand All @@ -90,7 +90,7 @@ void app::setup() {

if(mConfig->nrf.enabled) {
if (!mNrfRadio.isChipConnected())
DPRINTLN(DBG_WARN, F("WARNING! your NRF24 module can't be reached, check the wiring"));
DPRINTLN(DBG_WARN, F("WARNING! your NRF24 module can't be reached, check the wiring"));
}

// when WiFi is in client mode, then enable mqtt broker
Expand Down Expand Up @@ -228,12 +228,12 @@ void app::onNetwork(bool gotIp) {
#endif /* !defined(ETHERNET) */
mInnerLoopCb = [this]() { this->loopStandard(); };
} else {
#if defined(ETHERNET)
mInnerLoopCb = nullptr;
#else /* defined(ETHERNET) */
mInnerLoopCb = [this]() { this->loopWifi(); };
everySec(std::bind(&ahoywifi::tickWifiLoop, &mWifi), "wifiL");
#endif /* defined(ETHERNET) */
#if defined(ETHERNET)
mInnerLoopCb = nullptr;
#else /* defined(ETHERNET) */
mInnerLoopCb = [this]() { this->loopWifi(); };
everySec(std::bind(&ahoywifi::tickWifiLoop, &mWifi), "wifiL");
#endif /* defined(ETHERNET) */
}
}

Expand Down Expand Up @@ -370,14 +370,14 @@ void app::tickComm(void) {
//-----------------------------------------------------------------------------
void app::tickZeroValues(void) {
zeroIvValues(!CHECK_AVAIL, SKIP_YIELD_DAY);
}
}

//-----------------------------------------------------------------------------
void app::tickMinute(void) {
// only triggered if 'reset values on no avail is enabled'

zeroIvValues(CHECK_AVAIL, SKIP_YIELD_DAY);
}
}

//-----------------------------------------------------------------------------
void app::tickMidnight(void) {
Expand All @@ -396,9 +396,9 @@ void app::tickMidnight(void) {
void app::tickSend(void) {
if(mConfig->nrf.enabled) {
if(!mNrfRadio.isChipConnected()) {
DPRINTLN(DBG_WARN, F("NRF24 not connected!"));
return;
}
DPRINTLN(DBG_WARN, F("NRF24 not connected!"));
return;
}
}
if (mIVCommunicationOn) {
if (!mNrfRadio.mBufCtrl.empty()) {
Expand Down Expand Up @@ -428,15 +428,15 @@ void app::tickSend(void) {
if(mConfig->nrf.enabled) {
if (iv->ivGen == IV_HM)
mPayload.ivSend(iv);
else if(iv->ivGen == IV_MI)
else if(iv->ivGen == IV_MI)
mMiPayload.ivSend(iv);
}
#if defined(ESP32)
if(mConfig->cmt.enabled) {
if((iv->ivGen == IV_HMS) || (iv->ivGen == IV_HMT))
mHmsPayload.ivSend(iv);
}
#endif
#if defined(ESP32)
if(mConfig->cmt.enabled) {
if((iv->ivGen == IV_HMS) || (iv->ivGen == IV_HMT))
mHmsPayload.ivSend(iv);
}
#endif
}
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/defines.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 7
#define VERSION_PATCH 27
#define VERSION_PATCH 28

//-------------------------------------
typedef struct {
Expand Down
2 changes: 1 addition & 1 deletion src/hm/hmRadio.h
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ class HmRadio {
DHEX(mid);
DBGPRINT(F(" pid: "));
DBGHEXLN(pid);
}
}
memset(mTxBuf, 0, MAX_RF_PAYLOAD_SIZE);
mTxBuf[0] = mid; // message id
CP_U32_BigEndian(&mTxBuf[1], (invId >> 8));
Expand Down
1 change: 1 addition & 0 deletions src/hm/miPayload.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class MiPayload {
void setup(IApp *app, HMSYSTEM *sys, HMRADIO *radio, statistics_t *stat, uint8_t maxRetransmits, uint32_t *timestamp) {
mApp = app;
mSys = sys;
mRadio = radio;
mStat = stat;
mMaxRetrans = maxRetransmits;
mTimestamp = timestamp;
Expand Down

0 comments on commit c59d26d

Please sign in to comment.