Community
OpenEnergyMonitor

Community

Host-name change. mDNS settings on emonBase emonPi rPi

Tags: #<Tag:0x00007f6e043c2c00> #<Tag:0x00007f6e043c2ae8> #<Tag:0x00007f6e043c2a20>

Hello,

How do I change the host name of a rPi running emoncms?

emonpi.local is the default. how can I change the ‘emonpi’ to something else?

Cheers,

Dan

The hostname is setup in the new script by this command so I think it is just set in/etc/hosts & /etc/hostname (not at home so cannot check).

What you are trying to achieve? For example, I can access my instance (internal LAN only) via https://emon.borpin.net by putting an entry into the /etc/hosts of my pi-hole machine to point that domain to a fixed LAN IP.

That lead me to this… Three steps.

Intention is to not have multiple emonpi.local devices on the same subnet.

Cheers.


. https://blog.jongallant.com/2017/11/raspberrypi-change-hostname/

In future, the EmonScript will offer the ability to change the hostname at install time.

@borpin I didn’t see a way to change the variable $hostname in that script.

I think the part you missed was config.ini ?

So the config.ini can be changed on an sd card after the first burn, before the first boot of the rPi? Or can it be changed at any time.?

The concept is that the EmonScript will ask if you want to continue with the standard config (probably covers 90% of installs). If you respond no, the install script will exit and allow you to change any of the settings in the config.ini e.g. you may not want mosquitto installed on that machine.

You can then run the install script correctly configured for your personal circumstances.

This was where the script idea sort of started. It is still very Raspbian centric, but that can be worked on over time so it will eventually work for any Debian based OS. This would also only work for fresh installs from a Raspbian Lite image rather than from using an EmonSD image.