Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Sanity Check - Streaming data from one emonpi to another emonpi on the same network

Tags: #<Tag:0x00007fc9c419aa60> #<Tag:0x00007fc9c419a268>

Hi

I have bought a second emonpi to give me readings from my garage to watch seperate draw of energy from the main house. I have read the logging remote section which is written primarily to log to emoncms.org. However, I assume that I simply overview the relevant section in the emonhub config file for emoncms.org for my local installation on the other emonpi?

I have also just realised that both nodes are called emonpi - for some reason I cant seem to be able to change the node on either of the devices…

I couldn’t find any discussion in the community on and thread where people have done this… I just wanted to check was on the right path before corrupting my main house emonpi.

Both node

Cheers
NeilB

Edit - changed thread name to avoid confusion with the Sense energy monitor. BT, Moderator

The emonPi’s NodeID and Name are both in emonhub.conf, but in slightly different places:

[[RFM2Pi]]
...
        baseid = 5                              # emonPi / emonBase nodeID
[[5]]
    nodename = emonpi

I think you’re on the right track.

Bear in mind that as both are on the same radio channel, they require different NodeIDs (else you’ll get the data from both merged) and the same goes for sensor nodes working to them - unless you change the Group for one and its sensors. Even then, the radio traffic for both might still jam the other’s.

Also bear in mind that, on the one receiving it via LAN, the data bypasses that one’s emonhub.conf.

The sending one sends to the dotted IP address of the receiver, and of course you need to make that static in your router lest it changes on a reboot of the router.

you need to make that static in your router lest it changes on a reboot of the router.

Alternatively, it can be made static on the Pi itself.
Ref: https://www.raspberrypi.org/forums/viewtopic.php?t=140252

I doubt I’ll remember that. The easiest by far is do it in the router. For a start, it works for everything when done there, and all are visible in the same place.

Yeah - have assigned static at the central dhcp server on my network

They will be - edit /etc/hostname and reboot should fix it.

You can add in a second MQTT entry to emonhub.conf on the new Pi that points to the original emonPi (just change the IP address on the MQTT settings).

I meant within the input group on Emoncms - I have tried renaming them to something like emonpi-house, but sadly that creates a separate input group but with components

That’s one of the reasons I tend to stay out of the router.
If the router config gets mucked up, the entire LAN could wind up inop.
If the Pi network config gets messed up, it’s only the Pi that’s affected.

Another reason is that an older router may not have the ability to assign a “static DHCP” address.
I’ve got one that doesn’t have that capability. I’ve also got one two that do, but they are fairly new.

So as Robert said.

You need to change the NodeID in the [[RFM2Pi]] section to 4 and the ‘nodes’ section (just copy node 5 and change the name and number) e.g.

[nodes]
[[4]]
    nodename = emonpi2
    [[[rx]]]
        names = power1,power2,power1pluspower2,vrms,t1,t2,t3,t4,t5,t6,pulsecount
        datacodes = h, h, h, h, h, h, h, h, h, h, L
        scales = 1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1,1
        units = W,W,W,V,C,C,C,C,C,C,p

And if you allocate a fixed IP address in the Pi, and give it one that you’ve allocated and forgotten about elsewhere, the LAN is messed up anyway.

My DHCP allocation starts at x.x.x.100 and I keep a list of all the fixed IPs I allocate. Means when I swap routers/DHCP server there is nothing to update.

I can also keep similar devices together in IP terms.

You get a message about a duplicate IP address, but things keep working except for the two
devices that have the same IP address. Been there, done that a few times. :wink:

QQ - I have setup the node and the data appears to be flowing - however I am trying to change the NODEID from 4 to something like emonpi-garage (rather than 4); but to no avail? Any ideas?

I have added an entry in the emonhub.conf for node 4 with any update of the name etc…

[[4]]
nodename = emonpi-garage
[[[rx]]]
names = power1,power2,power1pluspower2,vrms,t1,t2,t3,t4,t5,t6,pulsecount
datacodes = h, h, h, h, h, h, h, h, h, h, L
scales = 1,1,1,0.01,0.1,0.1,0.1,0.1,0.1,0.1,1
units = W,W,W,V,C,C,C,C,C,C,p

Main EMONPI receiving the feed…

2nd EMONPU sending the data…

A std emonhub setup posts locally via an MQTT interfacer by node name and remotely via HTTP interfacer which uses node id. If you were to point the 2nd emonpi’s existing MQTT interfacer at the 1st emonPi it would post the data as seen in your second screenshot above to the 1st emonPi instead of locally. Or as Brian suggested, you could add a second MQTT interfacer if you do want to log the data to both emonpi’s. Either way this would be instead of the HTTP interfacer you currently have posting as node 4, so that will need disabling.

[Edit] Please note that the above achieves what you ask. However, the HTTP method is the more accurate and robust method, so often well worth the minor annoyance of tolerating node ids on the input configuration page that will be rarely seen once configured. If consistency is your aim, consider swapping the 1st emonPi to use HTTP and node id instead. I have to say I would prefer to use the HTTP over the MQTT route even if I were running just a single emonPi.

To describe it as “more accurate” is, I think, wrong. I’ll go with the more robust although the recent updates to Python3 seems to have broken that somewhat. It is the same data, so HTTP cannot be “more accurate”.

I’ve monitored the 2 locally and there is no difference under normal operating conditions even from a remote node.