Second emonpi on network

I’m setting up (badly) a second emon pi in a separate property that is on the same network as my existing emonpi. Note - This new emonpi installation will soon control a second openevse on the network.

When I first turned on the new emonpi the setup started but then stopped part way so I never got the option to set it up with a different name. I then edited /etc/emonhub/emonhub.conf

all good so far, but all the stuff in emoncms needs to change to work and I’m thinking a factory reset may be a better way forward. I found some old threads with a factoryreset but they dont seem to work… (sudo su ~/emonpi/./factoryreset)

any thoughts on the best way?

Out of the box any new install hostname is called emonpi
If you already have an emonpi on your network then DNS will get screwy and you’ll probably have to reboot your existing emonpi and this new pi.

So boot the new pi (from a fresh sd card install), but not plugged into the network

Once booted, login (attach screen, keyb etc to Pi)

sudo raspi-config nonint do_hostname “newname”
sudo reboot

Once rebooted, you can put this back on the network and there should be no conflicts.

thanks for the reply, but I’ve already edited emonhub.conf
what difference would raspi-config make as when I check its already using my new name

Not sure.

I’m just relaying what works for me when I want to build a new emonpi on my network.
Changing the hostname (off network) seems key to me so that I don’t screw networking on both my existing emonpi and the new build.

You can change the hostname on one of the units by editing /etc/hosts and /etc/hostname

Many thanks, done both of those. is that all thats required given the addition of the openevse (which will be the 2nd on the network) that will happen soon?

I can’t see any issue with that, the openevse will have an unique hostname e.g openevse_xxxx

So, 2nd charger on the network now installed and working.

I have 2 issues Temperature is displaying “NaN” - I found some old posts about this and checked debug mode but my units temp sensor is turned on. I also found a post about units shipping without temp sensors - is this the case when ordered through OEM shop?

second issue is I can’t get the new unit to connect to its emoncms. MQTT is working fine. I’ve tried both http://emonpipc/emoncms or just http://emonpipc with node openevse and writekey from the node device key. The network resolves to http://emponpipc fine… what am I doing wrong?
Thank you

Yes, please contact shop support to obtain a temperature sensor which can be plugged in: Contact

I’m assuming emponpipc is your emonpi hostname? You could try http://emponpipc.local? Local hostname resolving can be unreliable and depends on your router hardware. Just to test could you try posting to the emonpi IP address?

Thanks contacted the shop.

yes emonpipc is the hostname of the second emonpi on the network that needs to work with the new openevse. my browser resolves fine to both emonpipc or emonpipc.local… but openevse just says connected:no failed to connect.

I’ve tried using the ip (192.168.1.228) and still no connection - tried new device key… still nothing

Does anyone have any thoughts on this / steps I need to do to work out why this isn’t working?

Many thanks

@glyn.hudson ?

Can you confirm what is/isn’t working and the overall setup, please? 2 EmonPis and 2 OpenEVSEs?

Yes 2 properties with separate incoming elec supply but both on the same network. To get the second pi to work I changed /etc/hosts and /etc/hostname to emonpipc.

This seems to work fine I can connect to it via my browser etc etc

The problem I have is trying to get the second openevse to connect to emonpipc all I get is connected “no - failed to connect”

However MQTT connects fine to emonpipc

Does the above make sense?

Can you connect to the second OpenEVSE directly?

I’m not sure if the OpenEVSE sets a hostname for it’s own portal. If so it is probably the same as the first one which may be the issue.

Using ‘local’ hostnames is a recipe for disaster especially if not using fixed IPs.

yes I can connect to the second openevse directly they have unique hostnames (preset)…

eg
openevse1 is openevse-9c60
openevse2 is openevse-5b20

(these are not exact values but they are the right format)

I have tried to get the connection to emonpipc using the emon ip address… but this doesnt work either.

The bit that puzzles me (and I dont understand stuff well enough) is that openevse2 mqtt’s to emonpipc fine so whats the difference between the openevse doing mqtt:// & http://

That really doesn’t make sense. Do you mean the EmonPi’s IP Address as displayed on the LCD?

What error message do you get?

I can’t think of any reason why connection by the IP address would not work unless there is something very strange with your network. Just one subnet in use?

Hyphens in host names can cause an issue.

So you can open the web interface of both EmonPis and both OpenEVSEs - Yes?

You know the IP addresses of all 4? Are they fixed / reserved?

You have set the MQTT broker for EmonPi 1 in OpenEVSE 1 settings (using IP address)? And the MQTT Setting for EmonPi 2 in OpenEVSE 2?

Have you an independent MQTT tool setup? Can you connect to both brokers?

Correct, IP address connection should always work unless there is an issue with the network.

However, is sounds like the OP has successfully changed the hostname of the emonPi so the two emonPis have unique hostnames.

@graemetherunner can you ping the openevses from the emonPi’s?

For future reference, probably better to say to use the raspi-config tool, I’d suggest :slight_smile:

I’m unable to connect directly (keyboard / screen) to the emonpipc so…

ping emonpipc from my laptop returns
192.168.1.228
sent 4 packets 100% success 3ms

but put that into openevse and I still get

To connect to emonpipc I’ll ssh and then try the same later but assume it will be the same.
Yes I can open web interface of all 4 devices
Network is relatively straightforward & all on one subnet (192.168.1.xxx)
No independent? mqtt but it just works see below.

Where have I gone wrong?