Author Topic: Mightyboost as UPS  (Read 3022 times)

letcher

  • NewMember
  • *
  • Posts: 12
Mightyboost as UPS
« on: July 18, 2016, 01:50:40 PM »
I have several Raspberry Pi working in remote locations.  There are occasional power interruptions and sometimes the SD boot card  is corrupted.  I'd like to use Mightyboosts to power them through a short outage and safely power them down when the LiPo battery starts fading. 

The button push to power down is handy for maintenance, and so I'd like to retain that feature.  However if there has been a power outage, when the power becomes stable again I'd like the Rpi to reboot without a human having to hike to the remote location to push a button.

My thought is to have the Moteino write a message to the flash RAM just before shutting down that would indicate the way the shutdown occurred.  If it was due to power failure (low battery) or button push or whatever.  When the power returns the Moteino would wait for the power to become stable and then read the flash memory to determine how to proceed.  If the system shut down due to power failure then the Moteino would erase the flash message and boot the system.

Please let me know what you think.  Is this worth trying to do?

Felix

  • Administrator
  • Hero Member
  • *****
  • Posts: 6866
  • Country: us
    • LowPowerLab
Re: Mightyboost as UPS
« Reply #1 on: July 18, 2016, 02:52:26 PM »
Yes should be doable, that's pretty much the purpose of MBoost (when used mated with Moteino - that enables control in addition to just power backup). The sample sketch doesn't quite do everything you said. It handles the button and monitors the battery. But you can adapt it from there to do automatic powering when power comes back on etc. I would use EEPROM to write any small variables.