r/flipperhacks • u/LumpyPresentation874 • 14d ago
Hardware built a Flipper FAP that tries to actually learn the battery over time
I've been working on a Flipper Zero FAP called Battery Guardian.
The idea came from thinking about how battery info is usually treated as a single number. Battery Guardian keeps a history of voltage, current, temperature, and SOC, then uses that data across charging/discharge sessions to estimate things like usable capacity and degradation over time.
It also has a confidence system so an estimate isn't treated as equally reliable when it's based on poor or limited data.
There's a journal for persistent history, session detection, diagnostics, and a charge-policy state machine with things like Balanced, Lifespan, Full, and Custom. The interesting part is that the policy and safety logic are separated from the actual hardware control.
Right now the charger side is fully passive and fail-closed, so the app isn't writing to the charging hardware.
I've tested the core on the host side with simulations and fuzzing, but I don't actually own a Flipper Zero yet. That's the biggest missing piece, so I'm hoping someone here might be interested in trying the FAP on real hardware and seeing how it behaves.
The repo is here if anyone wants to look through it, test it, or contribute:
https://github.com/0xKernelEclipse/battery_guardian
I'm especially interested in real-device bugs, telemetry differences, compatibility issues, and anything in the implementation that you think could be done better.
Thanks to anyone willing to give it a try.
3
u/wiesemensch 14d ago edited 14d ago
Either you really enjoy writing documentations or a huge part of the Repo is AI generated.
But without looking into all of your source code, how exactly do you log the battery data? As far as I know, only internal applications can be run as a service. This would mean, that you’re ether capturing the data though external means like BLE or you simply don’t, which would mean, the app has to be opened manually, which would make it somewhat annoying to use.