logo elektroda
logo elektroda
X
logo elektroda

[LN882HKI] Tuya Smart Light disassembly and seek some help to set it up

gregmarfaing 12441 79
Best answers

How do I configure this LN882HKI Tuya RGB light in OpenBK after flashing it, especially with the BP5758 LED driver?

You need to configure the BP5758 LED driver, not just hunt random GPIOs: the module is an LN882H + BP5758 combo, so first identify which LN882H pins go to the BP5758 SCL/SDA (same as CLK/DAT) with a multimeter rather than guessing [#20970790] The thread later confirmed on this board that A0 is connected to SCL and A1 to SDA [#20971840] Once the driver support was enabled, the working LED mapping was `LED_Map 3 4 2 0 1` [#21010588] For brightness/current, the BP5758 current command was also used to tame heat; `BP5758D_Current 2 2` was reported stable for 2 hours at about 80°C, and `BP5758D_Current 1 1` was said to keep one unit around 73°C [#21011100] [#21650555]
Generated by the language model.
ADVERTISEMENT
  • #31 21010280
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    thanks. WEMO and Hue seem OK starting though not yet tested.

    Screenshot of an LED light control interface with sliders for brightness, RGB color, and temperature, along with diagnostic data.

    build failed though, some GH rate limit?

    Code: Text
    Log in, to see the code
  • ADVERTISEMENT
  • #32 21010588
    gregmarfaing
    Level 7  
    Posts: 16
    Help: 2
    Rate: 3
    >>21009643
    Thank you so much for this update!
    I bought another bulb and was able to get the good mapping with this "LED_Map 3 4 2 0 1"
  • #33 21010611
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    gregmarfaing wrote:
    "LED_Map 3 4 2 0 1"


    ah yes, well done. that's it.

    I think I need to limit brightness maximum because, I don't know about you, but the CPU temp did hit 100 degrees C on mine and the chip hung.

    Added after 13 [minutes]:

    also. Other BP5758Ds I've seen have seem to mention the mA used by each channel, so maybe Tuya OS limits to certain brightness.

    eg the Eveready GU10 in here https://www.elektroda.com/rtvforum/topic4040714.html is

    Code: Text
    Log in, to see the code
  • #34 21011023
    gregmarfaing
    Level 7  
    Posts: 16
    Help: 2
    Rate: 3

    Same here,
    for now i use 50% of brightness as the CPU stays at ~79-80.5°C (RGB and cold/warm) but I'd like to know if it's too much or not as I got 4 of these (Laxihub branded from Ali) and they go up to 76°C with 100% of brightness (only with CW not RGB)
  • #35 21011040
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    Hmm. Dunno. I'd be happier if it stayed under 90 when switched on. At the moment mine is 60, off, and with the cap removed. LED disc is also not sealed in as it was from factory.

    Though, temperature column in the datasheet says -40 - 105⁰C

    I'll look around the forums for evidence of changing maximum of brightness slider
  • #36 21011047
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    Have you guys tried BP5758D_Current command?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #37 21011070
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    p.kaczmarek2 wrote:
    Have you guys tried BP5758D_Current command?


    ha! no!

    I'm trying this at full brightness to see what temps I get

    Code: Text
    Log in, to see the code


    Added after 4 [minutes]:

    I wish I knew how to decrypt user param key bit to see the power rating of LEDs in the LN FW dump

    Added after 11 [minutes]:

    not sure we can believe it anyway. it jumps about past a certain point

    Screenshot showing an internal temperature of 121.1°C. Internal temperature: 203.0°C Internal temperature is 183.3°C.
  • #38 21011100
    gregmarfaing
    Level 7  
    Posts: 16
    Help: 2
    Rate: 3

    p.kaczmarek2 wrote:
    Have you guys tried BP5758D_Current command?

    didn't know this, thanks!
    pretty satisfied with BP5758D_Current 3 3, i get the same temp as before with both RGB and CW at full brightness

    Been up for 15 minutes and still the same, 63°C when it's off
  • Helpful post
    #39 21014504
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    divadiow wrote:

    Screenshot showing an internal temperature of 121.1°C. Internal temperature: 203.0°C Internal temperature is 183.3°C.

    Those internal temperature sensors seem very unreliable to me as well. I am not sure if we can do much about it.

    gregmarfaing wrote:

    p.kaczmarek2 wrote:
    Have you guys tried BP5758D_Current command?

    didn't know this, thanks!

    Always check our docs, you can find a lot of usefull things there:
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md
    Helpful post? Buy me a coffee.
  • #40 21015497
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    p.kaczmarek2 wrote:
    Those internal temperature sensors seem very unreliable to me as well. I am not sure if we can do much about it.


    no. im not sure this bulb is very well really. it doesn't stay up long before rebooting. I don't know if this is a temperature issue or something else. Is yours stable @gregmarfaing ?
  • #41 21015541
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    @divadiow are other LN882H devices on your side stable?
    Helpful post? Buy me a coffee.
  • #42 21015553
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    Yes. Seem to be. I have an RMW002 on all night tonight measuring powersave 0 so will check up-time in the morning.

    I could setup 3 or 4 LN-02/RMW002s for a few days to see if they stay up
  • #43 21015569
    gregmarfaing
    Level 7  
    Posts: 16
    Help: 2
    Rate: 3

    divadiow wrote:
    p.kaczmarek2 wrote:
    Those internal temperature sensors seem very unreliable to me as well. I am not sure if we can do much about it.


    no. im not sure this bulb is very well really. it doesn't stay up long before rebooting. I don't know if this is a temperature issue or something else. Is yours stable @gregmarfaing ?

    with some time and temp/stability measurements I can say that with [code:1:29b21b0196]BP5758D_Current 2 2 [/code:29b21b0196] I get 80°C and no reboot/freeze (even after 2h turned on ) , except with mqtt with frequent disconnection when the devices is used with something heavier than just switching it on/off , in my case it's a rgb loop from HA .
    It could be a temperature issue as the device seems to be pretty responsive when it's off
    Display of device technical data, including internal temperature and MQTT status.
    and @p.kaczmarek2 thanks again, with the docs I was able to get another rgb bulb with a BP1658 at the good brightness as it was really weak before and I didn't know how to solve this
  • #44 21015679
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    divadiow wrote:
    Yes. Seem to be. I have an RMW002 on all night tonight measuring powersave 0 so will check up-time in the morning.

    I could setup 3 or 4 LN-02/RMW002s for a few days to see if they stay up


    OK so far
    Interface displaying internal temperature, WiFi status, and configuration options.
  • ADVERTISEMENT
  • #45 21264807
    davidezborges
    Level 6  
    Posts: 13
    Rate: 4
    hi everyone, i leave here the boot log from my device. im trying to dump the firmware but i wasnt able to run properly the tool.
    any leads will be accepted. tried both windows and linux but the tool refused to run and i rather have a backup in case something breaks.
    i can sbmit some pictures if needed.





    bootloader build time: 13:48:19
    config item not found perip_param value
    -- tuya project compile time: Jul 24 2023 10:07:45--
    ble mac[9b:67:42:d7:3c:fc]
    [BLIB_I]BLIB Ver: 1.0.3 [build time:Jan 19 2023 12:14:45][0x010003ff]
    xTaskCreate, name: rw_task, priority: 9, stack size: 2048
    xTaskCreate, name: worker, priority: 2, stack size: 1536
    xTaskCreate, name: ty_main, priority: 3, stack size: 4096
    xTaskCreate, name: IDLE, priority: 0, stack size: 1024
    xTaskCreate, name: Tmr Svc, priority: 10, stack size: 2048
    Before enter tuya_main, Total:164292; Free:151952
    GPIOA_9 high level, will enter Normal mode!
    Failed to enter ate mode! Start tuya user main.
    xTaskCreate, name: tuya_app_main, priority: 4, stack size: 4096
    xTaskCreate, name: TUYA_TCPIP, priority: 9, stack size: 2048
    tkl_ethernetif_init
    tkl_ethernetif_init
    [01-01 00:00:00 ty I][lr:0x100c8f0f] mqc app init ...
    xTaskCreate, name: wq_system, priority: 3, stack size: 5120
    [01-01 00:00:00 ty I][tal_thread.c:184] thread_create name:wq_system,stackDepth:5120,totalstackDepth:7168,priority:3
    xTaskCreate, name: wq_highpri, priority: 4, stack size: 4096
    [01-01 00:00:00 ty I][tal_thread.c:184] thread_create name:wq_highpri,stackDepth:4096,totalstackDepth:11264,priority:4
    xTaskCreate, name: sys_timer, priority: 5, stack s[01-01 00:00:00 ty D][tal_thread.c:203] Thread:wq_highpri Exec Start. Set to Runningize: 4096
     Stat
    [01-01 00:00:00 ty D][tal_thread.c:203] Thread:sys_timer Exec Start. Set to Running Stat
    [01-01 00:00:00 ty I][tal_thread.c:184] thread_create name:sys_timer,stackDepth:4096,totalstackDepth:15360,priority:5
    [01-01 00:00:00 ty E][bp5758d.c:263] ===== bp5758d_init ->ucNumber 5 , total_out_index 10 ======
    
    [01-01 00:00:00 ty N][lr:0x10077a13] reset is 0>>
    xTaskCreate, name: thread_shade, priority: 5, stack size: 2048
    [01-01 00:00:00 ty N][lr:0x10088c7f] ble serv not closed, forbid open!
    [01-01 00:00:00 ty N][lr:0x10077395] BleSwitch=1
    [01-01 00:00:00 ty N][lr:0x10077a13] reset is 0>>
    [01-01 00:00:00 ty N][lr:0x100773b3] first bright up
    [01-01 00:00:00 ty N][lr:0x10077a13] reset is 0>>
    [01-01 00:00:00 ty N][lr:0x100bff73] key_addr: 0x1ec000   block_sz 4096
    [01-01 00:00:00 ty N][lr:0x100c024d] get key:
    0x49 0x53 0xa9 0x2d 0x51 0x6b 0x7 0xdc 0x2b 0x78 0xc7 0x47 0xc6 0x4a 0xb8 0x5a 
    [01-01 00:00:00 ty N][lr:0x10083e19] uni_random_init...
    [01-01 00:00:00 ty N][lr:0x100840bd] tuya_tls_rand_init ok!
    ----- tkl_watchdog_init
    wdg shift_left_num:0x10, set num:65535, top:0x0d
    xTaskCreate, name: health_monitor, priority: 5, stack size: 1536
    tkl_cpu_sleep_mode_set 95 1 0
    tkl_cpu_sleep_mode_set 95 0 0
    tkl_wifi_set_lp_mode 1566, en 0, dtim 0
    [01-01 00:00:00 ty E][tal_wifi.c:714] tal_wifi_lp_dis: set wifi lp mode fail(-26880)
    set work mode 2, is open 0, current ln mode: 0
    wifi not start, turn on first
    adapt wifi start <m:2>, hw_ready:0
    start rf preprocess and image cal
    [WLIB_E]idx=00, iq_hex_cal=0x7A7D, i=122, q=125, iavg= 51, qavg=  6
    [WLIB_E]idx=01, iq_hex_cal=0x767B, i=118, q=123, iavg= 60, qavg= 23
    [WLIB_E]idx=02, iq_hex_cal=0x6F79, i=111, q=121, iavg= 14, qavg=  4
    [WLIB_E]idx=03, iq_hex_cal=0x6378, i= 99, q=120, iavg= 27, qavg= 77
    [WLIB_E]idx=04, iq_hex_cal=0x537B, i= 83, q=123, iavg= 57, qavg= 19
    [WLIB_E]idx=05, iq_hex_cal=0x7A7D, i=122, q=125, iavg= 39, qavg= 15
    [WLIB_E]idx=06, iq_hex_cal=0x767B, i=118, q=123, iavg= 31, qavg= 29
    [WLIB_E]idx=07, iq_hex_cal=0x6F79, i=111, q=121, iavg= 69, qavg= 18
    [WLIB_E]idx=08, iq_hex_cal=0x6478, i=100, q=120, iavg= 29, qavg= 68
    [WLIB_E]idx=09, iq_hex_cal=0x567B, i= 86, q=123, iavg= 36, qavg=  5
    [WLIB_E]idx=10, iq_hex_cal=0x7A7D, i=122, q=125, iavg= 35, qavg= 15
    [WLIB_E]idx=11, iq_hex_cal=0x767B, i=118, q=123, iavg= 23, qavg= 34
    [WLIB_E]idx=12, iq_hex_cal=0x6F79, i=111, q=121, iavg= 66, qavg= 15
    [WLIB_E]idx=13, iq_hex_cal=0x6478, i=100, q=120, iavg= 26, qavg= 64
    [WLIB_E]idx=14, iq_hex_cal=0x567B, i= 86, q=123, iavg= 29, qavg= 31
    [WLIB_E]idx=15, iq_hex_cal=0x7A7D, i=122, q=125, iavg= 35, qavg= 11
    [WLIB_E]idx=16, iq_hex_cal=0x767B, i=118, q=123, iavg= 15, qavg= 22
    [WLIB_E]idx=17, iq_hex_cal=0x6F79, i=111, q=121, iavg= 63, qavg= 12
    [WLIB_E]idx=18, iq_hex_cal=0x6477, i=100, q=119, iavg= 18, qavg= 71
    [WLIB_E]idx=19, iq_hex_cal=0x567A, i= 86, q=122, iavg= 19, qavg=  2
    [WLIB_E]idx=20, iq_hex_cal=0x797D, i=121, q=125, iavg= 21, qavg= 67
    [WLIB_E]idx=21, iq_hex_cal=0x747C, i=116, q=124, iavg= 26, qavg= 15
    [WLIB_E]idx=22, iq_hex_cal=0x6C7B, i=108, q=123, iavg= 44, qavg= 22
    [WLIB_E]idx=23, iq_hex_cal=0x5E7B, i= 94, q=123, iavg= 13, qavg= 13
    [WLIB_E]idx=24, iq_hex_cal=0x4B7F, i= 75, q=127, iavg= 25, qavg= 73
    xTaskCreate, name: wifi_cfg, priority: 5, stack size: 2048
    xTaskCreate, name: mac_task, priority: 9, stack size: 2048
    [WLIB_I]cap_comp = 2, xtal_capbank_tab:[0]:42 [1]:37 [2]:37 [3]:37 [4]:52 [5]:72 [6]:72 [7]:72 
    [WLIB_I][original]phy_tab_1f:0x56, phy_tab_20:0x3C
    [WLIB_I][efuse]phy_tab_1f:0x62, phy_tab_20:0x48
    [WLIB_I][flash]phy_tab_1f:0x62, phy_tab_20:0x48, tx_pwr_comp_all=0, tx_pwr_comp_b=0, tx_pwr_comp_gn=0
    [WLIB_I]==>temp_sect:2,phy_tab_1f:0x62,phy_tab_20:0x48
    [WLIB_I]<==temp_sect:2,phy_tab_1f:0x62,phy_tab_20:0x48
    XTAL CAP VAL:2.
    wifi stop
    wifi sta start
    [WLIB_I]LN882H WiFi Lib Ver: 1.1.3 [build time:Apr 24 2023 15:10:58][0x010103ff]
    [WLIB_I]STA_Startup.
    STA startup!
    [WLIB_I]Disconnected.
    [WLIB_I]HwInd:UKI:0
    [WLIB_I]Disconnected.
    current work mode 0
    No need to switch mode, mode:0
    [tkl_wifi_station_fast_connect:1602] ssid: Meh pwd: babyyoda123 pwd len: 11, channel: 6
    [WLIB_I]Disconnected.
    [tkl_wifi_get_mac:1229] if: 0, mac: fc:3c:d7:42:67:9a
    ble_mac: 9b:67:42:d7:3c:fc
    [WLIB_I]LN882H WiFi Lib Ver: 1.1.3 [build time:Apr 24 2023 15:10:58][0x010103ff]
    [WLIB_I]STA_Startup.
    STA startup!
    [WLIB_I]Disconnected.
    [WLIB_I]HwInd:UKI:0
    [WLIB_I]Disconnected.
    [WLIB_I]will scan on ch:6
    [WLIB_I]Disconnected.
    [01-01 00:00:01 ty N][lr:0x100[WLIB_I]will connect...
    [WLIB_I]Disconnected.
    8676d] have actived over 15 min, not enter mf_init
    [01-01 00:00:01 ty N][lr:0x1006bbd5] mf_init succ
    [01-01 00:00:01 ty N][lr:0x100786f5] < TuyaOS V:3.5.4 BS:40.00_PT:2.3_LAN:3.5_CAD:1.0.5_CD:1.0.0 >
    < BUILD AT:2023_01_09_16_12_01 BY ci_manage FOR tuyaos-iot AT ln882h >
    IOT DEFS < WIFI_GW:1 DEBUG:1 KV_FILE:0 LITTLE_END:1 SL:0 OPERATING_SYSTEM:98 RELIABLE_TRANSFER:0 >
    
    [01-01 00:00:01 ty N][lr:0x100786ff] xj_QP_IIC9b:1.0.3
    [01-01 00:00:01 ty N][lr:0x100787c7] connect mode is 5
    [01-01 00:00:01 ty E][lr:0x100d3d9d] uf_open 2 err 8
    [01-01 00:00:01 ty E][soc_flash.c:77] uf file 2 can't open and read
    [01-01 00:00:01 ty E][user_flash.c:211] Prod data read err
    [01-01 00:00:01 ty E][lr:0x100d3d9d] uf_open 2 err 8
    [01-01 00:00:01 ty E][soc_flash.c:77] uf file 2 can't open and read
    [01-01 00:00:01 ty E][user_flash.c:211] Prod data read err
    [01-01 00:00:01 ty N][lr:0x1006bbf9] prodtest find ssid: tuya_mdev_test1
    [01-01 00:00:01 ty N][lr:0x10084d2d] have actived over 15 min, not enter mf_init
    [01-01 00:00:01 ty N][lr:0x100a76c3] wifi soc init. pid:keyd8s85qd3rwn4a firmwarekey:keyd8s85qd3rwn4a ver:1.0.3
    [01-01 00:00:01 ty N][lr:0x100aae05] start wifi link params validate, nc_tp:9 md:3
    [01-01 00:00:01 ty N][lr:0x100aae8d] gw_wsm.nc_tp:9
    [01-01 00:00:01 ty N][lr:0x100aae97] gw_wsm.md:3
    [01-01 00:00:01 ty N][lr:0x10098f59] Last reset reason: 0
    [01-01 00:00:01 ty N][lr:0x10098fe9] gw_cntl->gw_wsm.stat:2
    [01-01 00:00:01 ty N][lr:0x10099083] gw_cntl->gw_if.abi:0 input:0
    [01-01 00:00:01 ty N][lr:0x10099091] gw_cntl->gw_if.product_key:keyd8s85qd3rwn4a, input:keyd8s85qd3rwn4a
    [01-01 00:00:01 ty N][lr:0x1009909d] gw_cntl->gw_if.tp:0, input:0
    [01-01 00:00:01 ty N][lr:0x100990b1] gw_cntl->gw_if.firmware_key:keyd8s85qd3rwn4a, input:keyd8s85qd3rwn4a
    [01-01 00:00:01 ty N][lr:0x100996b5] enter success_proc
    [tkl_wifi_get_mac:1229] if: 0, mac: fc:3c:d7:42:67:9a
    ble_mac: 9b:67:42:d7:3c:fc
    [01-01 00:00:01 ty N][lr:0x100996c9] serial_no:fc3cd742679a
    [01-01 00:00:01 ty N][lr:0x10078933] frame init ok
    [01-01 00:00:01 ty N][lr:0x100717eb] opMeshRemoterCtrlInit!
    [01-01 00:00:01 ty N][lr:0x100cc67b] bt startup attr:ff
    [01-01 00:00:01xTaskCreate, name: remoter_cmd_deal, priority: 3, stack size: 2560
     ty N][lr:0x1008844f] upd product_id type:1 keyd8s85qd3rwn4a
    [01-01 00:00:01 ty I][tal_thread.c:184] thread_create name:remoter_cmd_deal,stackxTaskCreate, name: host_main_thread_hdl, priority: 8, stack size: 5120
    Depth:2560,totalstackDepth:23552,priority:3
    [01-01 00:00:01 ty I][tal_thread.c:184] thread_create name:host_main_thread_hdl,stackDepth:5120,totalstackDepth:28672,priority:8
    [01-01 00:00:01 ty I][lr:0x100bb15d] le acl buf sz = 251,max buf = 5 
    
    [01-01 00:00:01 ty I][lr:0x100b9b7b] acl buf sz = 251, max pkt = 5, avail pkt = 5
    
    [01-01 00:00:01 ty I][lr:0x100bb625] GAP init: stop adv
    [01-01 00:00:01 ty I][lr:0x1007e775] ble_hs_timer reset:100 
    [01-01 00:00:01 ty I][lr:0x10080ed9] Stack sync
    [01-01 00:00:01 ty N][lr:0x100789a1] ble remote ok
    [01-01 00:00:01 ty I][lr:0x10080eb9] Init/Deinit Event
    [01-01 00:00:01 ty N][lr:0x10088411] ty bt sdk init success finish
    [01-01 00:00:01 ty N][lr:0x100999c7] __devos_init_evt success
    [01-01 00:00:01 ty N][lr:0x10098d07] already bind
    [01-01 00:00:01 ty I][lr:0x100c8ff9] mqc app start ...
    [01-01 00:00:01 ty E][lr:0x100d6419] mqtt Get IP Fails
    xTaskCreate, name: mq_cntl_task, priority: 4, stack size: 5120
    [01-01 00:00:01 ty I][tal_thread.c:184] thread_create name:mq_cntl_task,stackDepth:5120,totalstackDepth:33792,priority:4
    tkl_thread_release, name: tuya_app_
    set work mode 2, is open 1, current ln mode: 0
    current work mode 0
    No need to switch mode, mode:0
    [02-07 03:28:17 ty N][lr:0x100abaab] cur stat:5  0x10078421 -->>
    [02-07 03:28:17 ty N][lr:0x100abae5] wifi netstat changed to:5  -->>
    [02-07 03:28:17 ty N][lr:0x100abafb] report wifi netstat[5] to callback  -->>
    [02-07 03:28:17 ty N][lr:0x10078439] last wifi stat:255, wifi stat 5
    [02-07 03:28:17 ty N][lr:0x10078445] size:90496
    [02-07 03:28:17 ty I][lr:0x100bb625] GAP init: stop adv
    [02-07 03:28:17 ty N][lr:0x100bbb4b] Start Adv
    [02-07 03:28:17 ty N][lr:0x10087fc1] ble adv updated
    [02-07 03:28:17 ty I][lr:0x1007e879] ble_hs_timer_exp:
    [WLIB_I]Status: Scan Successful. Initaiting Join: 
    [WLIB_I]SSID      = Meh
    [WLIB_I]BSSID     = 44:48:b9:5a:cb:e3
    [WLIB_I]Channel   = 6
    [WLIB_I]RSSI      = -68
    [WLIB_I]StationID = fc:3c:d7:42:67:9a
    [WLIB_I]Status: Initiating Authentication.
    [WLIB_I]Status: Authentication Successful. Initiating Association.
    [WLIB_I]Status: Association Successful.
    [WLIB_I]Connected.
    STA connected to target AP!
    reboot type(0:power-on;1:soft-rst;2:wdt-rst): 0
    reboot count: 0
    [ln_ty_sdk_ver: 0.0.5_alpha or 0x00000500] [build time:2022-05-17_14:57:03]
    [Git info: develop_198ece8]
    [BLIB Ver: 1.0.3 or 0x010003ff] [build time:Jan 19 2023 12:14:45]
    [02-07 03:28:20 ty E][lr:0x100822e5] kvs_read fails rmt_ctrl_0 -6
    [02-07 03:28:20 ty E][lr:0x100822e5] kvs_read fails rmt_ctrl_1 -6
    [02-07 03:28:20 ty E][lr:0x100822e5] kvs_read fails rmt_ctrl_2 -6
    [02-07 03:28:20 ty E][lr:0x100822e5] kvs_read fails rmt_ctrl_3 -6
    [02-07 03:28:20 ty E][lr:0x100822e5] kvs_read fails rmt_ctrl_4 -6
    [02-07 03:28:20 ty I][lr:0x100bbe7f] GAP procedure initiated: discovery; 
    [02-07 03:28:20 ty I][lr:0x100bbe91] own_addr_type=0 filter_policy=0 passive=1 limited=0 filter_duplicates=0 
    [02-07 03:28:20 ty I][lr:0x100bbf03] duration=forever
    [02-07 03:28:20 ty I][lr:0x100bbea7] 
    
    sta_netif_status_changed_cb 62
    +--------------- net device info ------------+
    |netif hostname: lwip0                       |
    |netif ip      = 192.168.1.36                |
    |netif mask    = 255.255.255.0               |
    |netif gateway = 192.168.1.1                 |
    |netif mac     : [FC:3C:D7:42:67:9A]         |
    +--------------------------------------------+
    tuya_wifi_get_ip_cb
    [02-07 03:28:21 ty N][lr:0x100aa8f5] wifi status changed to 0
    [02-07 03:28:21 ty N][lr:0x100abaab] cur stat:6  0x10078421 -->>
    [02-07 03:28:21 ty N][lr:0x100abae5] wifi netstat changed to:6  -->>
    [02-07 03:28:21 ty N][lr:0x100abafb] report wifi netstat[6] to callback  -->>
    [02-07 03:28:21 ty N][lr:0x10078439] last wifi stat:5, wifi stat 6
    [02-07 03:28:21 ty N][lr:0x10078445] size:94280
    xTaskCreate, name: lan_sock_loop, priority: 3, stack size: 4096
    [02-07 03:28:21 ty I][tal_thread.c:184] thread_create name:lan_sock_loop,stackDepth:4096,totalstackDepth:37888,priority:3
    [02-07 03:28:21 ty N][lr:0x100d63e5] mqtt ip:192.168.1.36 0xc0a80124
    [02-07 03:28:22 ty N][lr:0x100d7397] transporter connect host[m3.tuyaus.com] success, begin to mqtt connect
    [02-07 03:28:22 ty N][lr:0x100d7409] mqtt connect success
    [02-07 03:28:22 ty N][lr:0x100d743b] mqtt subcribe success
    [02-07 03:28:23 ty N][lr:0x100abaab] cur stat:7  0x10078421 -->>
    [02-07 03:28:23 ty N][lr:0x100abae5] wifi netstat changed to:7  -->>
    [02-07 03:28:23 ty N][lr:0x100abafb] report wifi netstat[7] to callback  -->>
    [02-07 03:28:23 ty N][lr:0x10078439] last wifi stat:6, wifi stat 7
    [02-07 03:28:23 ty N][lr:0x10078445] size:82928
    [02-07 03:28:23 ty N][lr:0x10078565] CLOUD_CONN
    [02-07 03:28:23 ty E][lr:0x100d3d9d] uf_open 3 err 8
    [02-07 03:28:23 ty E][soc_flash.c:77] uf file 3 can't open and read
    [02-07 03:28:23 ty E][lr:0x100d3d9d] uf_open 4 err 8
    [02-07 03:28:23 ty E][soc_flash.c:77] uf file 4 can't open and read
    [02-07 03:28:23 ty E][lr:0x100d3d9d] uf_open 5 err 8
    [02-07 03:28:23 ty E][soc_flash.c:77] uf file 5 can't open and read
    [02-07 03:28:23 ty E][lr:0x100d3d9d] uf_open 6 err 8
    [02-07 03:28:23 ty E][soc_flash.c:77] uf file 6 can't open and read
    xTaskCreate, name: thr_adRes, priority: 3, stack size: 4096
    [02-07 03:28:23 ty E][lr:0x100d3d9d] uf_open 7 err 8
    [02-07 03:28:23 ty E][soc_flash.c:77] uf file 7 can't open and read
    [02-07 03:28:23 ty N][lr:0x10077763] ble init timer
    [02-07 03:28:23 ty I][lr:0x100bb625] GAP init: stop adv
    [02-07 03:28:23 ty I][lr:0x1007e775] ble_hs_timer reset:0 
    [02-07 03:28:23 ty N][lr:0x1008867f] ble_sdk_send skip, no connect:4
    [02-07 03:28:23 ty I][lr:0x1007e879] ble_hs_timer_exp:
    [02-07 03:28:24 ty N][lr:0x10071959] BleTimerStart
    [02-07 03:28:25 ty N][lr:0x100c34c9] body:{"metas":{"supportAssistActive":true}}
    [02-07 03:28:26 ty E][lr:0x100d3d9d] uf_open netcfg_log err 8
    [10-16 01:47:29 ty N][lr:0x1008b4c5] body:{"type":3,"relation":[]}
    [10-16 01:47:38 ty N][lr:0x100c6b71] Update Timer from cloud
    [10-16 01:47:46 ty E][tuya_svc_upgrade.c:861] result null
  • #47 21265486
    davidezborges
    Level 6  
    Posts: 13
    Rate: 4
    >>21264859 thanks for the response, the command line tool gives me (on linux):
    python LN882H_Flash_Dumper.py '/dev/ttyUSB0' flashdump
    File "LN882H_Flash_Dumper.py", line 26
    print('.', end='', flush=True)
    ^
    SyntaxError: invalid syntax

    the windows error seems different as it says something about a file not found.

    the gui tool only allows to flash the chip but as I said I'd rather have a backup in case everything goes badly.
    I have 3 lightbulbs with the same chip so I can tinker a little but I'm not that good at python to make changes or develop my own tool.
  • #48 21265497
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    davidezborges wrote:
    it says something about a file not found.

    and LN882H_CMD_Tool.exe is definitely in the same directory as LN882H_Flash_Dumper.py?

    Added after 2 [hours] 1 [minutes]:

    (on Windows)
  • #49 21265995
    davidezborges
    Level 6  
    Posts: 13
    Rate: 4
    >>21265497 I'll be honest, the last couple of minutes I've been looking for that file.
  • #50 21266005
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    attached.
    Attachments:
    • LN882H_CMD_Tool.exe (142.5 KB) You must be logged in to download this attachment.
  • #51 21266718
    davidezborges
    Level 6  
    Posts: 13
    Rate: 4
    >>21266005 thanks for the help, I've been able to find the folder and file that uses the dump tool. Windows 10 refuses to open the serial port. Windows 7 can open the serial port and load RAM data. Anyways it says: fail. could not go in download mode.

    I'll keep trying, maybe it's a wiring problem. P21 should be shorted to ground, right?

    Maybe later (when I finish some work) I will upload some pictures of the board
  • #52 21266733
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    davidezborges wrote:
    p21 should be shorted to ground, right?

    BOOT/GPIOA9 is pin 17 on LN882HKx.

    Pin diagram of LN882HKx IC with GPIOA9 marked at pin 17.

    which device/module do you have exactly, is it the candle bulb that is the main subject of this thread? and where are you seeing p21?
  • #53 21266912
    davidezborges
    Level 6  
    Posts: 13
    Rate: 4
    >>21266733



    here we go, these are pictures from module and led controller.
    I'll try to find the post where I read that p21 was same as boot(the microcontroller actually doesn't boot when p21 is shorted to ground)
    it's not a candle bulb but the overall hardware is the same.

    #Edit
    made some continuity tests, p21 it's actually A9!



    Printed circuit board with visible traces, components, and connected wires. Image of a circuit board with various electronic components and wires connected. Printed circuit board with colorful LEDs and an integrated circuit. Close-up of a round circuit board with LEDs in various colors. Image of a circuit board viewed through a magnifying glass.
  • #55 21266966
    davidezborges
    Level 6  
    Posts: 13
    Rate: 4
    >>21266943 the short answer is yes, the long answer is I just soldered another thin insulated copper line to U0-RX and will try to read the flash memory again.
    crossing fingers...
    #edit
    tried using U0-RX but no luck.
    I'll try to find where U1-RX comes from (that's the pin where I got bootlogs) maybe they changed default rx/tx pins?
    #edit 2
    used U1-TX but no luck either pins are B9 and B8 for TX and RX (LN882H side) respectively.
    I don't want to give up but this Chinese crap is taking longer than I expected to play nice.
    later I will use a dedicated power supply for this and try again. thanks again for every response.

    Added after 48 [minutes]:

    >>21266943 that really helped a lot, the LED controller is not the same but the wiring was.
    THANKS!! it is reading the memory dump right now
  • #56 21272297
    davidezborges
    Level 6  
    Posts: 13
    Rate: 4
    davidezborges wrote:
    >>21266733



    here we go, these are pictures from module and led controller.
    I'll try to find the post where I read that p21 was same as boot(the microcontroller actually doesn't boot when p21 is shorted to ground)
    it's not a candle bulb but the overall hardware is the same.

    #Edit
    made some continuity tests, p21 it's actually A9!



    Printed circuit board with visible traces, components, and connected wires. Image of a circuit board with various electronic components and wires connected. Printed circuit board with colorful LEDs and an integrated circuit. Close-up of a round circuit board with LEDs in various colors. Image of a circuit board viewed through a magnifying glass.






    after a little work i finally made it work using latest release from https://github.com/openshwprojects/OpenBK7231T_App/releases
    and using the following config:
    Code: JSON
    Log in, to see the code
  • ADVERTISEMENT
  • Helpful post
    #57 21280147
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    @davidezborges thank you for the firmware dump in that other thread.

    I have flashed and paired and can see that the model is W509Z2

    Here is a final template based on your discoveries

    Code: JSON
    Log in, to see the code


    Box of Tuya RGB+CCT smart LED bulb.

    is this box picture accurate?


    https://github.com/OpenBekenIOT/webapp/pull/155

    Added after 1 [hours] 13 [minutes]:

    and boot log and some run-time for your fw

    Code: Text
    Log in, to see the code
  • #58 21280900
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    Merged, thank you, now we have 644 devices:
    https://openbekeniot.github.io/webapp/devicesList.html
    Will we manage to get to 700 this year? There may be still some not added templates in the existing posts.

    PS: Curious what happens there:
    
    adc raw:  777, temp_IC: 27, cap:0xA3331D00, rf43:0x0007, reg74:0x0228
    [WLIB_I]--->pll_cal reg16:0xFFC0, reg17:0x001f
    [WLIB_I]PLL_307_CAL: __adc_raw:  767,temp_IC =   23
    adc raw:  768, temp_IC: 24, cap:0xA3331D00, rf43:0x0005, reg74:0x0228
    

    Internal temperature?
    Helpful post? Buy me a coffee.
  • #59 21280965
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    p.kaczmarek2 wrote:
    There may be still some not added templates in the existing posts.

    probably!

    p.kaczmarek2 wrote:
    Internal temperature?

    must be? I wonder how the power management differs to OBK code, what powersave level is used. This is on my MQ-12F test board of course.

    Added after 9 [hours] 7 [minutes]:

    @davidezborges what BP5758D map are you using on your W509Z2 E27? Is it "BP5758D_Map 2 1 0 3 4"?
  • #60 21281700
    davidezborges
    Level 6  
    Posts: 13
    Rate: 4
    >>21280965 Screenshot of LED settings showing number configuration for colors: red, green, blue, cool, warm.

    2 1 0 3 4 is the final configuration I've been using.

    let me know if you need anything else.

