Debugging new EmomTX5 setup

I’m setting up a new EmonTX5 for use here in North America (split phase). I’ve hooked up a number of 20A and 50A sensors but am seeing almost nothing getting to my EmonCMS inputs or logged to feeds.

Below I have the stanza from my emonhub config and the bit from the log of what’s getting decoded. It looks to me that the packet values aren’t matching up with the values sent along. For instance, the values 247 and 255 don’t appear in the output at all. Some of these circuits have pretty substantial loads on them (minisplit, electric dryer, etc all running at the time of capture).

I’ve rebooted the EmonTX and my EmonCMS system repeatedly and don’t see any errors in the logs. Does this look correct to others? Any suggestions on debugging this?

    [[28]]
        nodename = emontx5_1
        [[[rx]]]
            names = MSG, Vrms1, Vrms2, Vrms3, P1, P2, P3, P4, P5, P6, E1, E2, E3, E4, E5, E6, pulse, Analog
            datacodes = L, h, h, h, h, h, h, h, h, h, l, l, l, l, l, l, L, H
            scales = 1.0, 0.01, 0.01, 0.01, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0
            units = n, V, V, V, W, W, W, W, W, W, Wh, Wh, Wh, Wh, Wh, Wh, p, n
2024-11-11 18:41:58,059 DEBUG    RFM2Pi     2981 NEW FRAME : OK 28 13 0 0 0 205 47 131 0 104 0 0 0 0 0 0 0 247 255 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (-48)
2024-11-11 18:41:58,063 DEBUG    RFM2Pi     2981 Timestamp : 1731350518.058636
2024-11-11 18:41:58,065 DEBUG    RFM2Pi     2981 From Node : 28
2024-11-11 18:41:58,067 DEBUG    RFM2Pi     2981    Values : [13, 122.37, 1.31, 1.04, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.0]
2024-11-11 18:41:58,067 DEBUG    RFM2Pi     2981      RSSI : -48
2024-11-11 18:41:58,068 DEBUG    RFM2Pi     2981 Sent to channel(start)' : ToEmonCMS
2024-11-11 18:41:58,069 DEBUG    RFM2Pi     2981 Sent to channel(end)' : ToEmonCMS
2024-11-11 18:41:58,128 DEBUG    MQTT       Publishing: emon/emontx5_1/MSG 13
2024-11-11 18:41:58,130 DEBUG    MQTT       Publishing: emon/emontx5_1/Vrms1 122.37
2024-11-11 18:41:58,132 DEBUG    MQTT       Publishing: emon/emontx5_1/Vrms2 1.31
2024-11-11 18:41:58,134 DEBUG    MQTT       Publishing: emon/emontx5_1/Vrms3 1.04
2024-11-11 18:41:58,136 DEBUG    MQTT       Publishing: emon/emontx5_1/P1 0
2024-11-11 18:41:58,138 DEBUG    MQTT       Publishing: emon/emontx5_1/P2 0
2024-11-11 18:41:58,140 DEBUG    MQTT       Publishing: emon/emontx5_1/P3 0
2024-11-11 18:41:58,141 DEBUG    MQTT       Publishing: emon/emontx5_1/P4 -9
2024-11-11 18:41:58,143 DEBUG    MQTT       Publishing: emon/emontx5_1/P5 0
2024-11-11 18:41:58,144 DEBUG    MQTT       Publishing: emon/emontx5_1/P6 0
2024-11-11 18:41:58,146 DEBUG    MQTT       Publishing: emon/emontx5_1/E1 0
2024-11-11 18:41:58,147 DEBUG    MQTT       Publishing: emon/emontx5_1/E2 0
2024-11-11 18:41:58,149 DEBUG    MQTT       Publishing: emon/emontx5_1/E3 0
2024-11-11 18:41:58,150 DEBUG    MQTT       Publishing: emon/emontx5_1/E4 0
2024-11-11 18:41:58,152 DEBUG    MQTT       Publishing: emon/emontx5_1/E5 0
2024-11-11 18:41:58,153 DEBUG    MQTT       Publishing: emon/emontx5_1/E6 0
2024-11-11 18:41:58,155 DEBUG    MQTT       Publishing: emon/emontx5_1/pulse 0
2024-11-11 18:41:58,156 DEBUG    MQTT       Publishing: emon/emontx5_1/Analog 0
2024-11-11 18:41:58,158 DEBUG    MQTT       Publishing: emon/emontx5_1/missed 0
2024-11-11 18:41:58,159 DEBUG    MQTT       Publishing: emon/emontx5_1/missedprc 0.0
2024-11-11 18:41:58,161 DEBUG    MQTT       Publishing: emon/emontx5_1/rssi -48

For a start, do you really only have the “A” leg (labelled ‘L1’) connected - because the “B” leg (which should be connected to ‘L2’) is showing almost zero volts (1.31 V).

So to which leg of your supply are those loads connected - if they’re all on the leg that’s reading no voltage, it’s hardly surprising no power is being measured.

