travisgoodspeed / loraham

Ham radio protocols and Arduino examples for LoRa on 70cm.
Other
269 stars 28 forks source link

Solar devices die on low power, but never come back. (M0-only.) #4

Open travisgoodspeed opened 7 years ago

travisgoodspeed commented 7 years ago

When a solar charged device runs low on power, it dies. That much is unavoidable, but when the sun comes back and the LiPo recharges, the node stays dead, either because it is stuck in the bootloader or because it has glitched out.

Close this issue when we have either a software or a hardware patch that will have the devices cleanly reset when the sun returns. Better power management, such as entering low power modes for self protection, can be created as a separate issue.

travisgoodspeed commented 7 years ago

Some quick experiments with an AVR feather seem to show that it does not suffer from this issue. So it's just the M0 boards that we need to fix.

travisgoodspeed commented 7 years ago

This is the log of KK4VCZ-17 restarting three times with a dead battery. If we can't close this issue, then AVRs might be a better choice for unattended repeaters in hard to reach places.

dell13% finger KK4VCZ-17@loraham.org
BEACON KK4VCZ-17 2600mAh AVR32 VCC=3.770 count=0 uptime=1 2016-12-05 10:10:01.648304 +0000 +0000
BEACON KK4VCZ-17 2600mAh AVR32 VCC=3.764 count=0 uptime=1 2016-12-05 10:08:11.629325 +0000 +0000
BEACON KK4VCZ-17 2600mAh AVR32 VCC=3.757 count=0 uptime=1 2016-12-05 10:03:51.606959 +0000 +0000
BEACON KK4VCZ-17 2600mAh AVR32 VCC=3.519 count=1594 uptime=372767379 2016-12-05 10:01:11.640424 +0000 +0000
BEACON KK4VCZ-17 2600mAh AVR32 VCC=3.519 count=1593 uptime=372299957 2016-12-05 09:56:21.581669 +0000 +0000
BEACON KK4VCZ-17 2600mAh AVR32 VCC=3.512 count=1592 uptime=371832829 2016-12-05 09:51:21.580105 +0000 +0000
BEACON KK4VCZ-17 2600mAh AVR32 VCC=3.512 count=1591 uptime=371365994 2016-12-05 09:46:21.575483 +0000 +0000
BEACON KK4VCZ-17 2600mAh AVR32 VCC=3.512 count=1590 uptime=370899452 2016-12-05 09:41:21.573903 +0000 +0000
BEACON KK4VCZ-17 2600mAh AVR32 VCC=3.512 count=1589 uptime=370433203 2016-12-05 09:36:21.549579 +0000 +0000
BEACON KK4VCZ-17 2600mAh AVR32 VCC=3.512 count=1588 uptime=369967248 2016-12-05 09:31:11.543997 +0000 +0000
dell13% 
akadamson commented 7 years ago
I'm a bit late to this specific discussion... BUT I think I might know what the issue is with your brownout bug. or maybe better put how to work around it. I have a SAMD21 project that is an M0+ and I have an STM32F0 that is M0 based and they both suffer from a similar problems when running on a *slowly* ramping and variable power supply - solar. in the case of the STM I tracked it specifically down, but have seen it also effect the SAMD as well what happens is that the internal LDO in the chip can be *glitched* on a solar type slow power up ramp, one that can vary around the mininum startup voltage I didn't look specifically at the SAMD specs, but they are usually a 2.0v min voltage part (may be 1.8v). The trick is to use a CPU supervisor to hold the chip in reset until the min voltage rises .2-.3v above the min voltage; These are the ones that I use - http://rohmfs.rohm.com/en/products/databook/datasheet/ic/power/voltage_detector/bd48xxg-e.pdf They are available in .1v steps so you can pick anything you want. I've not looked at how easy or hard they might be to graft into a feather but on the 2 platforms that I have that are M0(x) based, they have solved all of the *startup*, Brownout, POR reset issues with both of them Note, you can get them in OD or PP as needed

I typed all the above into the irc channel, but decided to include it here. I suspect, based upon my experience with the 2 processors mentioned that the brownout bug that these M0 parts have when on slow, variable, to ramp solar, can be remedied with the above addition.