Put Electron to sleep but keep fuel gauge awake on 1.5.0

I have a few Electrons running DeviceOS 1.4.4.
They go to sleep (stop mode) and wake up every minute. I’ve been using this setup successfully for some time now. Upon waking up they read the battery soc to determine which power mode to use.

Since DeviceOS 1.5.0 it appears that the fuel gauge is always put to sleep. This prevents the soc from updating. Some workarounds I’ve read about is to call fuel.wakeup() and then a delay of at least 500 ms. This seems like a waste of power.

Is there any way to use sleep with DeviceOS 1.5.0 or later and not put the fuel gauge to sleep? If not this seems like a major flaw which means I’m stuck on 1.4.4. In previous DeviceOS versions you had SLEEP_MODE_SOFTPOWEROFF which also put the fuel gauge to sleep if you wanted that option.

Not a direct answer to your question, but what are you doing every minute?
Do you really anticipate that the SoC changes very rapidly over the course of a single minute?
When you do fuel.wakeup() with a subsequent 500ms delay (which you could use to do the actual work you want done) only every 15 minutes I’d guess the power loss would be greatly reduced without really losing that much of SoC accuracy.

1 Like

I’m taking weather readings and publishing it to a server.

I don’t anticipate it changing that quickly, but it was always so easy to read the SoC on every wake that I just did it anyway.

I don’t really see why we need to loose that functionality?

I don’t think that option is lost.

If power usage is a concern then switching off/sleeping the fuel gauge will contribute to that cause.

Sure there should be a fine grained way to tell the system what you want on or off during the sleep period (not saying there isn’t already) but having a single default always means compromises.

When stats of thousands of devices show that “most” sleepy devices sleep for longer periods and hence it would be beneficial to this majority to facilitate the extra saving by defaulting to sleeping the fuel gauge while still allowing the other (short sleeping) devices to keep it awake (which I haven’t investigated how to) or wake it when needed, it makes sense to me.

Maybe @rickkas7 or other members have some idea how to keep the fuel gauge awake for short Stop Sleep periods (in the new, upcoming sleep mode feature - currently we still are in the transitioning phase, so not all planned features may be available yet, but that doesn’t mean they won’t come).

Yes it makes sense catering for the majority.

I like the new power manager implemented so I would like to stay on the latest deviceOS but if need be I’ll just stay on 1.4.4.

Any help on keeping the fuel gauge awake at all times on the latest DeviceOS would be greatly appreciated!

Another approach would probably be to compile my own version of the firmware but that’s a can of worms I’d rather not open.

1 Like

@rickkas7 I would really appreciate your input on this.

I did some more digging and found this Using Fuel Gauge battery efficiently, without Deep Sleep and this Using Fuel Gauge battery efficiently, without Deep Sleep which I think is still really relevant.

I’ve found another reason why I would like to keep the fuel gauge awake. When low SoC is detected, an Electron is usually put in deep sleep. If the battery is recharged while the device is asleep it could take really long for the fuel gauge to realize that the battery is full because it is only on for a really short time.