Sun Dec 01, 2019 11:20 am
A bit of a history about Linux kernel which seems to be relevant for how ROS shuts itself down...
Before there was ACPI to handle power related stuff, machines had no way of actually powering themselves off. When one requested a shutdown on such machines, OS kernel (including linux) would stop all processes and at the end it would emit message to power off the hardware. After that it would sit indefinitely in an idle loop. Mind that all the hardware was still powered, just doing nothing. Which somehow reduced power consumption, but not much. E.g. CPU power draw perhaps dropped to 50% of max power draw, depending on how CPU handled unused parts of itself ... and capabiliry of kernel to issue specific low-power idle instructiobs on any given CPU.
Only way of restarting machine from this state was to cut the power ...
And I suspect that ROS, (until v7) still using ancient linux kernel, behaves exactly like this. I also don't know if RB hardware is ACPI capable, i.e. does it support software power-off and power-on at all ... absence of power buttons (it must not be a toggle switch) on most devices might indicate that they are not HW ready for such use ...
So even if one does monitor supply voltage and issues /system shutdown, the box won't restart automatically.
My solution would be hardware solution: get an under-voltage protection module, they are available from favourite Chineze online retailer for less than a buck each ... one can set cut-off voltage as well as power-on offset ... and that should deal with the issue just fine.