I get similar results
LoRaStarting
EMON Starting
1023
24721.80 107.49
Voltage: 328 Volts
29FC
0148
Packet queued
152182: EV_TXCOMPLETE (includes waiting for RX windows)
516
6161.23 26.79
Voltage: 328 Volts
0A76
0148
Packet queued
929642: EV_TXCOMPLETE (includes waiting for RX windows)
516
2649.04 11.52
Voltage: 328 Volts
047F
0148
Packet queued
1707505: EV_TXCOMPLETE (includes waiting for RX windows)
515
2344.39 10.19
Voltage: 328 Volts
03FB
0148
Packet queued
2485489: EV_TXCOMPLETE (includes waiting for RX windows)
516
2333.93 10.15
Voltage: 328 Volts
03F6
0148
Packet queued
This is after I set this
case EV_TXCOMPLETE:
Serial.println(F("EV_TXCOMPLETE (includes waiting for RX windows)"));
if (LMIC.txrxFlags & TXRX_ACK)
Serial.println(F("Received ack"));
if (LMIC.dataLen) {
Serial.println(F("Received "));
Serial.println(LMIC.dataLen);
Serial.println(F(" bytes of payload"));
}
//for (int i=0; i<int(TX_INTERVAL/2); i++) {
// LowPower.powerDown(SLEEP_2S, ADC_OFF, BOD_OFF);
//}
//do_send(&sendjob);
//break;
// Schedule next transmission
os_setTimedCallback(&sendjob, os_getTime()+sec2osticks(TX_INTERVAL), do_send);
break;
case EV_LOST_TSYNC:
With the “control” program, I get the correct value even with the sleep commented
> > #include "EmonLib.h"
> > #include <LowPower.h>
> > EnergyMonitor emon1;
> > // Create an instance
> > void setup()
> > {
> > while ((!Serial) && (millis() < 10000)){ }
> > Serial.begin(9600);
> >
> > emon1.current(5, 115.1); // Current: input pin, calibration.
> > }
> >
> > void loop()
> > {
> > double et = emon();
> > int16_t e = et * 100;
> > Serial.print(et*230.0); // Apparent power
> > Serial.print(" ");
> > Serial.println(et); // Irms
> > Serial.flush();
> > //LowPower.powerDown(SLEEP_2S, ADC_OFF, BOD_OFF);
> > }
> >
> > double emon() {
> > int sensorValue = analogRead(A5);
> > Serial.println(sensorValue);
> > double e = emon1.calcIrms(1480); // Calculate Irms only
> > return e;
> > }
512
51.54 0.22
513
38.39 0.17
513
36.18 0.16
512
34.78 0.15
513
34.62 0.15
512
35.29 0.15
513
35.25 0.15
513
35.00 0.15
512
35.29 0.15
512
34.62 0.15
512
34.78 0.15
512
34.31 0.15
512
35.26 0.15
513
33.59 0.15
513
35.64 0.15
512
35.50 0.15