question

Alexander Hein avatar image
Alexander Hein asked

Turn off/shut down the Raspberry Pi with Venus OS via button?

I am looking for a way to turn off/shut down the Raspberry Pi with Venus OS via button (no hardware switch solution please).

Does anyone have a solution for this?

Venus OS
2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Matthias Lange - DE avatar image Matthias Lange - DE ♦ commented ·

@Alexander Hein

Guten Tag Herr Hein ;-)
Ich habe die Frage mal in den Mod-Bereich verschoben, da passt es besser hin.

https://community.victronenergy.com/spaces/31/mods.html


I guess there is a way but you might be not able to restart it without physical access.

0 Likes 0 ·
Alexander Hein avatar image Alexander Hein Matthias Lange - DE ♦ commented ·

That would be enough for me. Power off to restart after shutdown and power on again to restart after shutdown is ok for me. I am purely concerned with the shutdown via touchscreen.

0 Likes 0 ·
7 Answers
Kevin Windrem avatar image
Kevin Windrem answered ·

If you also use RpiGpioSetup, you can add a physical button for reset. Refer to the ShutdownMonitor ReadMe for details.

On note: if the PI locks up to the point services are not running then the physical input will also not work. There is nothing I can do to reset the PI in this case short of a power cycle.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

rmaddy avatar image
rmaddy answered ·

I was hoping to add a "Shutdown" menu but I couldn't figure out the code to start a shutdown. So for now I bring up the menu, go to Settings -> General. Then tap on Reboot. Once the screen goes dark I then disconnect the power. Not ideal but it works the rare times I need to power down cleanly.

3 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

laurenceh avatar image laurenceh commented ·

One option would be to implement it as a url ( not part of the GUI).

In principle the steps are:

1) enable python in hiawatha.configure

2) write a python script to execute is “power off”

3) put the script in the hiawatha directory

On a browser go to http://Venus.local/<script name>

The url could easily be stored as a favourite in your browser or on your phone home screen.

If this is enough information for you, give it a go. If you want to try it but need full instructions ( file names and lines to edit and the python code) I can write you some more notes.

0 Likes 0 ·
Alexander Hein avatar image Alexander Hein laurenceh commented ·

Thank you for your advice. Your solution can not be activated directly via the user interface of the Venus OS but requires a 2nd device which triggers the shutdown via browser right?

0 Likes 0 ·
laurenceh avatar image laurenceh Alexander Hein commented ·

That is correct, so may not be what you want.

0 Likes 0 ·
Warwick Bruce Chapman avatar image
Warwick Bruce Chapman answered ·

I am assuming that by "hardware switch" (you don't want this) you mean something that cuts the power and by "button" on Venus (you want this), you mean something that gracefully shuts down.

I assume you mean a GUI "button".

If you meant a GUI button, you could implement the solution here but instead of a physical push button, you could use a relay like this from https://community.victronenergy.com/questions/34195/make-more-than-two-relays-visible-on-rpi-rpi.html:

1621680936480.png


1621680932902.png (71.4 KiB)
1621680936480.png (71.4 KiB)
4 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Alexander Hein avatar image Alexander Hein commented ·

Please check the "here" Link.
Unfortunately it does not work.

1621701199077.png

0 Likes 0 ·
1621701199077.png (68.1 KiB)
rmaddy avatar image rmaddy Alexander Hein commented ·
0 Likes 0 ·
Show more comments
Alexander Hein avatar image
Alexander Hein answered ·

I don't think I was able to express myself properly.

What I was looking for was a shutdown button as a direct

command to Venus OS (Picture below from Raspian OS).

Any ideas for this in Venus OS?


snip20210522-7.png


snip20210522-7.png (100.8 KiB)
2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

rmaddy avatar image rmaddy commented ·

There is no shutdown menu in the Venus OS GUI. Just the Reboot menu as I mentioned in my answer. If you have ssh access then you can run "halt" or "shutdown" from the command line.

0 Likes 0 ·
Alexander Hein avatar image Alexander Hein rmaddy commented ·

And is there a possibility to add the shutdown as an additional button after the reboot button?

0 Likes 0 ·
protectyourenergy avatar image
protectyourenergy answered ·

Because of the power consumption of the RPi and the Display I also want to cut Power of the System while I am not in the RV or sleeping.

I thought about a simple switch that cuts the power of the RPi.

@Warwick Bruce Chapman

You said "you don´t want this" it sounded like a general "you" :-) Is there any problem with just cutting the power?


Best regards

2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Warwick Bruce Chapman avatar image Warwick Bruce Chapman commented ·
OP said they did not want a hardware switch.
0 Likes 0 ·
protectyourenergy avatar image protectyourenergy Warwick Bruce Chapman commented ·
Okay so it was not a general "you", thanks for the clarification.


Is there any other reason why I shouldn´t use a hardware switch to power down the hole RPi?


0 Likes 0 ·
Kevin Windrem avatar image
Kevin Windrem answered ·

Check out my ShutdownMonitor addition. It adds a button in the menu below the Reboot button

https://github.com/kwindrem/ShutdownMonitor

On a Raspberry PI, it also permits using a physical switch to initiate shutdown. (RpiGpioSetup also required).

Note that Cerbo will reboot itself after it is shutdown. I don't recall the delay in this but it does give you ample opportunity to disconnect power.

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

friaras avatar image
friaras answered ·

Hello, Kevin thanks for all the work you have done, I use most of your scripts, they are very handy! In reference to the shutdown script, I like to add a hardware button because when the Rasp Pi locks up for whatever reason, the shutdown script won't work. I end up pulling the plug. I like to add a button, by adding a button will the Rasp Pi shut down completely or go into a stand-by mode? Which pins do the connections go? I would appreciate your valuable time. Thanks again!

2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

Related Resources