Browse Source

* added free heap, mentioned in #24 (added in serial print, status on index and mqtt)

* fixed #45, AC current by factor 10 too high
* fixed failed payload counter
pull/50/head
lumapu 3 years ago
parent
commit
99f829ac87
  1. 12
      tools/esp8266/app.cpp
  2. 2
      tools/esp8266/defines.h
  3. 2
      tools/esp8266/hmDefines.h

12
tools/esp8266/app.cpp

@ -194,6 +194,8 @@ void app::loop(void) {
}
}
}
snprintf(val, 10, "%d", ESP.getFreeHeap());
mMqtt.sendMsg("free_heap", val);
}
}
@ -220,6 +222,9 @@ void app::loop(void) {
if(++mSendTicker >= mSendInterval) {
mSendTicker = 0;
if(mSerialDebug)
DPRINTLN("Free heap: 0x" + String(ESP.getFreeHeap(), HEX));
if(!mSys->BufCtrl.empty()) {
if(mSerialDebug)
DPRINTLN("recbuf not empty! #" + String(mSys->BufCtrl.getFill()));
@ -231,16 +236,17 @@ void app::loop(void) {
// reset payload data
memset(mPayload[iv->id].len, 0, MAX_PAYLOAD_ENTRIES);
mPayload[iv->id].maxPackId = 0;
if(mSerialDebug) {
if(!mPayload[iv->id].complete)
processPayload(false);
if(!mPayload[iv->id].complete) {
mRxFailed++;
if(mSerialDebug) {
DPRINT("Inverter #" + String(iv->id) + " ");
DPRINTLN("no Payload received!");
mRxFailed++;
}
}
mPayload[iv->id].complete = false;
mPayload[iv->id].ts = mTimestamp;
@ -482,6 +488,8 @@ void app::showStatistics(void) {
String content = "Failed Payload: " + String(mRxFailed) + "\n";
content += "Send Cnt: " + String(mSys->Radio.mSendCnt) + String("\n\n");
content += "Free Heap: 0x" + String(ESP.getFreeHeap(), HEX) + "\n";
if(!mSys->Radio.isChipConnected())
content += "WARNING! your NRF24 module can't be reached, check the wiring and pinout (<a href=\"/setup\">setup</a>)\n";

2
tools/esp8266/defines.h

@ -16,7 +16,7 @@
//-------------------------------------
#define VERSION_MAJOR 0
#define VERSION_MINOR 4
#define VERSION_PATCH 3
#define VERSION_PATCH 4
//-------------------------------------

2
tools/esp8266/hmDefines.h

@ -85,7 +85,7 @@ const byteAssign_t hm2chAssignment[] = {
{ FLD_YT, UNIT_KWH, CH2, 18, 4, 1000 },
{ FLD_UAC, UNIT_V, CH0, 26, 2, 10 },
{ FLD_IAC, UNIT_A, CH0, 34, 2, 10 },
{ FLD_IAC, UNIT_A, CH0, 34, 2, 100 },
{ FLD_PAC, UNIT_W, CH0, 30, 2, 10 },
{ FLD_F, UNIT_HZ, CH0, 28, 2, 100 },
{ FLD_T, UNIT_C, CH0, 38, 2, 10 },

Loading…
Cancel
Save