EmonPi change to static IP address fail to connect to network/Unable to change back to DHCP or fix

I have been using my EmonPi for a number of years. I rebuilt to the latest build about a year ago and since then had no issues.
My power would dip once in a while and then the router would issue a new IP address and since I am using NodeRED with a number of dashboards as well as monitoring graphs in WemmonPi, it is a pain to update the IP address everywhere.
So I decided to change the EmonPi to have a static IP address (I have five other Raspberry Pis running to monitor other things, and that works perfectly whenever I experience a power dip, hence me deciding to change the EmonPi to a static IP address.

Describes how to do it: .
On the other Pi units I just used VNC on the GUI

After changing the “dhcpcd.conf” file and rebooted, the EmonPi did not give me the ETH IP address on screen, just an AP IP address.

So I thought, that’s easy - just take a laptop near the EmonPi, log on to the AP, and access the Pi using Putty. Sounds easy - NOPE!!

The AP password is nowhere to be found, so that is ruled out.
Connecting directly to the EmonPi via ethernet cable - neither http://emonpi.local nor http://emonpi would open the browser.

Next running an IP scanner only pics up the laptop.

Any suggestions on how I can get access to the EmonPi? Commandline via SSH is perfect - If I can connect

Disclaimer: I’m neither a Linux expert or a Raspberry Pi expert.

I’ve NEVER tried to assign a static IP address in the way you describe, I’ve always done it inside the router, which of course begs the question: Does your router know about the emonPi, has it connected and if so, what IP address is it using?

Have you looked at the Install guide for the emonPi in Docs? EmonPi Install Guide — OpenEnergyMonitor 0.0.1 documentation

If nothing there helps, I think you’ll need to take the SD card out of your emonPi and edit either the wpa_supplicant.conf file or the file you changed before - /etc/dhcpcd.conf
This tells you how to edit wpa_supplicant.conf - assuming you’re using the RPi and the card is still in it! Due to the different OS, you’ll probably need a Linux machine with a card reader.

I checked the router as well as checked with an IP Scanner - the emonPi is not connected to my network

Thanks a mil Robert.
I will create a virtual machine on my Win11 Laptop to run Linux - I will try that in the morning (2.11 AM here) time to go to sleep now .

One last question: - Your comment “This tells you how to edit wpa_supplicant.conf - assuming you’re using the RPi and the card is still in it! Due to the different OS, you’ll probably need a Linux machine with a card reader.”

I tried both links and neither takes me to a site that explains how to edit the file
OR are you suggesting I put it in another RPi and connect a monitor & keyboard to it and just edit the file?
That might be a solution…

:+1:
 

I’ve had loads of issues with the WiFi module on the EmonSD. It was done by @glyn.hudson IIRC, but a long time ago.

Getting it back to a working state could be a problem :frowning:

I have noticed issues previously with there being the 2 interfaces (wired and wireless).

Yes, a fixed IP often will not advertise the hostname correctly.

I wonder if you changed the Wired IP or the Wireless IP. Plug the emonpi into your Router and see what IPs appear on your network (Fing is a good tool for that). Try and connect to that IP address via PuTTY and take it from there.

That, or any Linux computer. Generally, Windoze computers refuse to admit Linux discs/cards etc - and especially file systems - exist, whilst the reverse is not the case. I’m typing this on a laptop running Ubuntu Linux, and it has a card reader. I can put the Pi’s SD card in an adapter, plug it in and open the file and edit it in exactly the same way as any other file, using a text editor. Another RPi with screen and keyboard is another Linux computer. This is what I was suggesting.

Thanks @Robert , @borpin ,

I started up an RPi and with an SD Card reader with the emonPi in, managed to edit the file.
Weird thing, I wanted to rename the new config file to another name and rename the backup file to the useable file. For some other reason I could not rename any of the riles so I just edited the file that will be used.
All is good now.
I have a TP-Link router and set up a static IP there - so Job Done!!

1 Like