Topic summary

✨ The discussion centers on disassembling and setting up a Tuya-based RGB smart light bulb featuring the LN882HKI chip and a BP5758D LED driver. Initial disassembly was straightforward, and the user successfully backed up the chip firmware and flashed OpenBK (OBK) firmware at 115200 baud after failed attempts at higher speeds. Challenges included identifying correct GPIO pins for PWM control and interfacing with the BP5758D chip, which requires proper SDA and SCL pin mapping. Continuity testing with a multimeter was advised but caused device damage when performed on a powered device. Contributors developed and shared device templates and firmware patches to enable BP5758D driver support on LN882H-based bulbs, including pin mappings and LED channel configurations (e.g., "BP5758D_Map 3 4 2 0 1" and "2 1 0 3 4"). Thermal management issues were noted, with CPU temperatures reaching up to 100°C at full brightness, prompting recommendations to limit brightness and use BP5758D_Current commands to reduce power. Stability concerns remain, especially with MQTT and RGB loops causing disconnections. Firmware dumping tools and flashing procedures were discussed, including correct wiring for UART pins (notably reversed TX/RX lines) and boot mode pin grounding (P21/A9). The community shared resources such as firmware repositories, device templates, and documentation links to assist with flashing, configuration, and troubleshooting. The final confirmed device model is W509Z2, a 220V 9W E27 ES RGB+CCT bulb with LN882H chip and BP5758D LED driver. The discussion also touched on thermal imaging equipment for temperature assessment and comparisons of power management between original and custom firmware.
Generated by the language model.

