View Single Post
  #80  
Old April 14th 20, 01:49 PM posted to rec.aviation.soaring
kinsell
external usenet poster
 
Posts: 546
Default Battery switching without tears

On 4/10/20 3:19 PM, kinsell wrote:
On 4/8/20 10:58 AM, Martin Gregorie wrote:
On Wed, 08 Apr 2020 08:57:43 -0600, kinsell wrote:

Runs an embedded linux, they're not storing any data during normal
operation, so baffling why that's so hard to fix.

When does it commit data to non-volatile memory, i.e. does in
intentionally buffer it and only commit at intervals or as part of
shutting down?
FWIW The same problem occurs with Raspberry Pis.

As you may or may not know, these run a Debian Linux clone as their OS
and use SD cards for non-volatile memory by default. Much of the time
people can get away with simply pulling the plug when the Pi appears to
be idle, but if you do that while the Pi is flushing its caches to its SD
card or, more rarely, the card is in the middle of a wear-levelling
process, then the SD card will become corrupted and possibly permanently
damaged if it was wear-levelling when the power vanished. Which is why
everybody soon learns to shut the Pi down with a 'sudo stop' command
before powering it off. I think its worse with SD cards simply because
their internal controllers and cheap, rather basic and have no power
buffering. Use an SSD instead or, even better, a hard drive and the
problem largely goes away because ext4 is a journalling filesystem, so
has built-in recovery.

I agree this is a tricky problem, and maybe best solved with some sort of
cheap'n cheerful UPS. Here's a suggestion along those lines:

Pimoroni sell the PowerBoost 1000 Charger, a small and fairly cheap UPS
circuit ($US 19.39 from Amazon), which you connect between a 5v power
supply and the device you want to power via a UPS socket. You also
connect a suitable sized 1S (3.7 volt) Lithium-ion battery to it - the
sort used to power small RC models would be fine - and there's a power
buffer for any UPS-powered device that doesn't have an internal battery.
Its good to supply up to 1000mA provided that the battery is rated for
that current. Some soldering is needed.

It comes with a selection of sockets, but they're all sat loosely in
place on the board so you can solder the ones you want on, sling the
others and solder any permanent connections you need.

I have one but haven't used it yet - I'm planning to make a PDA from a 4"
touch screen and a Pi Zero WL and use this Pimoroni plus an RC model 1S
LiPO battery to power it. Add a case made from epoxyboardÂ* and it should
be ready to rock'n roll.



The Stratux project does run on a Rspberry Pi using the micro-SD for
storage.Â* Yes, running other software on that hardware can lead to the
same file system corruption problem.Â* What's interesting is I can load
FlightAware software on the same hardware and never see the problem.Â* In
both applications, there is no user data that needs to be stored to
flash memory, other than a tiny bit of configuration data when they are
first set up.Â* It is possible to run on a read-only file system, if some
provision is made for the configuration data.Â* People have experimented
with this, but the images distributed for Stratux have never had a
solution that I'm aware of.

So many devices these days have a computer with flash memory.Â* If your
smart TV becomes unbootable after a power fail, would that be considered
acceptable?Â* Of course not.Â* But for some reason Stratux doesn't seem to
get fixed.Â* Putting a UPS on a microcomputer seems like an ugly Band-Aid
(rtm) that shouldn't be necessary.Â* Just a simple file system check on
power up might be adequate.Â* There's a Sentry Mini receiver available
now for just $300, I'll bet it doesn't lose its mind if you just pull
power.

-Dave


Looking at a couple lightly-used Stratux boxes, one of then had a
completely full file system, the other was almost full. Seems to be
more of a science fair project than a serious instrument to be used for
navigation.