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 14739 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
  • #1 20815114
    Lesnoi
    Level 6  
    Posts: 14
    Rate: 3

    I got a relay on an unknown chip, maybe someone knows what kind of chip it is? Electronic circuit with visible components on a circuit board. Close-up of a circuit board with a chip labeled LN82XHKI.
  • ADVERTISEMENT
  • #2 20815229
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12660
    This search may be related:
    https://www.elektroda.com/rtvforum/find.php?q=ln882
    Where did you order this device?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20815721
    Lesnoi
    Level 6  
    Posts: 14
    Rate: 3

    I got them on AliExpress. as I understand it, their firmware is impossible?
  • #4 20815901
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12660
    Maybe it's possible, there is some SDK:
    https://github.com/lightningsemi/ln882h
    Can you check whether the flash tool is also present there? Is the flash tool able to read and write the device flash via UART?

    Another problem would be that I dont have this kind of chip at hand.
    Helpful post? Buy me a coffee.
  • #5 20820538
    Lesnoi
    Level 6  
    Posts: 14
    Rate: 3
    Can I somehow help with development?
  • #6 20820592
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12660
    Hello, are you referring to OBK development in general or to LN882H?

    You can try to test the LN882H flash tool, you can try porting OBK to this platform (I can tell you how, if you're interested), you can also make a donation: https://paypal.me/openshwprojects
    Helpful post? Buy me a coffee.
  • #7 20839581
    protectivedad
    Level 9  
    Posts: 40
    Help: 2
    Rate: 5
    I hooked up the uart and it keeps repeating:
    ------  wifi_mcu_basic_example  ------


    While I was connecting the 3.3v lead it started up the CozyLife code:
    TCP/IP initialized.
    LN882H SDK Ver: 1.8 [build time:Sep  9 2023 08:53:42][0x010800ff]
    
        ____               _     _  __
       / ___|___ _____   _| |   (_)/ _| ___
      | |   / _ \_  / | | | |   | | |_ / _ \
      | |__| (_) / /| |_| | |___| |  _|  __/
       \____\___/___|\__, |_____|_|_|  \___|
                     |___/
    
    
    cozylife_app_info
    CozyLife SDK Version: 0.6.0
    CozyLife SDK Build Sep  9 2023 08:53:37
    
    cozylife_app_info
    Product Id: iy9fT1
    Firmware Version: 1.0.1
    Firmware Build Sep  9 2023 08:53:44
    
    
    device id:DELETED
    
    1609473600 [L] [     lib_log] udplog_init on: 0, 192.168.2.2:7789
    1609473600 [L] [    lib_wifi] wifi_start_connect
    [WLIB_I]cap_comp = 0, xtal_capbank_tab:[0]:40 [1]:35 [2]:35 [3]:35 [4]:50 [5]:70 [6]:70 [7]:70
    [WLIB_I][original]phy_tab_1f:0x4C, phy_tab_20:0x3C
    [WLIB_I][efuse]phy_tab_1f:0x54, phy_tab_20:0x44
    [WLIB_I][flash]phy_tab_1f:0x54, phy_tab_20:0x44, tx_pwr_comp_all=0, tx_pwr_comp_b=0, tx_pwr_comp_gn=0
    [WLIB_I]==>temp_sect:2,phy_tab_1f:0x54,phy_tab_20:0x44
    [WLIB_I]<==temp_sect:2,phy_tab_1f:0x54,phy_tab_20:0x44
    [WLIB_I]LN882H WiFi Lib Ver(CozyLife-230526.1): 1.1.3 [build time:May 26 2023 18:45:35][0x010103ff]
    [WLIB_I]STA_Startup.
    [WLIB_I]Disconnected.
    [WLIB_E]HwEr:UKI:0
    psk value :
    00000000:  DELETED
    00000010:  DELETED
    00000020:  DELETED
    1609473601 [L] [    lib_wifi] wifi connecting to ssid: DELETED  passwd: DELETED
    STA startup!
    [WLIB_I]Disconnected.
    [WLIB_I]Status: Scan Successful. Initaiting Join:
    [WLIB_I]SSID      = DELETED
    [WLIB_I]BSSID     = DELETED
    [WLIB_I]Channel   = 3
    [WLIB_I]RSSI      = -70
    [WLIB_I]StationID = DELETED
    [WLIB_I]Status: Initiating Authentication.
    [WLIB_I]Status: Authentication Successful. Initiating Association.
    [WLIB_I]Peer's HT-Capabilities:
    [WLIB_I]ht_capable             = 1
    [WLIB_I]ldpc_cod_cap           = 0
    [WLIB_I]smps_mode              = 3
    [WLIB_I]greenfield             = 0
    [WLIB_I]short_gi_20            = 1
    [WLIB_I]short_gi_40            = 1
    [WLIB_I]rx_stbc                = 0
    [WLIB_I]max_rx_ampdu_factor    = 3
    [WLIB_I]min_mpdu_start_spacing = 6
    [WLIB_I]htc_support            = 0
    [WLIB_I]sta_amsdu_maxsize      = eff
    [WLIB_I]chan_width             = 1
    [WLIB_I]dsss_cck_40mhz         = 1
    [WLIB_I]Status: Association Successful.
    [WLIB_I]Connected.
    STA connected to target AP!
    1609473602 [L] [    lib_wifi] wifi_connect
    [WLIB_I]xtal_temp_cal.curr_sect=3,last_sect=2
    [WLIB_I]==>temp_sect:3,phy_tab_1f:0x54,phy_tab_20:0x44
    [WLIB_I]<==temp_sect:3,phy_tab_1f:0x54,phy_tab_20:0x44
    +--------------- net device info ------------+
    |netif hostname: sta                         |
    |netif ip      = DELETED
    |netif mask    = 255.255.255.0               |
    |netif gateway = DELETED
    |netif mac     : DELETED
    +--------------------------------------------+
    1609473609 [L] [    lib_wifi] wifi_get_iP
    1609473609 [L] [   lib_mainw] ip: DELETED
    [WLIB_I]xtal_temp_cal.curr_sect=2,last_sect=3
    [WLIB_I]==>temp_sect:2,phy_tab_1f:0x54,phy_tab_20:0x44
    [WLIB_I]<==temp_sect:2,phy_tab_1f:0x54,phy_tab_20:0x44
    adc raw:  792, temp_IC:   33
    Total:135436; Free:104080;
    adc raw:  792, temp_IC:   33
    Total:135436; Free:104168;
    adc raw:  794, temp_IC:   34
    Total:135436; Free:104080;
    

    I don't know how I got it to run and I haven't been able to do it again.
  • ADVERTISEMENT
  • Helpful post
    #8 20911009
    divadiow
    Level 38  
    Posts: 5089
    Help: 441
    Rate: 900
    I also have this Cozylife 16A mini switch with LN-02 - https://www.aliexpress.com/item/1005006127262082.html

    I've captured the boot log and it has the same product ID, but a newer firmware.

    [14:09:36.925] - serial type is general
    [14:09:36.965] - Open COM10 Success
    [14:09:41.512] - ------  wifi_mcu_basic_example  ------
    [14:09:42.053] - TCP/IP initialized.
    [14:09:42.058] - LN882H SDK Ver: 2.1_rc1 [build time:Nov 28 2023 09:34:26][0x02010001]
    [14:09:42.059] -     ____               _     _  __
    [14:09:42.060] -    / ___|___ _____   _| |   (_)/ _| ___
    [14:09:42.066] -   | |   / _ \_  / | | | |   | | |_ / _ \
    [14:09:42.068] -   | |__| (_) / /| |_| | |___| |  _|  __/
    [14:09:42.069] -    \____\___/___|\__, |_____|_|_|  \___|
    [14:09:42.070] -                  |___/
    [14:09:42.071] - cozylife_app_info
    [14:09:42.072] - CozyLife SDK Version: 0.6.0
    [14:09:42.073] - CozyLife SDK Build Nov 28 2023 09:34:21
    [14:09:42.074] - cozylife_app_info
    [14:09:42.074] - Product Id: iy9fT1
    [14:09:42.075] - Firmware Version: 1.0.2
    [14:09:42.080] - Firmware Build Nov 28 2023 09:34:28
    [14:09:42.081] - device id:
    [14:09:42.083] - 1609473600 [L] [     lib_log] udplog_init on: 0, 192.168.2.2:7789
    [14:09:42.085] - 1609473600 [L] [     lib_ble] ble mac: e8:73:f0:c2:50:00
    [14:09:42.827] - [BLIB_I]BLIB Ver: 1.0.5 [build time:Aug  7 2023 17:33:27][0x010005ff]
    [14:09:42.829] - 1609473600 [L] [     lib_ble] bt_event_bleenabled
    [14:09:42.834] - [WLIB_I]cap_comp = 0, xtal_capbank_tab:[0]:40 [1]:35 [2]:35 [3]:35 [4]:50 [5]:70 [6]:70 [7]:70
    [14:09:42.837] - [WLIB_I][original]phy_tab_1f:0x4C, phy_tab_20:0x3C
    [14:09:42.839] - [WLIB_I][efuse]phy_tab_1f:0x50, phy_tab_20:0x40
    [14:09:42.841] - [WLIB_I][flash]phy_tab_1f:0x50, phy_tab_20:0x40, tx_pwr_comp_all=0, tx_pwr_comp_b=0, tx_pwr_comp_gn=0
    [14:09:42.844] - [WLIB_I]==>temp_sect:2,phy_tab_1f:0x50,phy_tab_20:0x40
    [14:09:42.846] - [WLIB_I]<==temp_sect:2,phy_tab_1f:0x50,phy_tab_20:0x40
    [14:09:42.851] - [WLIB_I]LN882H WiFi Lib Ver: 1.3.0 [build time:Oct  8 2023 11:17:49][0x010300ff][for Cozylife Commit-a353a99a]
    [14:09:42.852] - [WLIB_I]STA_Startup.
    [14:09:42.855] - [WLIB_I]Disconnected.
    [14:09:42.856] - [WLIB_E]HwEr:UKI:0
    [14:09:42.856] - STA startup!
    [14:09:43.623] - 	CH= 6,RSSI= -45,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:43.626] - 	CH= 6,RSSI= -48,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:43.628] - 	CH= 1,RSSI= -65,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:43.630] - 	CH= 1,RSSI= -67,BSSID:[MACADDR],SSID:""
    [14:09:43.632] - 	CH=11,RSSI= -73,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:43.636] - 	CH= 1,RSSI= -86,BSSID:[MACADDR],SSID:""
    [14:09:43.637] - 	CH= 1,RSSI= -90,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:43.640] - 	CH= 1,RSSI= -90,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:43.642] - 	CH= 1,RSSI= -90,BSSID:[MACADDR],SSID:""
    [14:09:43.644] - 	CH= 1,RSSI= -91,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:43.644] - [WLIB_I]Disconnected.
    [14:09:43.647] - AP01  rssi:-45  channel:6  ssid:fakewifi
    [14:09:43.648] - AP02  rssi:-48  channel:6  ssid:fakewifi
    [14:09:43.650] - AP03  rssi:-65  channel:1  ssid:fakewifi
    [14:09:43.653] - AP04  rssi:-67  channel:1  ssid:
    [14:09:43.655] - AP05  rssi:-73  channel:11  ssid:fakewifi
    [14:09:43.656] - AP06  rssi:-86  channel:1  ssid:
    [14:09:43.658] - AP07  rssi:-90  channel:1  ssid:fakewifi
    [14:09:43.660] - AP08  rssi:-90  channel:1  ssid:fakewifi
    [14:09:43.661] - AP09  rssi:-90  channel:1  ssid:
    [14:09:43.662] - AP10  rssi:-91  channel:1  ssid:fakewifi
    [14:09:43.832] - [WLIB_I]LN882H WiFi Lib Ver: 1.3.0 [build time:Oct  8 2023 11:17:49][0x010300ff][for Cozylife Commit-a353a99a]
    [14:09:43.834] - [WLIB_I]STA_Startup.
    [14:09:43.835] - [WLIB_I]Disconnected.
    [14:09:43.836] - [WLIB_E]HwEr:UKI:0
    [14:09:43.838] - STA startup!
    [14:09:45.281] - 	CH= 6,RSSI= -45,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:45.284] - 	CH= 6,RSSI= -48,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:45.286] - 	CH= 1,RSSI= -65,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:45.287] - 	CH= 1,RSSI= -65,BSSID:[MACADDR],SSID:""
    [14:09:45.290] - 	CH=11,RSSI= -74,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:45.292] - 	CH=11,RSSI= -88,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:45.293] - 	CH= 1,RSSI= -90,BSSID:[MACADDR],SSID:""
    [14:09:45.295] - 	CH= 1,RSSI= -90,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:45.298] - 	CH= 1,RSSI= -90,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:45.300] - 	CH= 1,RSSI= -90,BSSID:[MACADDR],SSID:""
    [14:09:45.302] - 	CH= 1,RSSI= -91,BSSID:[MACADDR],SSID:"fakewifi"
    [14:09:45.303] - [WLIB_I]Disconnected.
    [14:09:45.305] - AP01  rssi:-45  channel:6  ssid:fakewifi
    [14:09:45.307] - AP02  rssi:-48  channel:6  ssid:fakewifi
    [14:09:45.308] - AP03  rssi:-65  channel:1  ssid:fakewifi
    [14:09:45.311] - AP04  rssi:-65  channel:1  ssid:
    [14:09:45.313] - AP05  rssi:-74  channel:11  ssid:fakewifi
    [14:09:45.315] - AP06  rssi:-88  channel:11  ssid:fakewifi
    [14:09:45.316] - AP07  rssi:-90  channel:1  ssid:
    [14:09:45.319] - AP08  rssi:-90  channel:1  ssid:fakewifi
    [14:09:45.320] - AP09  rssi:-90  channel:1  ssid:fakewifi
    [14:09:45.322] - AP10  rssi:-90  channel:1  ssid:
    [14:09:45.323] - AP11  rssi:-91  channel:1  ssid:fakewifi
    [14:09:45.325] - 1609473603 [L] [    lib_wifi] wifi_start_config
    [14:09:45.435] - [WLIB_I]LN882H WiFi Lib Ver: 1.3.0 [build time:Oct  8 2023 11:17:49][0x010300ff][for Cozylife Commit-a353a99a]
    [14:09:45.437] - [WLIB_I]SoftAP_Startup.
    [14:09:45.437] - [WLIB_E]HwEr:UKI:0
    [14:09:45.439] - [WLIB_I]Channel scanning not needed
    [14:09:45.440] - [WLIB_I]User Preferred channel idx 0-0
    [14:09:45.443] - [WLIB_I]Selecting 20MHz ch from One of ... 0
    [14:09:45.444] - [WLIB_I]Selected Channel Tbl Idx 0-0
    [14:09:45.447] - [WLIB_I]AP: Starting network in 0-0
    [14:09:45.448] - [WLIB_I]Connected.
    [14:09:45.450] - [WLIB_I]sta_conn_step_set: CONNECTED
    [14:09:45.452] - [WLIB_I]Status: Start Successful. Entering Enable State.
    [14:09:45.454] - SoftAP startup!
    [14:09:45.455] - +--------------- net device info ------------+
    [14:09:45.458] - |netif hostname: ln_softap                   |
    [14:09:45.459] - |netif ip      = 192.168.4.1                 |
    [14:09:45.462] - |netif mask    = 255.255.255.0               |
    [14:09:45.464] - |netif gateway = 192.168.4.1                 |
    [14:09:45.467] - |netif mac     : [MACADDR]         |
    [14:09:45.468] - +--------------------------------------------+
    [14:09:45.529] - [WLIB_I]Disconnected.
    [14:09:45.531] - [WLIB_I]Channel scanning not needed
    [14:09:45.533] - [WLIB_I]User Preferred channel idx 4-0
    [14:09:45.535] - [WLIB_I]Selecting 20MHz ch from One of ... 0 1 2 3 4
    [14:09:45.538] - [WLIB_I]Selected Channel Tbl Idx 4-0
    [14:09:45.539] - [WLIB_I]AP: Starting network in 4-0
    [14:09:45.540] - [WLIB_I]Connected.
    [14:09:45.542] - [WLIB_I]sta_conn_step_set: CONNECTED
    [14:09:45.544] - [WLIB_I]Status: Start Successful. Entering Enable State.
    [14:09:45.546] - 1609473603 [L] [     lib_ble] ble_start_wifi_cfg
    [14:09:55.054] - [WLIB_I]xtal_temp_cal.curr_sect=3,last_sect=2
    [14:09:55.056] - [WLIB_I]==>temp_sect:3,phy_tab_1f:0x50,phy_tab_20:0x40
    [14:09:55.058] - [WLIB_I]<==temp_sect:3,phy_tab_1f:0x50,phy_tab_20:0x40
    [14:09:56.054] - [WLIB_I]xtal_temp_cal.curr_sect=2,last_sect=3
    [14:09:56.061] - [WLIB_I]==>temp_sect:2,phy_tab_1f:0x50,phy_tab_20:0x40
    [14:09:56.063] - [WLIB_I]<==temp_sect:2,phy_tab_1f:0x50,phy_tab_20:0x40


    I've started a firmware dump and will then proceed with the LN882H test image from @sweetlilmre and @p.kaczmarek2 as discussed in https://www.elektroda.com/rtvforum/topic4008545.html

    I've soldered BOOT in situ Close-up of soldering point on a black circuit board labeled BOOT. Cozylife 16A LN-02 mini switch with attached wire Mini switch Cozylife 16A LN-02 with BOOT wire soldered Close-up of a circuit board labeled LN-02 with a Lightning LN882HKV chip.
    Close-up of a circuit board with soldered pins labeled TX, RX, GND, and 3.3.
    ELIVCO mini smart switch with an app on the phone. Advertisement for Cozylife 16A Wi-Fi switch on AliExpress Digitaling Store.
  • #9 20943151
    Hgo11
    Level 6  
    Posts: 5
    Help: 2
    Rate: 3
    Hello,

    Does anyone have the pin mapping for this switch? Flashed openbeken and forgot to backup old one.

    Thanks!
  • #10 20943170
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12660
    I think it's already on our list:
    Screenshot of an IoT devices list showing two devices in a table.
    Here: https://openbekeniot.github.io/webapp/devicesList.html
    Helpful post? Buy me a coffee.
  • #11 20943231
    Hgo11
    Level 6  
    Posts: 5
    Help: 2
    Rate: 3
    thanks for the swift answer, didn't notice it.
  • #12 20953098
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12660
    It has been brought to my attention that MQTT Discovery fails on LN882H. I've submited a fix:
    https://github.com/openshwprojects/OpenLN882H/commit/29073151d1bc6dada9bb28f818928bba8e06617e
    As usual, we had to increase MQTT buffers, namely:
    - MQTT_OUTPUT_RINGBUF_SIZE
    - MQTT_VAR_HEADER_BUFFER_LEN
    - MQTT_REQ_MAX_IN_FLIGHT
    Still, I haven\t been able to test it myself yet, so let me know if it works for you guys.
    Helpful post? Buy me a coffee.
  • #13 20974595
    silvestro_gatto
    Level 7  
    Posts: 30
    Rate: 4

    >>20911009

    I have some of this Cozylife 16A mini switch with LN-02 and I was able to save original firmware and upload OpenLN882H firmware LN882H_Test_ver_1.17.478.

    I couldn't get any serial output with the original firmware. Could you please tell me which speed you set on the serial port to capture the boot log? Thanks!

    Added after 12 [minutes]:

    >>20943170

    One more question ...

    Could you please explain how to modify the upper part of the Template info ( "vendor" , "bDetailed", "name", "model", "chip", "board",
    "flags", "keywords")? I tried many times to Import the "Elivco Cozylife 16A Mini Switch (RMW002)" Template and apply it, but I can only update the pin settings.

    Screenshot showing a JSON template editor for the Cozylife 16A Mini Switch device.

    I am also getting a "FAILED! Invalid command "lfs_format // clear LFS" error when I click on "Clear OBK and apply new script from above" button

    Screenshot showing template configuration and script execution log for Cozylife 16A mini switch.

    Thank you!
  • #14 20974623
    divadiow
    Level 38  
    Posts: 5089
    Help: 441
    Rate: 900
    silvestro_gatto wrote:
    I have some of this Cozylife 16A mini switch with LN-02 and I was able to save original firmare and upload OpenLN882H firmware LN882H_Test_ver_1.17.478.

    I couldnt get any serial output with the original firmware. Could you please tell me which speed you set on the serial port to capture the boot log? Thanks!


    I think maybe just 115200. Obviously the BOOT pin is not grounded for standard flash boot output. The output logs posted are from factory fw, so you can expect an already-flashed OBK output to be different.

    silvestro_gatto wrote:
    Could you please explain how to modify the upper part of the Template info ( "vendor" , "bDetailed", "name", "model", "chip", "board",
    "flags", "keywords")? I tried many times to Import the "Elivco Cozylife 16A Mini Switch (RMW002)" Template and apply it, but I can only update the pin settings.


    The import function strips this info out anyway and will only apply the pins and flags settings. The export box text is for copying out into a text editor for manual editing and then posting on these forums. If the template posted is unique it'll normally end up being added to the devices list - https://openbekeniot.github.io/webapp/devicesList.html

    silvestro_gatto wrote:
    I am also getting a "FAILED! Invalid command "lfs_format // clear LFS" error when I click on "Clear OBK and apply new script from above" button


    yes. the import/littlefs stuff doesn't seem to be setup for LN882 firmware yet. Manual module config required
  • #15 20975324
    silvestro_gatto
    Level 7  
    Posts: 30
    Rate: 4

    Hi divadiow,
    Thank you for your prompt answer.

    In my past test I tried to log from serial port the factory fw, but (even changing the serial port speed and leaving BOOT disconnected from Ground) I did not get any output in the serial monitor. Just curious what version of factory fw is running on my devices ...

    Btw, is there a way to modify the values of "vendor", "bDetailed", "name", "model", "chip", "board", "flags", "keywords" in the currently running Template and make them consistent with the current hw? Is there any configuration file where these information are stored that can be edited and updated?

    Thanks!
  • #16 20975378
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12660
    All those fields (except flags) are for template only, they are not stored on the device. The idea is that you are supposed to fill them while creating a teardown topic on our forum, and then paste the template in the topic, so we can later add it to https://openbekeniot.github.io/webapp/devicesList.html
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #17 20975465
    silvestro_gatto
    Level 7  
    Posts: 30
    Rate: 4
    Got it!

    Many thanks p.kaczmarek2
  • #18 20998750
    silvestro_gatto
    Level 7  
    Posts: 30
    Rate: 4

    Instead of the text "LN882H_Test", it would be nice to show the current version (i.e. OpenLN882H_1.17.501) both in the footer of each page

    User interface displaying software version LN882H_Test at the bottom of the screen.

    and in the Config Tab of the Web Application

    Screenshot of the Config tab showing current device details with software version LN882H_Test.

    I have several devices running different versions of OpenLN code and Build info is not enough to quickly find the correct version.
  • #19 20999123
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12660
    It seems we need to define USER_SW_VER in Makefile, I will check this out.
    If that's not defined, then a default value is used:
    Screenshot of a code editor displaying the new_common.h file defined in the OpenBK7231T_App.
    Helpful post? Buy me a coffee.
  • #20 21012494
    silvestro_gatto
    Level 7  
    Posts: 30
    Rate: 4

    Hello @p.kaczmarek2,
    I updated the firmware on some LN882H modules and noticed that they are still showing "version LN882H_Test"

    Displayed text showing the software version as LN882H_Test.

    Screenshot of LN882H device information showing details such as firmware version, IP and MAC addresses.

    instead of the current firmware version.

    Is there any timeframe for fixing this issue?

    Thank you!
  • #21 21012498
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12660
    Not yet, we need somebody who knows CMake to look into forwarding the CMake variable to a #define , I have looked into that some time ago but I don't know CMake and I didn't have much time to research that. Here is unfinished PR:
    https://github.com/openshwprojects/OpenBK7231T_App/pull/1123
    Helpful post? Buy me a coffee.
  • #22 21012694
    silvestro_gatto
    Level 7  
    Posts: 30
    Rate: 4
    Thank you for your follow up.
  • #23 21012958
    divadiow
    Level 38  
    Posts: 5089
    Help: 441
    Rate: 900
    maybe there should be an Elektroda Discord to attract more devs, real-time chat etc
  • #24 21019912
    silvestro_gatto
    Level 7  
    Posts: 30
    Rate: 4
    >>21012498

    @p.kaczmarek2 I'm glad that fixing the problem with LN882H time_t size brought some resources to the solution of this issue too. Showing also release info makes more sense than just build date & time and it is consistent with all the other platforms.
  • #25 21206419
    terryb8s
    Level 4  
    Posts: 41
    Help: 1
    Rate: 8
    >>21012958 1 to Discord, I would be keen on this and happy to help as needed with support for stuff I know about, would be nice to have a bit of community for more collaborative conversations etc.

    Obviously understand there may be some reluctance to using Discord as the forum allows for a better recording of the history on a specific topic.
    Helpful post? Buy me a coffee.
  • #26 21243429
    alexios_13
    Level 1  
    Posts: 1
    Anybody knows how these switches communicate from the app.
    I am interested in triggering them without the app but without flashing them.
    I did manage to get a lot of info about the device by using a MITM proxy and starting the Cozy Life app, but when I trigger the switch nothing happens so I suspect that it uses some kind of other protocol than http to trigger the switch over WIFI.
    Thanks !
  • #27 21315355
    darknesspaladin
    Level 1  
    Posts: 1
    >>21243429
    Hello, alexios_13!
    Here's what I know so far:
    1. The device initiates a TCP connection to 139.162.135.94:8899 (apparently for remote control "via the cloud"). The protocol is NOT HTTP/HTTPS, when trying to connect via telnet there is no prompt, banner or server greeting, and there are no error messages when trying to send anything there.
    2. The device accepts incoming connections on TCP/5555. The protocol is unknown, when connecting via telnet there is no greeting or response to the data sent.

    I'll probably do more research, but don't count on me - I only have one of these devices, which I bought inexpensively by mistake, and I have no benefit from researching it unless I can get results quickly.

    I think you can try using Mitmproxy in "Generic TCP" mode -- I saw in its documentation that it can do this.
  • #28 21315819
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12660
    Do you have any captures of their communications, like Wireshark one or something?
    Helpful post? Buy me a coffee.
  • #29 21349628
    vit5041
    Level 1  
    Posts: 1
    Hello All!
    I've got this mini switch with LN882H chip. Tried to flash it with esphome firmware -- it simply doesn't work. Used bk72xx: board: generic-bk7231n-qfn32-tuya then found some OpenLN882H firmware and it's started. Then I am lost and cannot figure out, can I use this board in ESPHOME ? Which board definition in esphome can I use? Thanks a lot for your help.

    Upd. It seems it is not supported in ESPHOME.
  • #30 21350030
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12660
    Esphome does not support many devices, you should rather try:
    https://github.com/openshwprojects/OpenBK7231T_App
    Helpful post? Buy me a coffee.

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: If you have a CozyLife mini switch from AliExpress, 2 strong identifiers are the LN882H/LN882HKI marking and the UART banner; one expert reply says, "OpenLN882H official flasher" is the right tool when ltchiptool rejects the file. This FAQ helps owners identify the chip, back up stock firmware, and avoid common flashing mistakes on LN882H-based relays. [#21691770]

Why it matters: LN882H-based relays look similar to BK7231 devices, but the thread shows they need different tooling, templates, and recovery steps.

Option Works for LN882H thread cases Main use Limitation shown in thread
OpenLN882H official flasher Yes Flashing OpenLN882H_1.18.175 Must back up first
ltchiptool flasher No, file reported unrecognized General flashing attempt Rejected LN882H firmware file
ESPHome with bk72xx generic board No Tried as alternative firmware User reported it simply did not work
OpenBeken/OpenLN882H web template import Partial Apply pins/flags Does not store template metadata on device

Key insight: Treat LN882H as its own platform. The safest path in this thread is: identify the chip by marking or boot log, dump stock firmware first, then flash with the dedicated OpenLN882H tool and configure pins manually if template import is incomplete.

Quick Facts

  • Factory UART captures showed 3.3 V wiring during serial work, 115200 baud as the suggested capture speed, and repeated wifi_mcu_basic_example when the full app log did not appear. [#20974623]
  • Two stock firmware examples in the thread used Product Id iy9fT1, with Firmware Version 1.0.1 built Sep 9 2023 and Firmware Version 1.0.2 built Nov 28 2023. [#20911009]
  • One captured device entered provisioning SoftAP with IP 192.168.4.1/24, while another normal boot obtained a station IP on 192.168.2.x and logged Wi-Fi connection details. [#20911009]
  • Reported network endpoints for unflashed CozyLife behavior were outbound TCP 139.162.135.94:8899 and inbound TCP/5555, with neither protocol identified as HTTP. [#21315355]

How can I identify whether my mini smart switch uses the LN882H or LN882HKI chip before flashing it?

Check the chip marking on the PCB first, then confirm with UART boot output. The thread identifies boards marked LN882H or LN882HKI, and factory logs explicitly print LN882H SDK Ver during boot. If your relay came from AliExpress and shows CozyLife firmware plus that UART banner, treat it as an LN882H-family device before flashing. [#21691762]

What flashing tool should I use for an LN882H smart switch if ltchiptool says the firmware file is unrecognized?

Use the OpenLN882H official flasher instead of ltchiptool. A user reported OpenLN882H_1.18.175 as "file is unrecognized" in ltchiptool, and the reply pointed to the dedicated BK7231GUIFlashTool release for LN882H. Back up the original firmware before writing anything new. [#21691770]

How do I back up the original firmware from a CozyLife LN882H mini switch before installing OpenLN882H or OpenBeken?

Back it up over UART before your first flash. 1. Disassemble the switch and connect UART. 2. Read and save the stock image with an LN882H-compatible loader or flasher. 3. Verify the dump is from stock firmware, not from OpenBeken after flashing. One user accidentally dumped OpenBeken after flashing and had to discard the file. [#21524518]

Why does an LN882H relay sometimes only show repeated "wifi_mcu_basic_example" on UART instead of the full CozyLife boot log?

Because the device may reset into a basic example banner without fully reaching the CozyLife application boot. One report showed repeated ------ wifi_mcu_basic_example ------, but a full log appeared only once while the 3.3 V lead was being connected. That makes power-up timing and boot state a real edge case on these relays. [#20839581]

Which UART baud rate and BOOT pin state should I use to capture the factory boot log from a CozyLife LN882H switch?

Use 115200 baud and leave the BOOT pin ungrounded for normal factory boot output. The thread answer says the posted logs came from factory firmware, not flash mode, and BOOT should not be tied to ground for that capture. That setup is the practical starting point for CozyLife LN882H serial logging. [#20974623]

Where can I find the pin mapping or device template for the Elivco CozyLife 16A Mini Switch RMW002 with LN882H?

Use the OpenBeken devices list entry for the Elivco CozyLife 16A Mini Switch RMW002. The thread says this exact switch was already listed there when a user asked for the pin mapping after flashing. That is the reference point for recovering the correct pins. [#20943170]

How do I apply an OpenBeken template on LN882H when the import only updates pin settings and not fields like vendor, model, or name?

Apply the template for pins and flags only, then edit metadata outside the device. The thread explains that import strips fields like vendor, name, model, chip, board, and keywords, and only applies pins and flags. Those metadata fields belong to the template text for forum submission and device-list curation, not to on-device storage. [#20975378]

Why does OpenLN882H show "LN882H_Test" instead of the real firmware version in the web interface, and how is USER_SW_VER involved?

It shows LN882H_Test because the build used the default software-version string instead of a forwarded custom version. The maintainer said USER_SW_VER needs to be defined in the Makefile, otherwise a default value is used. Later replies added that the CMake-to-#define wiring was still unfinished. [#20999123]

What is MQTT Discovery in OpenBeken/OpenLN882H, and why can it fail on LN882H builds?

"MQTT Discovery" is an integration feature that publishes device details to an MQTT broker, enabling automatic entity setup in home-automation software. In this thread, it failed on LN882H because buffer sizes were too small. A fix increased MQTT_OUTPUT_RINGBUF_SIZE, MQTT_VAR_HEADER_BUFFER_LEN, and MQTT_REQ_MAX_IN_FLIGHT, but the author had not yet tested it personally. [#20953098]

What does SoftAP mode mean on an LN882H smart switch, and how is it used during Wi-Fi provisioning?

"SoftAP" is an access-point mode that makes the switch broadcast its own Wi-Fi network for setup, instead of joining your router first. The captured LN882H log showed SoftAP_Startup, wifi_start_config, and a network interface at 192.168.4.1 with mask 255.255.255.0. In this thread, SoftAP appears during provisioning when the device cannot complete normal station setup. [#20911009]

ESPHome vs OpenLN882H/OpenBeken for LN882H switches — which platform is actually supported and practical to use?

OpenLN882H or OpenBeken is the practical choice from this thread. One user tried ESPHome with bk72xx and generic-bk7231n-qfn32-tuya, and reported it simply did not work on the LN882H switch. The maintainer then stated that ESPHome does not support many such devices and pointed users to OpenBK/OpenLN tooling instead. [#21350030]

How can I help with LN882H or OpenBeken development if I own one of these AliExpress relay modules?

You can help by testing tools, porting support, or donating. The maintainer explicitly suggested testing the LN882H flash tool, trying an OBK port to the LN882H platform, or providing financial support. If you own a real AliExpress module, hardware testing is especially valuable because the maintainer said he did not have that chip on hand. [#20820592]

What protocol does the CozyLife app use to control LN882H switches over Wi-Fi if MITM proxy traffic does not show HTTP commands?

The thread does not identify an HTTP protocol, and the available evidence points to another TCP-based method. A later reply states the cloud connection is not HTTP or HTTPS, and local TCP/5555 also gave no banner or clear response. That means a normal HTTP MITM capture can miss the actual control channel. [#21315355]

Why does the LN882H device open TCP connections to 139.162.135.94:8899 and listen on TCP port 5555, and how could I inspect that traffic?

The thread suggests 139.162.135.94:8899 is used for cloud control, while TCP port 5555 is a local listener with an unknown protocol. One researcher saw no prompt, banner, or useful reply on either endpoint. He suggested inspecting it with mitmproxy in Generic TCP mode or with a Wireshark capture, because HTTP tooling alone is insufficient here. [#21315355]

What causes the "FAILED! Invalid command 'lfs_format // clear LFS'" error on LN882 firmware, and what manual configuration steps should I use instead?

It happens because the import and LittleFS flow was not set up for LN882 firmware in that build. The thread reply says the lfs_format path fails on LN882H, so the workaround is manual module configuration instead of one-click clearing and script import. Use the template as a pin reference, then set the pins manually in the web interface. [#20974623]
ADVERTISEMENT