Argon - protect device from low battery voltage

@ctmorrison, you are using the webhook call to get data to ubidots using:

    bufferSent = ubidots.send(WEBHOOK_NAME,PUBLIC); //will use Particle webhook to send

You specify PUBLIC for the Particle.publish() which normally would not be an issue but I wonder if this now causing the Assertion failure on 2.0.1LTS. The error might just be timing.

@peekay123 , until the battery gets low, there are no issues whatsoever with the ubidots send. There also were no issues prior to adding the battery code. So, I doubt it’s related.

Hmm, not quite :wink:

non-working

vs. working

all “offending” characters visible :wink:

4 Likes

@ScruffR , that’s why writers needs editors…you often can’t see you own mistakes. Thanks!

1 Like

I’m still having the SOS assertion error, but here’s an update:

I’ve changed the low voltage test to test for less than 4.1 volts so I can watch what happens with particle serial monitor. This results in it always thinking the voltage is sufficiently low that it should go to sleep. I’ve also removed the connection on D8 so the device thinks external power has been lost. The battery voltage is ~3.9Vdc as calculated by analogRead(BATT) * 0.0011224.

If I have the Argon powered via USB or VIN, everything works fine. The device goes to sleep and wakes up as expected. However, if I don’t have power via USB or VIN (just battery power), I get the assertion fault. It appears the call to System.sleep(config) causes the assertion error when battery powered.

Does this provide any additional insight as to what’s happening?