Sleep while charging until certain threshold (Electron)

@fishmastaflex I’m testing a Electron with a small 3w solar panel and I was seeing the same issue as you where the Electron would lock up if the battery went dead overnight.

So I wrote some code to put the Electron to deep sleep when the battery SOC hit 20% and had the Electron wake up every hour to see if the SOC was above 20% via solar chargin yet and if it was it started sending data again and if not then it just went back to sleep for 1 hour again.

My code is here and Bdub just added some code of his own to do the same thing: Bug Bounty: Electron not booting after battery discharges completely

2 Likes