I’m actually quite surprised by how useless the responses are.
Do you have any idea what the output voltage range on the solar doodad is? Do you have any tools to measure it? Does it even change at all?
I guess most of the time you’d want to shut down under a low voltage condition, but then also somehow start back up again when the low voltage condition is cleared…
If you start back up too quickly once the low voltage condition is cleared, and before the battery has fully charged (or sufficiently charged), you’re going to have a bad time- you’ll end up ping-ponging in and out of shutdown as the battery wavers on the edge of low voltage.
I think what they’re getting at is, that to do this properly you would need to monitor the input voltage from the solar panel, plus the voltage from the battery and make some decisions about what to do in various cases- most likely requiring a microcontroller to arbitrate the power supply.
- Battery is low, and is being charged by 2v from the panel, we can calculate we need to wait X hours before it’s safe to turn on
- Battery is low, and is being charged by 12v from the panel, we know there’s enough headroom to run the Pi and charge the battery so we keep going
- Supply from panel was sufficient to run and charge but drops out suddenly while the battery is still being charged and is still low voltage… guess we’re straight into a hard shutdown
And that’s just three cases I can contrive off the top of my head.
In your case, if you just want to shut it down, you can watch the low voltage indicator and do so. Then you can use the very powerful computer in your brain, and set of sensors in your head to solve all the edge cases and make an informed decision about whether to turn it back on :D