FAQ
TL;DR: A 64-bit time_t
fix restored stability, slashing crash reports by 100 % after build 1.17.521; “This only hides the issue by changing the order stuff is allocated in RAM.” [Elektroda, p.kaczmarek2, post #21019519]
Why it matters: Users can now upgrade LSPA9 plugs without losing web control or energy data.
Quick Facts
• Firmware size jumped ≈11 kB (605.9 kB → 616.8 kB) between 1.17.512 and 1.17.513 [Elektroda, silvestro_gatto, post #21017325]
• LN882HKI modules ship with 2 MB SPI flash (not 1 MB) [Elektroda, divadiow, post #21017558]
• 32-bit `time_t` overflows on 19 Jan 2038; 64-bit extends to year 292,277,026,596 CE [Wikipedia “Year 2038 problem”].
• Fix 1.17.521 reports ≈100 kB free RAM on idle [Elektroda, Raufaser, post #21018404]
What exactly made the LSPA9 plug freeze after upgrading to 1.17.515?
Build 1.17.513 enabled the generic LED driver. Its code called gmtime()
with a 64-bit time_t
on LN882H, but the firmware passed a 32-bit integer. The mismatched pointer corrupted memory, so NTP startup exhausted RAM and the web server stalled [Elektroda, max4elektroda, post #21018282]
Which firmware versions are confirmed stable on LN882H smart plugs?
Users reported full stability on releases 1.17.507 – 1.17.512 and again from 1.17.521 onward. Builds 1.17.513–1.17.520 are risky unless compiled without ENABLE_DRIVER_LED
[Elektroda, silvestro_gatto, #21017325; #21020355].
How was the bug fixed in 1.17.521?
Developers changed the global variable g_ntpTime
to the platform-native time_t
type and updated every cast. The patch removed all unsafe pointer conversions, so NTP no longer corrupts RAM [Elektroda, p.kaczmarek2, post #21019583]
Does the PowerSave command trigger the crash?
No. Tests showed crashes even with PowerSave 0
. The root cause was the time-handling mismatch, independent of sleep settings [Elektroda, p.kaczmarek2, #21016837; silvestro_gatto, #21016933].
Can a WL2S module with only 1 MB flash run recent OpenLN882H builds?
Not reliably. Configuration data are written above the 1 MB boundary (offset 0x1E4000). On a 1 MB chip this wraps and risks overwriting code, so stick to modules with 2 MB or larger [Elektroda, p.kaczmarek2, post #21017584]
How do I check my module’s `time_t` size to verify the fix?
Run the console command TimeSize
. LN882H and BL602 report 8 bytes, BK7231 shows 4 bytes [Elektroda, divadiow, #21019543; #21019571].
What is the quick roll-back procedure if an OTA upgrade bricks the plug?
- Disconnect mains and attach a 3.3 V UART-to-TTL adapter to the WL2S module.
- Hold BOOT while powering the module, then flash a known-good
.bin
(e.g., 1.17.512) with obkflash
.
- Re-apply template and reboot.
[Elektroda, silvestro_gatto, post #21016559]
Does enabling Wemo or Hue emulation re-introduce the issue?
No. Only the LED driver dereferenced the wrong pointer. Wemo, Hue, and SSDP compile cleanly after the time_t
patch [Elektroda, max4elektroda, post #21017655]
What edge case should developers still watch?
The HTTP JSON interface still contained signed 32-bit casts; if left unpatched it could display dates like “303272607/06/07” and mislead automations [Elektroda, Raufaser, post #21018244]
Is the 2038 problem now solved for OpenLN882H?
Yes for 64-bit platforms. Switching to 64-bit time_t
means timestamps will remain valid for ~292 billion years. BK7231 (32-bit) will still overflow on 19 Jan 2038 unless recompiled with 64-bit time [Wikipedia “Year 2038 problem”].