It looks to me as it’s not proven that the problem is in emonCMS, I think you don’t have your emonTx5 or the emonVs or the c.t’s installed and set up correctly.

Things to check:

  1. You do have a 3-phase emonVs? If it’s a single phase, it doesn’t have the components for the second leg. (The correct 3-phase sketch is in the emonTx5, but if it’s not getting a second voltage sample from the emonVs, you won’t measure any power.)
  2. You are using the new 0.333 V output c.t’s? (I hate to think what might have happened to your emonTx if at any point you’ve used the old blue 50 mA ones and big loads.)
  3. You do have the c.t’s on a single wire (black or red) and not the pair (black+white or red+white) ?
  4. How is your emonTx5 set up - the default should be c.t’s 1, 3 & 5 on the ‘A’ leg and 2, 4 & 6 on the ‘B’ leg. Have you got a sensible (non-zero) value for the current rating for the c.t’s you’re using?

If I think of anything else, I’ll probably edit this post.

Oh yes they do – as “-9”.
Do you know how to decode the “NEW FRAME” line?
After ‘OK’ the first 4 numbers are ‘MSG’, datacode ‘L’, so 4 bytes unsigned, 13 + 0 × 256 + 0 × 256² + …
Next 2 numbers (‘h’) are Vrms1, decoded the same way, so 205 + 47 × 256 = 12237
and so on. ‘l’ is a signed 4 bytes so if it’s greater than 2^31, subtract 2^32. ‘h’ is 2 bytes signed calculated in the same way.

Thanks for the ideas, Robert! Apologies if it sounded like I was definitively blaming EmonCMS. I’m certainly open to something on the EmonTX/CT side.

Yes, this is a 3-phase emonVS, which is what the store supplies when you select North American split phase for the configuration. I have power connected to L1 (with neutral and ground connected, of course), with L2 and L3 empty. I understood this setup to use VRMS1 for reference across all CTs when in this configuration, though I’m not sure how NUM_V_CHANNELS is configured in the EmonTX sketch. I haven’t gotten the serial connection working yet and am assuming the firmware loaded by the shop is correct. :crossed_fingers:

Definitely. These are all new .333V CTs straight from the shop. Most are 20A CTs with two 50A CTs also in the mix.

Confirmed. Only a single wire for each CT.

I’m only partway through my setup. This is a 12CT device (using the 6CT expansion board, again pre-configured from the shop). I have CTs 2-6 and 8 connected with the remaining slots not yet connected. CTs 2 & 3 are each monitoring one leg of a 240V circuit (I’ll be using input doubling within EmonCMS to get close-enough numbers there).

The only circuit giving reasonable values is CT4. That’s giving me values around 40W, which matches the approximate load on that circuit, though that branch is on a different split than the EmonVS, as the feed values are negative. I’m using an input multiplier to convert that back to positive.

Apparently, I did not. :smile: Binary encodings always make me a bit cross-eyed. Your read is reassuring. At least I seem to have emonhub configured correctly!

Happy to try any other thoughts you may have!

So my guess - if Trystan has given you a custom USA sketch for 12 inputs - is odd numbered c.t’s are allocated to the ‘A’ leg and even numbers to the ‘B’ leg, therefore I’d expect to read almost nothing on all even numbered inputs. To prove the ‘B’ leg will read something, you can fit a temporary link between L1 and L2 - all 12 c.t’s should then have a voltage paired with them and you should see a power on every input when you plug a c.t. in (and you can live-plug them, it’s safe to do so and it should show in emonHub after 10 seconds or so).
If he hasn’t, then the default allocation for the c.t’s is 1 to L1, 2 to L2, 3 to L3, 4 to L1, 5 to L2, 6 to L3 etc. If you can edit, compile and upload a sketch, it’s easy enough to change this. If you can’t, you’re stuck because you cannot change the allocation via emonCMS.
Note c.t’s 6-12 come as Node 28.

Knowing CT4 gives a sensible number, plug that into each input in turn and see what emonHub says - you should see your 9 W or whatever on each channel provided you’ve linked L2 to L1.
(If you haven’t got a custom sketch, you’ll be missing CT3, 6, 9 & 12, and linking L3 too will make those show a value too.)

It’s 01:15 here now and I quit for today.

Sleeping on this, I’m feeling confident that this is a problem with only one VRMS reading getting applied by the EmonTX. The one working CT is on leg 1 (according to the 1-2-3 pattern), while the other CTs are on either leg 2 or 3. The EmonTX is showing only (floating?) voltage of a bit over 1V on the other two legs.

I’ll have to test this out after work today.

If this does wind up being the case, I could tie in L1 to L2 & L3 within the EmonVS or modify the EmonTX sketch to set NUM_V_CHANNELS to 1. While the software side seems cleaner to me than running physical patches, is there a preferred way of doing this?

What I’d do, bearing in mind I’ve been in the electrical engineering profession for over 50 years and working with industrial drives and controls, mostly 3-phase, for a lot of that, this is how I’d tackle your problem.
Also, remember I’ve told you what I assume or guess, all I know is what you’ve written here.

