Community
OpenEnergyMonitor

Community

Safely Shutting down Base unit when powered?

Hi folks. I have set up a Base unit and a Emon Tx . All works fine thanks to your help.

How do shut down the base unit correctly before removing power. I dont want to cook the SD card.

The PI unit has a shutdown button apparently. Maybe the Base unit needs a little remote shutdown button.

Regards and thanks

If you have a keyboard and monitor connected to your emonBase,
execute the command sudo poweroff

If you don’t have a keyboard and monitor connected,
execute the command ssh [email protected]_address sudo poweroff

you’ll be prompted for the emonBase password. After you enter the password, the command will run.
You may get an error message about a broken pipe, but it can be ignored.

Note: ip_address> is the emonBase IP address.

The hostname can also be used to connect via SSH:

ssh [email protected]

the default SSH password: is emonpi2016

Keep in mind that method works only if the emonpi IP address is included in the hosts file of the machine that’s running the SSH client.

emonpi.local suffix is required on some networks e.g.

ssh [email protected]

http://emonpi.local works on my office network while http://emonpi works on my home network

For that to work, Avahi needs to be running on a Linux client, or Bonjour on a Windows client.

Hi folks all taken onboard. On a diffrent note i have a PI based energy monitor from America, Its quite smart.
It uses a small remote shutdown button connected to the I/O ports and runs a python script to shut it down safely.It makes it foolproof.
I may open another post on this unit later. I used for offgrid generator monitoring . Here is the basic outline and link http://rokhmanov.blogspot.be/2015/03/multichannel-professional-data-logger.html

Multichannel Professional Data Logger on Raspberry Pi - Part 2
Software tools, applications and frameworks I found interesting or useful. Mostly around Java, Maven, Teiid, wit…

John o shea

emonpi.local works on the standard emonSD image on Ubuntu Linux with Chrome / Firefox and also tested to work on Android Chrome. No extra services required. I imagine Avahi is running as standard on Ubuntu and Android. Tested on Ubuntu 16.04 and Android 7.

Yup, nice solution. We do the same on the emonPi, use a button to trigger shutdown via GPIO pin. The emonPi shuts down if GPIO 11 is low for 5s then the emonBase will shutdown:

On the emonBase since no LCD is detected this python scripts exits, you can override this by commenting out this check:

And that’s a good thing.

But… If the box you’re issuing the command from isn’t running Ubuntu or isn’t running avahi, it doesn’t work.

If the box issuing the commend is running Windows, (unless it’s running Bonjour or an equivalent) it won’t work there either.

I just tried shutting down a Pi (running the latest emonSD image) from a machine running Debian (no avahi) and received this error message: Could not resolve hostname emonpi.local: Name or service not known

No joy with PuTTY on Windows 7 either. Even though Windows isn’t the world’s most liked OS, there are too many Windows boxes in use to just turn a blind eye to them.

That’s exactly why the now-deprecated calibration instructions that I wrote were done with Winten running in a VM as well as on my native Ubuntu.

In the Admin menu, there is now a shutdown button, as well as reboot.

1 Like