EmonTX shield emonhub interface & node setup

A new user here trying to setup emontxshield with Rpi 3 via direct serial. 4CT’s and a Voltage transformer are connected and calibrated.
The emonhub log shows serial data coming in like this.

2023-02-24 04:39:19,141 DEBUG    SerialDirect 8217 NEW FRAME : 6 -0.00 -0.00 0.00 -0.00 0.58
2023-02-24 04:39:19,142 DEBUG    SerialDirect 8217 Timestamp : 1677213559.141082
2023-02-24 04:39:19,143 DEBUG    SerialDirect 8217 From Node : 6
2023-02-24 04:39:19,144 DEBUG    SerialDirect 8217    Values : [0, 0, 0, 0, 0.58]

Emonhub config:

     Type = EmonHubSerialInterfacer
           com_port = /dev/ttyAMA0      # or /dev/ttyAMA0 or/dev/ttyACM0 etc
           com_baud = 9600              # to match the baud of the connected device
           pubchannels = ToEmonCMS,
           nodename = emontxshield

    nodename = emontxshield

       names = power1, power2, power3, power4, vrms
       datacode = 0      # not essential as "0" is default datacode for serial interfacer
       scale = 1         # not essential as "1" is default scale for serial interfacer
       units =W,W,W,W,V

The problem is that I can’t get the inputs to show up in EmonCMS?
Already tried a lot of different configs found in the forum but no solution… :confused:
When adding a device (I select → open energy monitor → emontx continuous sampling - > home energy monitor) and only a P1 input shows and it’s n/a
Is there someone who can point me in the right direction?

Appreciate your help.

Is this the entire emonhub config?

If so, you have nothing sending (publishing) the data.


0.58 does not look like a valid vrms value.

I think it needs a space after the =. Might not be fatal though :slight_smile:

I’m not sure what hardware, software and firmware you have, but:
Assuming that this is what you mean by an emontxshield:

And assuming that the emonTx Arduino shield is plugged into something like an Arduino Uno with suitable firmware to make the measurements, then I assume that the Uno is connected to the Pi via USB.

In this case I think you will need to alter the Emonhub config lines to

     Type = EmonHubSerialInterfacer
           com_port = /dev/ttyUSB0      # or /dev/ttyAMA0 or/dev/ttyACM0 etc
           com_baud = xxxxx              # to match the baud of the connected device - the Uno
           pubchannels = ToEmonCMS,

assuming that this is the correct USB port on the Pi.
/dev/ttyAMA0 refers to the serial RX and TX pins on the Pi 40 way GPIO connector.

com_baud = 9600 needs to be altered to suit the rate sent from the Uno

I apologize if the assumptions are wrong!

As @vandura231 appears to be seeing credible data in the emonHub log (except that 0.58 Vrms is presumably pick-up - the a.c. adapter isn’t plugged in), I think we can rule out communications problems.

Thanks for your help all, The board is the one mentioned above. and the AC adapter isn’t plugged in at the moment. I see my test measurements (power & voltage) appear in the emonhub serial log. when testing.
The rpi3 is connected direct to the GPIO. hence /dev/ttyAMA0.
I asume communication is working fine.
Do inputs appear without adding a device? It seems that my board is not in the device list?

Your assumptions are spot on :grinning:

They should do - but where are you looking? The “Setup” → “Inputs” page is where they should first appear.

Yes, that’s where I expected them to show up. But it stays empty.
Here’s how they log in the serial monitor in the admin page (node 6)

6 0 0 1 -0 2
6 -0 -0 0 -0 2
6 -0 -0 -0 0 3
6 0 -0 -0 -0 6

are there any other logs i should pay attention to?

This is absolute confirmation that the data is reaching the Pi, so I’d suggest there’s part of your emonCMS ihat isn’t running.

What does “Admin” → “System info” tell you? (At this point, my knowledge of emonCMS goes no further, so it’s back to @borpin .)

Did you actually read my answer? EmonTX shield emonhub interface & node setup - #2 by borpin

Yes, I did. I understand now and it’s working. It did not have a location to send to. I did tidy up to much.
The config I pasted was all ther was. I added the “EmonHubEmoncmsHTTPInterfacer” and they popped up.

Thank you all for your time and patience!!
I’m marking your post as the solution Brian.

1 Like