emonTX CT channel stopped reporting after reboot

My serially connected emonTX seems to have given up reading energy on CT1

The PiZ had stopped for some reason (no web or SSH access), though it looks like the data was still flowing, so I pulled the DC plug on the TX (as the Pi is powered via the TX UART).

On reboot no power readings from the emonTX. Tried to reboot a second time this time removing the AC as well and still no readings - I do get messages though.

[email protected]:~ $ miniterm --rtscts /dev/ttyAMA0 115200
--- Miniterm on /dev/ttyAMA0  115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
emonTx V3.4 EmonLibCM Continuous Monitoring V1.70
OpenEnergyMonitor.org
Loaded EEPROM config
Settings:
Group 210, Node 15, Band 433 MHz

Calibration:
vCal = 268.97
i1Cal = 90.90
i1Lead = 4.20
i2Cal = 90.90
i2Lead = 4.20
i3Cal = 90.90
i3Lead = 4.20
i4Cal = 16.67
i4Lead = 6.00
datalog = 10.01
pulses = 1
pulse period = 100
temp_enable = 1
Temperature Sensors found = 0 of 1
Temperature measurement is NOT enabled.

RF off
POST.....wait 10s
'+++' then [Enter] for config mode
CT1 detected, i1Cal:90.90
AC present
MSG:1,Vrms:247.33,P1:0,E1:0,pulse:1
MSG:2,Vrms:247.25,P1:0,E1:0,pulse:1
MSG:3,Vrms:247.19,P1:0,E1:0,pulse:1
MSG:4,Vrms:247.27,P1:0,E1:0,pulse:1
MSG:5,Vrms:247.30,P1:0,E1:0,pulse:1

--- exit ---

I then wondered if the CT channel had given up so powered down and switched to CT2.

[email protected]:~ $ miniterm --rtscts /dev/ttyAMA0 115200
--- Miniterm on /dev/ttyAMA0  115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
emonTx V3.4 EmonLibCM Continuous Monitoring V1.70
OpenEnergyMonitor.org
Loaded EEPROM config
Settings:
Group 210, Node 15, Band 433 MHz

Calibration:
vCal = 268.97
i1Cal = 90.90
i1Lead = 4.20
i2Cal = 90.90
i2Lead = 4.20
i3Cal = 90.90
i3Lead = 4.20
i4Cal = 16.67
i4Lead = 6.00
datalog = 10.01
pulses = 1
pulse period = 100
temp_enable = 1
Temperature Sensors found = 0 of 1
Temperature measurement is NOT enabled.

RF off
POST.....wait 10s
'+++' then [Enter] for config mode
CT2 detected, i2Cal:90.90
AC present
MSG:1,Vrms:247.25,P2:417,E2:1,pulse:1
MSG:2,Vrms:247.29,P2:416,E2:2,pulse:1

and there we have it - data again.

I then though ‘I wonder if CT1 will now work’ - go back to CT1 and I have data again on that channel. Weird.

Any suggestions @Robert.Wall @TrystanLea as to why? Nothing in the logs. Could the hard power down cause the Channel to do this?

Why would unplugging the CT and plugging it back in make it work?

Nope - not at the moment.
Let’s be clear what you did:
Removed the 5 V d.c. from the emonTx, with the 9 V a.c. still connected. Is the link in place or not? Was there power coming in via the FTDI connector?
Restarted the emonTx - or did you just put the d.c back on, or did you press reset?
Removed both the 5 V d.c. and the 9 V a.c. from the emonTx, with or without power coming in via the FTDI connector?

The sketch on Github does (or used to - I’m not sure where it’s at, at the moment) try to do some switching to make emonLibCM behave more like the old emonLib(DS) did - but sensing for the grounded inputs is done per sample inside emonLibCM anyway. I’ll look later.

Energy readings stopped for me too some days ago - I’d allowed minicom to send a null reporting period and despite restoring it, both energy channels (this the emonPi) stuck and didn’t increment. That’s on my list for when I take the emonPi apart so that I can work on it easily. It might be the same fault.

Yes

No

No as I use that as an output to the Pi.

Just attached DC

Yes, power never comes in via FTDI - the Pi takes power from there.

OK, thanks. The emonTx should have reset with no power available at all.
One more thought: Was power off long enough for any smoothing capacitor in the Pi to have discharged, or could it have back-fed the emonTx for long enough for it to keep going?

No idea, but TBH I did not disconnect for long - this is a PiZeroW.

I’ve loaded the file from Github, and I haven’t yet succeeded in getting the energy values to start from anything other than zero - even when I switched of the Variac (giving me 100 A test current) and the splash of interference caused the emonTx to restart.

They values aren’t explicitly zeroed in the sketch, but if my memory serves, all locations are zeroed by either the bootloader or the processor itself on power-up.

That wasn’t the issue - on reboot the returned Energy values were all zero as if it was not able to read the energy.

See log copied from above.

It doesn’t appear to be the emonTx or the sketch that’s not restarting. Mine restarted normally each time. I was using an emonGLCD to monitor what was actually transmitted by radio.

Did the Pi send anything back to the emonTx on the serial link? Because if the current calibration gets reset to zero, that would give zero power, zero energy but the voltage would still read. I’m not saying that’s what it is, but if that has happened, it would give the same symptoms.

They symptom was that on restart it did not read any energy (when there was). The sketch itself restarted reading Vrms, just no energy.

Nope.

Put it down to an oddity, but if it comes up again ask the user to unplug and plug the CT back in might solve it.