I suggest you test your emonTx5 to determine which inputs respond. The pattern should at least give a good hint as to what’s inside your sketch. After you’ve done that, you could easily wire in L2 and repeat, then L3 and repeat. You’ll then (hopefully) have an assurance that all the CT channels work physically and thereafter, everything is down to the sketch and how it’s been customised - or not.

Then, wire in L2 to the ‘B’ leg of your supply as you intended, and you’ll be in the position where you are reasonably certain that any software changes you need to make will work. We need to be careful because while I made sure the split-phase supply works in the library, the sketch only provides for single and 3-phase.

If you change to
#define NUM_V_CHANNELS 1
(assuming it is 3)
this will get all 12 c.t’s responding but it’ll give no clue as to what you had. Did they send you a source copy of your customised sketch? Maybe what you have now is unimportant and it’s going to be easiest to refer to the emonLibDB documentation and alter the default sketch to what you want?
You’ll probably end up doing this anyway, because of course, there’s no way to get back to the sketch from the compiled version that’s loaded into the AVR-DB front end processor.

Success! I had the 3-phase firmware loaded on the TX5. Replacing that with the 1 phase version and all my CTs (or at least those I’ve tested so far) are working fine. Might be something to throw in a “for NA users” guide at some point, but I’m back up and running.

1 Like

But what about your loads on the ‘B’ leg? Surely you want to use the correct voltage for those?

As I understand the sketch, in 1 phase mode the voltage reference from the A leg gets applied to all CTs. This is (again, I believe) the same as the AC-AC supply/reference monitor in the old EmonTX3 series. While not precise, this was previously considered good enough for non-revenue metering. My readings so far seem to be roughly in line with what I would expect given their loads.

I’ve scanned through the long EmonTX5 thread on monitoring both legs for split phase users. Wiring up lines from each leg, plus the isolation and custom sketch modifications required to apply those two legs to the CTs instead of the default choices of either one or three phases, is more effort than I’m willing to invest at this point.

It would be great if an out of the box solution was available for higher precision for North American users, but I think this will do for my needs…at least for now!

Good Grief, you’ve already done around 80% of the work.

Given my understanding of US regulations, about 19% of the remaining 20% would be in wiring the emonVs to a 4-pole 240 V outlet, and about 1% in changing the sketch. It’s so trivial that it’s taken me I’d guess 3 mins:

Change back to the 3-phase #define ... then change the c.t. allocations - assuming each circuit is connected A - B - A - B etc:

#if NUM_V_CHANNELS == 3
  EmonLibDB_set_pInput(1, 1);                  // CT1, V1 (etc)
  EmonLibDB_set_pInput(2, 2);
  EmonLibDB_set_pInput(3, 1);
  EmonLibDB_set_pInput(4, 2);  
  EmonLibDB_set_pInput(5, 1);
  EmonLibDB_set_pInput(6, 2);
  EmonLibDB_set_pInput(7, 1);                  // CT7, V1 (etc)  
  EmonLibDB_set_pInput(8, 2);
  EmonLibDB_set_pInput(9, 1);
  EmonLibDB_set_pInput(10, 2);  
  EmonLibDB_set_pInput(11, 1);
  EmonLibDB_set_pInput(12, 2);
#else

That’s all.

It’s not the sketch that’s the bulk of the work for me, it’s the wiring. I don’t have another receptacle at the install location that’s on a different leg. Even if that were to be addressed, I’d still need to get some sort of isolation device there so I could pass a line without tying in the neutral lines from both sides together close to the load. Or am I misunderstanding what needs to be done here?

1 Like

But the two neutrals come from the same place - unless other appliances or outlets are connected to the same circuit, I don’t understand your concern. You’d best seek the advice of a local qualified professional. In the UK, and bearing in mind our 3-phase system is 240 V L–N and 415 V L–L, we would use a 4-pole MCB to provide switching and overload protection. For you, 3 poles L1, N & L2 would be sufficient. The current rating would be minimal. Fuses would not be advisable, because one blown fuse might give the impression that the emonVs was not energised, when the second Line could still be live.

@Bill.Thomson will be more familiar with your systems.

1 Like

In the US, breakers on a neutral leg is a big no-no. Neutral wires always go directly to the neutral bus bar.

He needs a Dual Pole breaker. e.g. one similar to this:

This one is just an example.
The rating and type needed will depend on the load and the load center. (breaker panel)

They should come from the same place, but a shared neutral (not good) is a possibility if someone other than the OP has done any wiring in his residence.

1 Like

In the UK, the neutral is regarded as a live conductor - because an upstream break will, if there’s any sort of load connected, result in it being at line voltage. Whilst it’s perfectly OK to switch only the line conductor for control, to safely isolate the appliance or equipment when working on it, then the neutral must also be disconnected.

Same as your side of the pond. i.e. We consider the neutral a live conductor, too.

Which, according to the National Electrical Code, makes a circuit breaker on a neutral leg a definite no-no.