FAQ

TL;DR: For OpenBeken users modding LN882H Tuya bulbs, the proven setup is 115200 baud, BP5758D on A0/A1 for the E14 bulb, and "LED_Map 3 4 2 0 1" or "BP5758D_Map 2 1 0 3 4" depending on model. This FAQ solves freezing GPIO scans, bad pin guesses, overheating, and backup issues before flashing. [#21010588]

Why it matters: These bulbs are cheap and moddable, but one wrong continuity test or current setting can destroy the lamp or make it unstable.

Variante Chip LED-Treiber Bekannte Daten-/Taktpins Bewährtes Mapping
Tuya W505Z2, 220V 9W E14 Candle RGB+CCT LN882H BP5758D Pin 0 = CLK, Pin 1 = DAT LED_Map 3 4 2 0 1
Tuya W509Z2, 220V 9W E27 RGB+CCT LN882H BP5758D Pin 5 = DAT, Pin 6 = CLK BP5758D_Map 2 1 0 3 4
Frühe Fehlannahme LN882H PWM vermutet GPIO-Finder friert ab, LEDs reagieren nicht Nicht per PWM einrichten

Key insight: The bulb is not a simple PWM LED design. Once the thread identified a BP5758D driver and the exact DAT/CLK lines, OpenBeken setup became a mapping-and-current problem, not a GPIO-finder problem. [#20970790]

Quick Facts

  • The original buyer paid 2.69€ for the bulb, which explains why several users treated it as a low-cost test platform for LN882H flashing and teardown work. [#20971840]
  • Confirmed stable flash speed was 115200 baud after 3 failed attempts at 2000000 baud on the same LN882H module. [#20970052]
  • Reported chip temperatures ranged from about 63°C idle/off to 100°C at full brightness, with several users reducing BP5758D current to improve stability. [#21011100]
  • The E14 candle template used Pin 0 = BP5758D_CLK;0 and Pin 1 = BP5758D_DAT;0, while the E27 template used Pin 5 = BP5758D_DAT;0 and Pin 6 = BP5758D_CLK;0. [#21280147]
  • On one stable E27 test, limiting current to 10 mA held chip temperature around 67.1°C after 2 hours at full brightness. [#21653825]

1. How do I set up an LN882HKI Tuya smart light in OpenBeken when the GPIO finder freezes and the LEDs do not respond?

Set it up as a BP5758D bulb, not as a PWM bulb. The freeze on pins like P13/P14 misled early testing, but the thread later confirmed this hardware uses a BP5758D LED driver over two control lines. Start by tracing DAT and CLK with a multimeter, assign those pins in OpenBeken, then apply the correct map command for your model. For the E14 candle bulb, the working result was LED_Map 3 4 2 0 1 after BP5758D support was enabled. [#21010588]

2. What is the correct OpenBeken template for the Tuya W505Z2 220V 9W E14 candle RGB+CCT bulb with LN882H and BP5758D?

The working template uses model W505Z2, chip LN882H, and BP5758D on pins 0 and 1. Set pin 0 to BP5758D_CLK;0 and pin 1 to BP5758D_DAT;0. The posted template also identifies it as a 220V 9W E14 Candle RGBCCT Bulb (2800K-6500K) with flags 1024. After flashing, users still needed the color-channel mapping command to match the LED order correctly. [#20994908]

3. Which LN882H pins are connected to the BP5758D on this bulb, and how do I identify SDA and SCL with a multimeter?

On the first E14 bulb, A0 was connected to SCL and A1 to SDA. The PCB had both SDA and SCL marked, so the safe method was to check continuity from those PCB labels to the LN882H module pads with power removed. 1. Unplug mains power completely. 2. Put the meter in continuity or beep mode. 3. Probe from BP5758D SDA/SCL pads to LN882H pins until you find the matches. That process produced the final A0/A1 identification. [#20971840]

4. What is the safe way to do a continuity test on a smart bulb PCB, and why can testing on a powered device burn components?

Do continuity tests only with the bulb fully disconnected from mains. One user tested while the lamp was powered, saw a small electrical flash, and then found burn marks and a dead bulb. Another poster explicitly clarified that continuity mode is the meter's beep mode and that the bulb does not need power for that test. A live continuity test can inject current into the wrong part of the circuit and damage components instantly. [#20971601]

5. Why does flashing OpenBeken to an LN882H bulb work at 115200 baud but fail repeatedly at 2000000 baud?

Because this LN882H setup proved reliable at 115200 and unreliable at 2000000 on real hardware. The original poster reported three failed flash attempts at 2000000 baud, then an immediate success at 115200. The thread did not identify a deeper firmware bug, but it clearly showed that lower speed was the practical fix for this bulb and wiring setup. Use 115200 first if you want a dependable backup or flash session. [#20970052]

6. How do I use BP5758D_Map and LED_Map in OpenBeken to get the correct RGB+CCT channel order on these Tuya bulbs?

Use the mapping command that matches your bulb model and driver pins. For the E14 W505Z2 candle bulb, the working channel order was LED_Map 3 4 2 0 1. For the E27 W509Z2 bulb, the final working order was BP5758D_Map 2 1 0 3 4. "BP5758D is a 5-channel constant-current LED driver that controls RGB+CCT LEDs over DAT/CLK lines, unlike simple PWM wiring where each LED channel connects directly to a microcontroller pin." That difference is why mapping fixes colors here. [#21281700]

7. What BP5758D current settings keep LN882H bulbs stable and cooler without losing too much brightness?

The thread's safest proven range was low current, especially 1 1, 2 2, or 3 3. One user reported BP5758D_Current 3 3 gave full-brightness operation with about the same temperature as before, around 63°C off afterward. Another reported BP5758D_Current 2 2 held about 80°C with no reboot or freeze after 2 hours. Later testing showed BP5758D_Current 1 1 could keep a similar bulb stable around 73°C. [#21650565]

8. Why do LN882H smart bulbs with BP5758D run hotter under OpenBeken than under the factory Tuya firmware?

The thread points to LED current, not a confirmed OpenBeken power-save bug, as the main reason. Users saw temperatures climb to 100°C at full brightness under OpenBeken, then improve when they lowered BP5758D current. One contributor concluded that OBK's default BP5758 current was likely higher than the factory setting used by these bulbs. Another noted LN882H itself runs hot, so the bulb combines a warm SoC with a high-current LED driver in a cramped enclosure. [#21650616]

9. What is BP5758D, and how does it differ from PWM-controlled LED setups in Tuya smart bulbs?

BP5758D is a dedicated LED driver chip, not a direct PWM output scheme. It controls five LED outputs for RGB+CCT bulbs through two digital lines named DAT and CLK, which the thread also called SDA and SCL. PWM-controlled bulbs instead use LN882H pins that drive LED channels directly, so only certain PWM-capable pins matter there. This bulb confused early setup because users first looked for PWM GPIOs, but the hardware actually centered on a BP5758D on the LED board. [#20970624]

10. What is GPIOA9 on the LN882H, and why is it used as the BOOT pin for entering download or flash mode?

GPIOA9 is the LN882H BOOT pin used to force download mode for flashing or dumping firmware. The thread later clarified that BOOT/GPIOA9 is pin 17 on LN882HKx modules, and one user verified that their board label P21 was actually continuity-linked to A9. Pulling that BOOT line low during startup was the key step for entering flash mode when backup tools reported that the chip could not enter download mode. [#21266733]

11. How do I dump and back up LN882H firmware before flashing OpenBeken, especially when the LN882H_Flash_Dumper tool gives Python or file errors?

Use the dumper only after you verify Python version, tool files, UART pins, and BOOT wiring. One Linux user got a SyntaxError on print('.', end='', flush=True), which points to running the script with an older Python version. On Windows, another common failure was a missing LN882H_CMD_Tool.exe in the same directory as the dumper script. If backup still fails, confirm BOOT on GPIOA9, use the correct UART, and retry before flashing any OpenBeken release. [#21265486]

12. LN882H Flash Dumper on Windows vs Linux: what are the common setup mistakes and how do I fix serial port, missing file, and download-mode problems?

The common mistakes were old Python on Linux, a missing EXE on Windows, wrong UART pins, and wrong BOOT pin handling. 1. On Linux, run the dumper with a Python version that supports print(..., end=..., flush=...). 2. On Windows, keep LN882H_CMD_Tool.exe in the same folder as LN882H_Flash_Dumper.py. 3. If you get "could not go in download mode," short GPIOA9/BOOT to ground during reset and verify you are using the flashing UART, not just the boot-log UART. [#21266966]

13. What's the best way to remove and disassemble these cheap Tuya LED bulbs without damaging the fragile threaded center or internal parts?

Open the bulb gently and avoid forcing the fragile threaded center from the front. A later user bent that center coil or threaded part, then realized it could likely be pushed out through the two holes inside instead of being re-threaded by force. Earlier in the thread, the original poster said disassembly was easy after following an Elektroda channel video and did not damage the lamp. That combination suggests careful mechanical pressure and inside-out removal is safer than twisting fragile parts. [#21554929]

14. How can I tell whether my Tuya RGB+CCT bulb model is W505Z2 or W509Z2 from the factory firmware, Tuya app, or boot log?

The cleanest method is to pair the factory firmware in the Tuya app and read the model shown there. The E14 candle template was published as W505Z2, while another LN882H RGB+CCT bulb was later confirmed as W509Z2 after reflashing factory firmware and pairing it again. A boot log alone showed product keys and firmware versions, but the model confirmation in the thread came from app pairing, not from a decoded boot string. [#21712747]

15. What UART pin wiring should I use for LN882H backup and flashing when boot logs appear on U1 but flashing needs U0 or reversed TX/RX lines?

Use the UART that the tool expects for flashing, and cross TX/RX even if your boot log came from another port. One later user with a similar board reported successful flashing and backup only after using reversed lines: U0-TX -> RX, U0-RX -> TX, GND -> GND, 3V3 -> 3V3, and P21 -> GND during boot. That same post warned that boot logs can appear elsewhere, so a readable log on U1 does not prove U1 is the right flashing port. [#21554929]
Generated by the language model.
ADVERTISEMENT