Gracefully shutdown OS utilizing SignalK
Hello. I am running SignalK on Raspberry PI4 (Debian Bookworm). SignalK is monitoring boat house battery (using Victron VE direct). I would like to gracefully shutdown the OS when house battery goes below specific limits (e.g. 11.2 Volts). What is the best practice for that? Is there some plugin available? Should I use some external cron script? What to google? I would not like to use additional hardware (Raspberry UPS HAT etc).
4 Replies
Shutting down the operating system will not stop it drawing power
I would look into node-RED
https://flows.nodered.org/node/node-red-contrib-rpi-shutdown
or exec node
node-red-contrib-rpi-shutdown
Nodes to shutdown or restart your Raspberry Pi.
Thanks Teppo. I will start to study node-red. Victron charger will turn off power supply at 11.1 volts which should stop raspberry power drawing.
Using eg sudo shutdown or similar, will significantly reduce the power draw of Rpi, albeit as above, not completely eliminate power draw.
(but it will be a very significant reduction, as after its shutdown, its “standby” current draw would be quite low … you should be able to google a spec for this, or measure it)
Its a 12V system, so im assuming the RPi is powered direct, and hence it has no external power supply with a low voltage shutdown capability.
not sure i fully understand the “victron charger will shutdown power supply” comment,
but this implies your system has some low voltage control, to shut off loads (inc to Rpi?) .. so this will ensure you dont over discharge yr batteries. (good)
Hence, if your “just” trying to achieve a “graceful” shutdown, before the external low voltage load shutdown,
then a simple voltage divider to be able to measure voltage on Rpi analog gpio, and then nodered or similar to constantly monitor this, and then
make a decision when to shutdoown the OS (after which it will still continue to draw “standby” current)
.. so in the absence of any further “charging” source, the system will eventually trigger a low voltage load disconnect - hopefully of ALL loads.
edit … looks like you may already be gettung battery voltage via ve.direct? (and not require a separate volt sensor at rpi?)
.. so just use that path from signalk in nodered… and a simple flow to execute a shutdown when it falls (for a period of time) below X.X volts