EmonTx5 Input Mapping

What should be the input mapping of the EmonTx5 modules? I was assuming 1 to 1.

Here I have a single CT attached to input labelled 10 on the EmonTx5 unit. No other CTs attached.

However its showing up in Emonhub seemingly as input 5 on the expansion board (second node id). I would have expected this input to be 4 i.e. 6 inputs for main board then 4th input on expansion board.

Also weird things happening with energy use on E2 and E4 if anyone can guess at the root cause there.

Which sketch are you running in your emonTx?

It should be appearing as two consecutive (but it doesn’t need to be) NodeIDs, sending two separate packets of data, the first packet (CTs 1-6) as Node 28 and the second (CTs 7-12) as Node 29. Here is the low-down from the 12CT sketch:

// EEProm.nodeID (28)
struct {
    uint32_t Msg;
    int16_t V1,V2,V3,P1,P2,P3,P4,P5,P6; 
    int32_t E1,E2,E3,E4,E5,E6; 
    uint32_t pulse;
    uint16_t ana;
} txPacket1;

/*  52 bytes
[[28]]
    nodename = emonDB_28
    [[[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
*/
        
// EEProm.nodeID (29)
struct {
    uint32_t Msg;
    int16_t V2,V3,P7,P8,P9,P10,P11,P12; 
    int32_t E7,E8,E9,E10,E11,E12; 
    uint32_t pulseD, pulseA;
} txPacket2;

/*  52 bytes
[[29]]
    nodename = emonDB_29
    [[[rx]]]
        names = MSG, Vrms2, Vrms3, P7, P8, P9, P10, P11, P12, E7, E8, E9, E10, E11, E12, digPulse, anaPulse
        datacodes = L, h, h, h, h, h, h, h, h, l, l, l, l, l, l, L, L
        scales = 1.0, 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, W, W, W, W, W, W, Wh, Wh, Wh, Wh, Wh, Wh, p, p
*/

So you see in there, the names for the second packet are specified.
The blocks that begin [[28]] & [[29]] should be in your emonhub.conf file and it’s in emonHub that the binary data is split and allocated names like “MSG”, “Vrms1”, etc.

If you don’t have those two blocks, this is where your problem is - and it looks to me as if this explains E2 and E4 - because those variables are each getting the wrong 4 bytes of data (this is what datacodes = ... does).

Not sure on “which sketch”, im running the EmonTx5’s straight from the shop, albeit with a few of the CT calibrations reduced to 20A. So I’m generally assuming the EmonTx is sending the right data?

Yes, as you saw, figured out the ID and two blocks for the original and expansion board, but across both boards, there’s only a single CT currently connected - CT 10 on the back of the EmonTx5.

Just for the purposes of clarity I’ve got 3 EmonTx5s, 27+28 (expansion, 29 (no expansion) and the EmonTx5 in question is currently set to 24 and 25.

RE emonHub, I’m using autoconfig as set by default. Its detecting them as EmonTx4s but from what you’ve said before, I’m assuming this is close enough. The below is the relevant block:

[[24]]
        nodename = emonTx4_24
        [[[rx]]]
            names = MSG, Vrms, P1, P2, P3, P4, P5, P6, E1, E2, E3, E4, E5, E6, T1, T2, T3, pulse
            datacodes = L, h, h, h, h, h, h, h, l, l, l, l, l, l, h, h, h, L
            scales = 1.0, 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, 0.01, 0.01, 0.01, 1.0
            units = n, V, W, W, W, W, W, W, Wh, Wh, Wh, Wh, Wh, Wh, C, C, C, p
    [[25]]
        nodename = emonTx4_25
        [[[rx]]]
            names = MSG, Vrms, P1, P2, P3, P4, P5, P6, E1, E2, E3, E4, E5, E6, T1, T2, T3, pulse
            datacodes = L, h, h, h, h, h, h, h, l, l, l, l, l, l, h, h, h, L
            scales = 1.0, 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, 0.01, 0.01, 0.01, 1.0
            units = n, V, W, W, W, W, W, W, Wh, Wh, Wh, Wh, Wh, Wh, C, C, C, p

As I write this I’m realising this looks quite different from the other expanded EmonTx5. Why I don’t know, Ive not manually edited any of these configs. The other expanded EmonTx5 is below:

[[28]]
        nodename = EmonTx4DB_rf1_28
        [[[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
    [[29]]
        nodename = EmonTx4DB_rf2_29
        [[[rx]]]
            names = MSG, Vrms2, Vrms3, P7, P8, P9, P10, P11, P12, E7, E8, E9, E10, E11, E12, digPulse, anaPulse
            datacodes = L, h, h, h, h, h, h, h, h, l, l, l, l, l, l, L, L
            scales = 1.0, 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, W, W, W, W, W, W, Wh, Wh, Wh, Wh, Wh, Wh, p, p

So I’m assuming then if I redo 24 and 25 to align with the config for 28 and 29…magic magic…problem solved?

…seems to have, thanks!

1 Like

As a first guess, I’d pin the blame on autoconfig.

So you’re in business and away now. :+1: