Apologies if this has been reported already. I couldn’t find anything when I searched the forums.
I’m finally bringing up my customized emonTx4 board, and while debugging, noticed that the latest firmware (1.5.7) does not correctly output the I and PF values when the “c1” command is issued over serial .
The conversion from physical to logical channel numbers uses values 1-6, instead of the ADC channels numbers (3,4,5,6,8,9) provided in setup.
i.e. I think the code starting at “EmonTxV4.ino:461” should read:
// to show voltage, current & power factor for calibration:
Serial.print(F(",I1:")); Serial.print(EmonLibCM_getIrms(EmonLibCM_getLogicalChannel(3)),3);
Serial.print(F(",I2:")); Serial.print(EmonLibCM_getIrms(EmonLibCM_getLogicalChannel(4)),3);
Serial.print(F(",I3:")); Serial.print(EmonLibCM_getIrms(EmonLibCM_getLogicalChannel(5)),3);
Serial.print(F(",I4:")); Serial.print(EmonLibCM_getIrms(EmonLibCM_getLogicalChannel(6)),3);
Serial.print(F(",I5:")); Serial.print(EmonLibCM_getIrms(EmonLibCM_getLogicalChannel(8)),3);
Serial.print(F(",I6:")); Serial.print(EmonLibCM_getIrms(EmonLibCM_getLogicalChannel(9)),3);
Serial.print(F(",pf1:")); Serial.print(EmonLibCM_getPF(EmonLibCM_getLogicalChannel(3)),4);
Serial.print(F(",pf2:")); Serial.print(EmonLibCM_getPF(EmonLibCM_getLogicalChannel(4)),4);
Serial.print(F(",pf3:")); Serial.print(EmonLibCM_getPF(EmonLibCM_getLogicalChannel(5)),4);
Serial.print(F(",pf4:")); Serial.print(EmonLibCM_getPF(EmonLibCM_getLogicalChannel(6)),4);
Serial.print(F(",pf5:")); Serial.print(EmonLibCM_getPF(EmonLibCM_getLogicalChannel(8)),4);
Serial.print(F(",pf6:")); Serial.println(EmonLibCM_getPF(EmonLibCM_getLogicalChannel(9)),4);
Also, there is no implementation for the ‘a<xx.x>’ command to set the assumed Vrms. It should probably either be removed from the help text, or implemented. Not a big deal as it was trivial to hack in locally, but I thought it worth mentioning in case someone wants to tweak the mainline code.