I am working on a battery powered Raspberry Pi project. When the batteries are charged (enough), the Pi and all the connected peripherals boot and run correctly. The issue I'm facing is when the batteries get low and I try to boot. The Pi begins to boot, then the USB peripherals try to fire up causing a voltage dip, I get a low voltage warning and the Pi reboots. This boot -> low voltage -> reboot cycle then continues indefinitely until I unplug the batteries. If it can't boot, I don't want it to even try to continue booting after it gets the low voltage warning. Is there a way to configure the raspberry pi to CANCEL the boot sequence and shut down/power off if a low voltage warning occurs during boot? Thus preventing this horrible cycle.

  • 1
    The obvious problem here is that there is no way software (or firmware that needs to be loaded from the SD card) can deal with a situation that may preclude its proper execution. That said, if "the USB peripherals firing up" refers to some point during the OS boot (when there is already kernel output going to the display) and there has already been a low voltage warning (which may not be the case, if it's the USB stuff that first triggers it), there might be something you can hook into. You might want to add those details to the question. But really a hardware solution seems best. – goldilocks Jul 18 '18 at 17:50
  • After the OS has been booted : You could create a background process that reads the /var/log/syslog every few seconds and if it finds out the low voltage warning , it issues system call to shutdown? or else it happens while the OS is still booting , as @goldilocks suggests to simply cut the power using the hardware. – MaNyYaCk Jul 19 '18 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.