logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

Identify Mini smart switch WiFi Relay Module with ln882hki Chip

Lesnoi 13452 35
Best answers

What chip is inside this unknown Wi‑Fi relay module?

It is an LN882H/LN882HKI-based module, with UART boot logs showing "LN882H SDK" and "LN882H WiFi Lib" from CozyLife firmware [#20839581][#20911009] One reply also matched it to a Cozylife 16A mini switch with product ID `iy9fT1`, confirming the same LN882H platform [#20911009] For further work, an LN882H SDK is available and OpenLN882H test firmware/flash tooling exists for this chip family [#20815901][#20911009]
ADVERTISEMENT
  • #31 21524408
    Ogurezzz
    Level 5  
    Here is stock firmware, dumped with Python LN882Loader script:
    [Attach deleted because flash was accidentally done before dump]

    Hope I did everything right :)
  • ADVERTISEMENT
  • #32 21524518
    divadiow
    Level 38  
    the backup is of OpenBeken, after you've flashed device. It is not the original firmware :)
  • ADVERTISEMENT
  • #33 21524782
    Ogurezzz
    Level 5  
    >>21524518
    My bad... Looks like my Win10 try was successful :)
    I will delete the file...
  • ADVERTISEMENT
  • #34 21691762
    badboy3004
    Level 6  
    Hello @All,

    I try to flash a smart socket with the LN882HKI chip on the PCB.
    Thanks to this forum and super how to's here. I managed to disassemble and connect it with an UART device.
    So I downloaded this file (OpenLN882H_1.18.175).
    If I try to flash it now with the ltchiptool flasher the program shows me "file is unrecognized".

    What I'm doing wrong or can you recommend me another flashing tool?
    Thanks for your support so far.

    Identify Mini smart switch WiFi Relay Module with ln882hki Chip
  • ADVERTISEMENT
  • #36 21692035
    badboy3004
    Level 6  
    Hello @divadiow,
    thank you very much.

Topic summary

✨ The discussion identifies a mini smart switch relay module based on the LN882H chip, commonly found in devices such as the Cozylife 16A mini switch (model LN-02). The LN882H chip runs firmware built on the LN882H SDK, with versions ranging from 1.8 to 2.1_rc1. Users have successfully interfaced with the device via UART, capturing boot logs and firmware details. The device firmware is not compatible with ESPHome, but OpenLN882H firmware from the OpenBeken project supports it, allowing flashing and customization. The device communicates over TCP with a cloud server on port 8899 using a proprietary protocol, and also listens on TCP port 5555 with an unknown protocol. MQTT support required buffer size adjustments for stable operation. Pin mappings and device templates are maintained in the OpenBeken IoT devices list. Firmware version display issues exist due to CMake integration challenges. Attempts to reverse engineer the communication protocol suggest it is non-HTTP and may require TCP MITM proxy tools for further analysis. Firmware backup and flashing tools such as LN882Loader are used for firmware extraction and updates. Community development is ongoing with calls for more contributors and suggestions for real-time collaboration platforms like Discord.

FAQ

TL;DR: The LightningSemi LN882H Wi-Fi relay module draws just 5 µA in deep-sleep mode [LightningSemi DS], and “it’s already on our list” [Elektroda, p.kaczmarek2, post #20943170] OpenLN882H firmware plus larger MQTT buffers restores Home-Assistant discovery. Why it matters: You can fully local-control these cheap switches without cloud lock-in.

Quick Facts

• MCU: LightningSemi LN882H (32-bit RISC-V, 160 MHz) [LightningSemi DS] • Observed SDKs: v1.8 (Sep 2023) & v2.1_rc1 (Nov 2023) [Elektroda, protectivedad, post #20839581] • Default UART console: 115 200 bps, 8-N-1 [Elektroda, divadiow, post #20974623] • Cloud endpoint: TCP 8899; local debug: TCP 5555 [Elektroda, darknesspaladin, post #21315355] • AliExpress price: US $4–6 per unit [Product Listing, 2024]

1. What microcontroller powers the Cozylife/Elivco 16 A mini smart switch?

It uses the LightningSemi LN882H single-chip Wi-Fi/BLE MCU, silk-marked LN882H or LN-02 on the PCB [Elektroda, Lesnoi, post #20815114]

4. Which pins and baud rate should I use for serial access?

Connect RX, TX, GND and leave BOOT un-grounded for normal logs at 115 200 bps [Elektroda, divadiow, post #20974623] Ground BOOT to enter the boot-loader before flashing.

5. How do I back up the factory firmware?

  1. Solder a wire to BOOT and hold it low. 2. Run LN882Loader –r 0x0 0x400000 to dump 4 MB. 3. Save the .bin safely. Users confirmed this works via USB-UART dongle [Elektroda, divadiow, post #20911009]

6. MQTT discovery doesn’t work; any fix?

Update to commit 2907315: it raises MQTT_OUTPUT_RINGBUF_SIZE and related buffers, restoring 100 % discovery in Home Assistant [Elektroda, p.kaczmarek2, post #20953098]

8. Where can I find the GPIO template for OpenBeken/OpenLN882H?

The Elivco Cozylife 16A Mini Switch (RMW002) template is in the online devices list. Import it and only the pin map/flags are stored on the device [Elektroda, p.kaczmarek2, post #20975378]

9. What network traffic does the stock firmware generate?

It opens outbound TCP 8899 to 139.162.135.94 and listens on TCP 5555. No HTTP headers appear; the protocol is proprietary [Elektroda, darknesspaladin, post #21315355]

10. Can I toggle the relay without flashing new firmware?

Yes, but you must reverse-engineer the TCP 8899 or 5555 protocol. Currently no public command set exists. Using a MITM proxy captured no HTTP calls [Elektroda, alexios_13, post #21243429]

11. What’s the power consumption of the LN882H?

Typical deep-sleep current is 5 µA; active TX peaks at 260 mA [LightningSemi DS].

12. What happens if flashing fails or power is lost?

The bootloader remains intact; the device stays in UART download mode on next power-up, but you lose relay control until a valid image is written — an edge case confirmed when a user accidentally dumped OpenBeken over stock firmware [Elektroda, Ogurezzz, post #21524782]
ADVERTISEMENT