Skip to content

Commit

Permalink
Fix negative values (injection) being discarded as spurious reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Epyon01P committed Apr 1, 2024
1 parent c75a693 commit c94a833
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion P1-dongle.ino
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#define HWSERIAL Serial1
#define TRIGGER 25 //Pin to trigger meter telegram request

unsigned int fw_ver = 222;
unsigned int fw_ver = 223;

//General global vars
Preferences preferences;
Expand Down
Binary file modified P1-dongle.ino.m5stack_atom.bin
Binary file not shown.
12 changes: 6 additions & 6 deletions dsmrTelegram.ino
Original file line number Diff line number Diff line change
Expand Up @@ -239,26 +239,26 @@ void processMeterTelegram(String rawTelegram, String rawCRC){
float tempFloat = 0.0;
if(totConT1Found && totConT2Found){
tempFloat = totConT1 + totConT2;
if(checkFloat("A-0:0.0.1", "energy", tempFloat)){
//if(checkFloat("A-0:0.0.1", "energy", tempFloat)){
totCon = tempFloat;
totConFound = true;
}
//}
}
tempFloat = 0.0;
if(totInT1Found && totInT2Found){
tempFloat = totInT1 + totInT2;
if(checkFloat("A-0:0.0.2", "energy", tempFloat)){
//if(checkFloat("A-0:0.0.2", "energy", tempFloat)){
totIn = tempFloat;
totInFound = true;
}
//}
}
tempFloat = 0.0;
if(powConFound && powInFound){
tempFloat = powCon - powIn;
if(checkFloat("A-0:0.0.3", "power", tempFloat)){
//if(checkFloat("A-0:0.0.3", "power", tempFloat)){
netPowCon = tempFloat;
netPowConFound = true;
}
//}
}
spurCount = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
222
223

0 comments on commit c94a833

Please sign in to comment.