Hi everyone,
A few weeks ago, I shared my reverse-engineering investigation into the severe battery-drain problem affecting the original Shelly TRV Gen1 (SHTRV-01).
Original investigation:
https://www.reddit.com/r/hardwarehacking/comments/1xd4a6k/
At that point, I was investigating several firmware-level issues involving Wi-Fi power management, Beacon Recovery, sleep-state handling, and the interaction between the EFM32GG11 MCU and the Silicon Labs WF200 Wi-Fi chip.
Since then, the project has progressed quite a bit.
I’ve now released an open-source Python firmware patcher (v2.0) that reconstructs an experimental B2.2 Beta firmware from the original Shelly 2.2.4 firmware.
GitHub repository:
https://github.com/AbleMonster/Shelly-TRV-Gen1-2.2.4-patcher
What changed since my previous post?
The earlier experimental firmware builds were primarily intended to isolate individual problems.
One important finding was that correcting the recurring Beacon-Recovery loop alone did not eliminate the historical battery drain.
I also discovered that one of my own early power-management patches introduced a regression involving temporary power-state overrides. That was corrected in A1R.
The current B2.2 Beta is a more comprehensive integration of nine selected and individually qualified firmware corrections.
The nine integrated corrections
A1R – Host power management
Corrections involving the lifecycle of power-management requests, including timeout handling, completion races, cleanup, and temporary state overrides.
C-C – Beacon-Recovery logic
Corrections to the interpretation and validity of the measurements used to trigger Beacon Recovery.
Unlike my first experimental patch, this does not simply disable the recovery mechanism.
B2 – Sleep-inhibit reference counting
Bounded synchronization of shared sleep-blocker counters to prevent race conditions that could leave phantom contributions or remove legitimate ones.
MQTT PUBLISH guard
A narrowly scoped input-validation correction for a separately investigated malformed-input failure.
WF200 3.18.0
Integration of the official Silicon Labs WF200 3.18.0 radio firmware while retaining Shelly’s existing FMAC 3.7.0 host-side integration.
Calibration Restore Guard
Prevents a successfully completed calibration-restore operation from unintentionally scheduling itself again.
P01 – Battery ADC
Corrects incomplete resource cleanup after an ADC timeout.
P02 – I²C
Adds bounded cleanup for an unfinished synchronous I²C transaction following a timeout.
P03 – WLAN GPIO
Corrects an interrupt-mask error in the Wi-Fi GPIO notification handling.
These are firmware defects or implementation issues identified through reverse engineering and targeted qualification.
However, I cannot claim that every correction contributes directly to reducing battery consumption. Their individual electrical impact has not been isolated.
The firmware patcher
One challenge was making the experimental corrections reproducible without distributing modified proprietary firmware binaries.
The result is a Python-based binary patcher.
It accepts only the exact original Shelly TRV Gen1 firmware build:
20240619-130912/v2.2.4@ee290818
The patcher:
- Verifies the original firmware using SHA-256.
- Checks the expected binary structure.
- Applies the selected corrections.
- Reconstructs the modified ARM application.
- Rebuilds the OTA-compatible GBL package.
- Verifies the resulting firmware against qualified reference hashes.
- Rejects unsupported or unexpected input firmware.
The generated application and GBL have been verified byte-for-byte against the qualified B2.2 reference artifacts.
The patcher passed its existing 18 automated regression tests.
A local HTTP OTA server is also included.
No original or modified Shelly firmware binaries are distributed in the repository.
The entire reconstruction process happens locally using the user’s own original firmware.
Technical documentation:
https://github.com/AbleMonster/Shelly-TRV-Gen1-2.2.4-patcher/blob/main/docs/technical-details.md
Physical hardware testing
The current B2.2 Beta has been running on six physical Shelly TRV Gen1 devices since November 2, 2026.
The published evaluation from November 16 covers more than 13 days.
For comparison, historical Stock firmware measurements showed multiple devices dropping from approximately 95% to 0% reported battery level in around six days.
That complete rapid-depletion pattern has not recurred in the regular B2.2 test fleet during the first 13+ days.
Four devices with comparable battery-voltage histories showed relatively gradual declines in the long-term comparison.
Two unusually low voltage readings were separately documented and provisionally excluded from the comparison graph.
One subsequently recovered. The other remains under observation.
A separate TRV still running original Stock 2.2.4 firmware continues to show recurring Beacon-Recovery activity, approximately once per minute.
In the available B2.2 observations, there is no comparable persistent recovery loop.
However, I want to be careful about interpreting these results.
This is not a simultaneous, fully matched A/B test. Battery voltage is not a direct measurement of consumed energy or remaining battery capacity.
The results are encouraging, but they do not establish a quantified battery-life improvement or prove the definitive root cause of the original drain.
Long-term battery report:
https://github.com/AbleMonster/Shelly-TRV-Gen1-2.2.4-patcher/blob/main/docs/B2.2_long_term_battery_stability_report.md
The next problem: unexpected resets
While the initial battery behavior looks promising, the B2.2 firmware has revealed another issue that I am currently investigating.
Several test devices have experienced unexpected automatic restarts.
Some also showed unusually large increases in their firmware reboot counters.
I reverse-engineered the relevant counter implementation and found that the counter values cannot simply be interpreted as a corresponding number of independently confirmed physical resets.
The cause remains unknown.
I have been investigating:
- Reset and exception handling
- Watchdog configuration and execution paths
- WLAN mutex and SDIO timeout behavior
- Early boot execution
- EFM32 reset-cause registers
- Retained SRAM
- Main stack pointer initialization and reserved memory
The current research has progressed to an isolated early-boot diagnostic Observer prototype.
The idea is to capture the raw hardware reset-cause register before normal startup code potentially modifies the evidence, preserve the result in a small integrity-checked diagnostic record, and make that record readable through the firmware’s diagnostics.
Initial ARM Thumb instruction-level tests have been successful, but the complete Observer is not yet qualified for physical deployment.
No diagnostic firmware has been flashed to the existing test fleet.
The reset root cause is still unknown.
This is documented in GitHub Issue #2:
https://github.com/AbleMonster/Shelly-TRV-Gen1-2.2.4-patcher/issues/2
Why I’m sharing this
I wanted to follow up on my previous post now that the work has progressed from isolated experimental patches to a reproducible, open-source firmware patcher.
B2.2 is still beta firmware, and the unresolved automatic restarts mean I do not consider it suitable for installations requiring uninterrupted thermostat operation.
I’m particularly interested in feedback from people experienced with:
- ARM Cortex-M / Thumb firmware binary patching
- EFM32GG11 reset-cause handling
- Retained SRAM across reset and low-power states
- Early boot instrumentation without source code
- Reliable fault diagnosis in battery-powered embedded systems
If anyone has worked on similar problems, especially capturing trustworthy reset-cause evidence on Silicon Labs EFM32 devices without interfering with normal startup, I’d be interested in your experiences.
GitHub:
https://github.com/AbleMonster/Shelly-TRV-Gen1-2.2.4-patcher
This is an independent reverse-engineering project, not an official Shelly firmware release.
I will continue documenting the findings, including negative test results and unresolved issues.