logo elektroda
logo elektroda
X
logo elektroda

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

gregmarfaing 12438 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
  • #1 20970052
    gregmarfaing
    Level 7  
    Posts: 16
    Help: 2
    Rate: 3

    Hello first time here,
    I recently bought a rgb light from aliexpress
    RGB LED lamp box placed on a keyboard.

    The disassembly was pretty easy and I didn't damage the light thanks to the video from elektroda channel



    And I was able to access to this: Electronic module from an RGB lamp on a wooden surface.
    Circuit board with pin labels SDA, V+, and SCL, held in a tool holder. Electronic module with several wires on a wooden table.

    After desoldering the module and seeing that it was a LN882HKI I was able to find the pinout with this topic Close-up of a small electronic module held in hands. Close-up of an electronic module with pin labels.
    I did a backup of the chip and tried to flash obk at 2000000 but after 3 fails I tried at 115200 and it worked right away.
    But now I'm facing an issue: I don't know how to setup the module in obk, I tried with the gpio finder but it did nothing except freezing starting P13 so I stopped messing with it.
    Thanks in advance for your help and sorry for the typos here and there
    Attachments:
    • flashdump_flash light e14 9w.bin (3.99 MB) You must be logged in to download this attachment.
    • flashdump_otp light e14 9w.bin (1 KB) You must be logged in to download this attachment.
  • ADVERTISEMENT
  • Helpful post
    #2 20970107
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    gregmarfaing wrote:
    i don't know how to setup the module in obk , i tried with the gpio finder but it did nothing except freezing starting P13 so i stopped messing with it .


    sounds like you're doing the right thing? I've experienced freezing on some pins before but I just reboot and carry on. Perhaps start from the bottom instead.

    https://www.elektroda.com/rtvforum/topic3976371.html

    Added after 10 [minutes]:

    if they're PWM controlled LEDs, seems like only these pins can be used on LN882H anyway though

    8 GPIOA7 I/O PWM pin, corresponding to pin 15 of the IC.
    9 GPIOA10 I/O PWM pin, corresponding to pin 21 of the IC.
    10 GPIOA11 I/O PWM pin, corresponding to pin 22 of the IC.
    11 GPIOA12 I/O PWM pin, corresponding to pin 23 of the IC.
    12 GPIOB3 I/O PWM pin, corresponding to pin 24 of the IC.
  • #3 20970561
    gregmarfaing
    Level 7  
    Posts: 16
    Help: 2
    Rate: 3
    Well i tried every gpio except p13 and p14 as it freezes and the leds didn't turn on (to be sure that i was doing good I tried with another rgb light).
    So to see if the problem is on my side, I checked the soldered points I did but still didn't see a thing and saw that on the leds pcb there was a bp5758 if it can be of any use
  • Helpful post
    #4 20970624
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    Ah I see. I'm still quite new to OpenBK. I don't think I've had to set BP5758 channels on any bulbs. I do see there is DAT and CLK for that chip tho, so I guess it's finding the gpios for those two.

    Screenshot of an app displaying a list of available channel selectors, such as BL0937CF1, ADC, SM2135DAT, SM2135CLK, BP5758D_DAT, BP5758D_CLK, BP1658CJ_DAT, BP1658CJ_CLK, PWM_n, IRRecv, IRSend, Btn_NextColor.

    Perhaps there'd be continuity between two of the contacts on the PCB and two legs of the BP?
  • #5 20970790
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    You are the first one to find a LN882H + BP5758 combo. I will need to enable BP5758 driver for you.

    Still, first you need to get a multimeter and check which LN882H pins are used for BP5758 SCL and SDA (or CLK and DAT, it's the same...). This is currently necessary, because there are too many options to just guess.

    Do you know BP5758 pinout? Are SDA and SCL marked on board?
    Helpful post? Buy me a coffee.
  • #6 20970849
    gregmarfaing
    Level 7  
    Posts: 16
    Help: 2
    Rate: 3

    Close-up of a PCB with marked SDA and SCL pins.
    as you can see SDA and SCL are both marked on the PCB and I think this is the pinout of the BL5758 (as the other pins are all connected to LEDs) Close-up of a PCB with highlighted SDA and SCL pins and LEDs.
    And I just wanted to add that for me the pin used by the module are A0 and A1 as the others connected are VCC, GND, and ANT, respectively.
    BL5758 microcontroller with highlighted pins on a PCB held by a hand.

    Close-up of an electronic module with pin markings on a PCB.
  • #7 20971149
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    We need to know exactly which pin is SCL and which is SDA.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #8 20971544
    gregmarfaing
    Level 7  
    Posts: 16
    Help: 2
    Rate: 3

    I should've asked how to proceed with the multimeter because now I think that my device is dead. I first had the cold white light up then with the next pin I had a little electric flash and now nothing except some burn marks on some components.
  • #9 20971601
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    oh crap!

    was it not in continuity mode? usually denoted by a "beep" audio symbol. my meter only has the beep symbol

    Close-ups of symbols and markings on an electrical meter.

    the bulb does not need to be powered when checking for continuity

    Added after 53 [seconds]:

    not that it's any help, but I've ordered one too to play with
  • #10 20971708
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    Wait, @gregmarfaing , did you do a continuity test on a live device? Everything should be disconnected from mains first. Or, please provide more information on what happened.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #11 20971840
    gregmarfaing
    Level 7  
    Posts: 16
    Help: 2
    Rate: 3
    Well it's exactly that, I tried with the multimeter while it was powered on (I found this pretty dangerous so I was extra cautious) because it's my time doing this, I'm learning from scratch and I didn't know I had to use the continuous mode while the device was off. Still I really appreciate your help and divadiow's as well. Anyway, I think that I'll buy another one too as it's just so cheap (bought it at 2,69€)
    i can just add that A0 is connected to SCL and A1 is connected to SDA ( tested with the multimeter in good condition this time with the dead device)
  • Helpful post
    #12 20983813
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    my turn to break one of these, but not sure how. I was so careful! UART just outputs junk now and there's no sign it's transmitting.

    I didn't get to flash it, but before I killed it, these are the pins and boot log. I've ordered another one lol. 😫

    Image of a PCB with LED components and pin labels. Close-up of a PCB with labeled pins. Close-up of a PCB with labeled pins.

    
    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[8d:57:49:68:d6:d8]
    [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 E][lr:0x100d3d9d] uf_open 8 err 8
    [01-01 00:00:00 ty E][soc_flash.c:77] uf file 8 can't open and read
    [01-01 00:00:00 ty E][light_memory.c:102] power mem read err
    [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 E][lr:0x100d3d9d] uf_open 8 err 8
    [01-01 00:00:00 ty E][soc_flash.c:77] uf file 8 can't open and read
    [01-01 00:00:00 ty E][light_memory.c:102] power mem read err
    [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:
    0xb7 0xda 0x23 0x52 0x55 0x7b 0xb4 0x8d 0x76 0x81 0x68 0x40 0x81 0x51 0x7e 0xb5
    [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
    [01-01 00:00:00 ty E][lr:0x100c8623] logseq empty
    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)
    [01-01 00:00:00 ty N][lr:0x100ab263] mf is open need stop fastconnect
    set work mode 1, is open 0, current ln mode: 0
    wifi not start, turn on first
    adapt wifi start <m:1>, hw_ready:0
    start rf preprocess and image cal
    [WLIB_E]idx=00, iq_hex_cal=0x7E7E, i=126, q=126, iavg= 69, qavg= 63
    [WLIB_E]idx=01, iq_hex_cal=0x7F7C, i=127, q=124, iavg= 10, qavg= 26
    [WLIB_E]idx=02, iq_hex_cal=0x8079, i=128, q=121, iavg= 74, qavg= 54
    [WLIB_E]idx=03, iq_hex_cal=0x8174, i=129, q=116, iavg= 34, qavg=  9
    [WLIB_E]idx=04, iq_hex_cal=0x816F, i=129, q=111, iavg= 18, qavg= 48
    [WLIB_E]idx=05, iq_hex_cal=0x7E7E, i=126, q=126, iavg= 46, qavg= 54
    [WLIB_E]idx=06, iq_hex_cal=0x7F7C, i=127, q=124, iavg= 51, qavg=  7
    [WLIB_E]idx=07, iq_hex_cal=0x807A, i=128, q=122, iavg= 10, qavg= 70
    [WLIB_E]idx=08, iq_hex_cal=0x8275, i=130, q=117, iavg= 19, qavg=  8
    [WLIB_E]idx=09, iq_hex_cal=0x836F, i=131, q=111, iavg=  9, qavg= 38
    [WLIB_E]idx=10, iq_hex_cal=0x7E7E, i=126, q=126, iavg= 50, qavg= 54
    [WLIB_E]idx=11, iq_hex_cal=0x7F7C, i=127, q=124, iavg= 45, qavg= 10
    [WLIB_E]idx=12, iq_hex_cal=0x8079, i=128, q=121, iavg= 25, qavg= 67
    [WLIB_E]idx=13, iq_hex_cal=0x8275, i=130, q=117, iavg= 32, qavg=  5
    [WLIB_E]idx=14, iq_hex_cal=0x826F, i=130, q=111, iavg=  8, qavg= 32
    [WLIB_E]idx=15, iq_hex_cal=0x7E7E, i=126, q=126, iavg= 44, qavg= 58
    [WLIB_E]idx=16, iq_hex_cal=0x7F7C, i=127, q=124, iavg= 50, qavg= 20
    [WLIB_E]idx=17, iq_hex_cal=0x8179, i=129, q=121, iavg=  1, qavg= 59
    [WLIB_E]idx=18, iq_hex_cal=0x8274, i=130, q=116, iavg= 33, qavg= 21
    [WLIB_E]idx=19, iq_hex_cal=0x836F, i=131, q=111, iavg= 24, qavg= 36
    [WLIB_E]idx=20, iq_hex_cal=0x7D7F, i=125, q=127, iavg= 12, qavg=  1
    [WLIB_E]idx=21, iq_hex_cal=0x7D7E, i=125, q=126, iavg= 26, qavg= 46
    [WLIB_E]idx=22, iq_hex_cal=0x7D7D, i=125, q=125, iavg= 36, qavg= 25
    [WLIB_E]idx=23, iq_hex_cal=0x7D7B, i=125, q=123, iavg= 31, qavg= 21
    [WLIB_E]idx=24, iq_hex_cal=0x7C79, i=124, q=121, iavg= 39, qavg= 38
    xTaskCreate, name: wifi_cfg, priority: 5, stack size: 2048
    xTaskCreate, name: mac_task, priority: 9, stack size: 2048
    [WLIB_I]cap_comp = -12, xtal_capbank_tab:[0]:28 [1]:23 [2]:23 [3]:23 [4]:38 [5]:58 [6]:58 [7]:58
    [WLIB_I][original]phy_tab_1f:0x56, phy_tab_20:0x3C
    [WLIB_I][efuse]phy_tab_1f:0x5A, phy_tab_20:0x40
    [WLIB_I][flash]phy_tab_1f:0x5A, phy_tab_20:0x2B, tx_pwr_comp_all=0, tx_pwr_comp_b=-21, tx_pwr_comp_gn=0
    [WLIB_I]==>temp_sect:2,phy_tab_1f:0x5A,phy_tab_20:0x2B
    [WLIB_I]<==temp_sect:2,phy_tab_1f:0x5A,phy_tab_20:0x2B
    XTAL CAP VAL:-12.
    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
    xTaskCreate, name: mf_test, priority: 4, stack size: 5120
    adapt wifi start <m:2>, hw_ready:1
    [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] w57tepkyqlsegcov_LN882H:1.0.0
    [01-01 00:00:01 ty N][lr:0x100787c7] connect mode is 5
    tkl_thread_release, name: mf_test
    [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
    set work mode 1, is open 1, current ln mode: 0
    current work mode 0
    No need to switch mode, mode:0
    adapt wifi start <m:2>, hw_ready:1
    adapt wifi start <m:2>, hw_ready:1
    [01-01 00:00:02 ty N][lr:0x100a76c3] wifi soc init. pid:keyh84mvjw3x7qdf firmwarekey:keyh84mvjw3x7qdf ver:1.0.0
    [01-01 00:00:02 ty N][lr:0x100aae05] start wifi link params validate, nc_tp:1 md:0
    [01-01 00:00:02 ty N][lr:0x100aae8d] gw_wsm.nc_tp:1
    [01-01 00:00:02 ty N][lr:0x100aae97] gw_wsm.md:0
    [01-01 00:00:02 ty N][lr:0x10098f59] Last reset reason: 0
    [01-01 00:00:02 ty N][lr:0x10098fe9] gw_cntl->gw_wsm.stat:1
    [01-01 00:00:02 ty N][lr:0x10099083] gw_cntl->gw_if.abi:0 input:0
    [01-01 00:00:02 ty N][lr:0x10099091] gw_cntl->gw_if.product_key:keyh84mvjw3x7qdf, input:keyh84mvjw3x7qdf
    [01-01 00:00:02 ty N][lr:0x1009909d] gw_cntl->gw_if.tp:0, input:0
    [01-01 00:00:02 ty N][lr:0x100990b1] gw_cntl->gw_if.firmware_key:keyh84mvjw3x7qdf, input:keyh84mvjw3x7qdf
    [01-01 00:00:02 ty N][lr:0x100996b5] enter success_proc
    [tkl_wifi_get_mac:1229] if: 0, mac: d8:d6:68:49:57:8c
    ble_mac: 8d:57:49:68:d6:d8
    [01-01 00:00:02 ty N][lr:0x100996c9] serial_no:d8d66849578c
    [01-01 00:00:02 ty N][lr:0x10078933] frame init ok
     ty N][lr:0x100717eb] opMeshRemoterCtrlInit!urrent ln mode: 0
    
    current work mode 0
    [WLIB_I]Disconnected.
    xTaskCreate, name: remoter_cmd_deal, priority: 3, stack size: 2560
    [01-01 00:00:02 ty I][tal_thread.c:184] thread_create name:remoter_cmd_deal,stackDepth:2560,totalstackDepth:28672,priority:3
    [01-01 00:00:02 ty N][lr:0x100789a1] ble remote ok
    [WLIB_I]LN882H WiFi Lib Ver: 1.1.3 [build time:Apr 24 2023 15:10:58][0x010103ff]
    [WLIB_I]SoftAP_Startup.
    SoftAP startup!
    [WLIB_I]HwInd:UKI:0
    [WLIB_I]Channel scanning not needed
    [WLIB_I]User Preferred channel idx 5-0
    [WLIB_I]Selecting 20MHz ch from One of ... 0 1 2 3 4 5
    [WLIB_I]Selected Channel Tbl Idx 5-0
    [WLIB_I]AP: Starting network in 5-0
    [WLIB_I]Connected.
    [WLIB_I]Status: Start Successful. Entering Enable State.
    tkl_thread_release, name: tuya_app_
    [WLIB_I]Disconnected.
    [WLIB_I]Channel scanning not needed
    [WLIB_I]User Preferred channel idx 5-0
    [WLIB_I]Selecting 20MHz ch from One of ... 0 1 2 3 4 5
    [WLIB_I]Selected Channel Tbl Idx 5-0
    [WLIB_I]AP: Starting network in 5-0
    [WLIB_I]Connected.
    [WLIB_I]Status: Start Successful. Entering Enable State.
    [tkl_wifi_get_mac:1229] if: 0, mac: d8:d6:68:49:57:8c
    ble_mac: 8d:57:49:68:d6:d8
    [tkl_wifi_get_mac:1229] if: 1, mac: d8:d6:68:49:57:8d
    ble_mac: 8d:57:49:68:d6:d8
    ssid:SmartLife-578C; pwd:; channel:6, ecn:0, max conn:1, hidden:0beacon:100, mac:d8:d6:68:49:57:8d; start:1
    [WLIB_I]Disconnected.
    ip info:
            ip:      192.168.176.1
            gw:      192.168.176.1
            netmask: 255.255.255.0
    server config:
            ip:       192.168.176.1
            ip start: 192.168.176.2
            ip end:   192.168.176.2
    port:67
    lease:2880
    renew:2880
    max client:1
    [WLIB_I]LN882H WiFi Lib Ver: 1.1.3 [build time:Apr 24 2023 15:10:58][0x010103ff]
    [WLIB_I]SoftAP_Startup.
    SoftAP startup!
    ap_startup_cb 137, wifi softap up
    ------- dhcp stop ----------
    -------DUMP DHCP SERVER_CONFIG----------
    server_config.server=192.168.176.1
    server_config.port=67
    server_config.lease=2880
    server_config.renew=2880
    server_config.ip_start=192.168.176.2
    server_config.ip_end=192.168.176.2
    server_config.max=1
    -----------------END--------------
    IP_POOL: i=0 192.168.176.2
    xTaskCreate, name: dhcpd, priority: 4, stack size: 1280
    dhcpd_task start...
    [WLIB_I]HwInd:UKI:0
    [WLIB_I]Channel scanning not needed
    [WLIB_I]User Preferred channel idx 5-0
    [WLIB_I]Selecting 20MHz ch from One of ... 0 1 2 3 4 5
    [WLIB_I]Selected Channel Tbl Idx 5-0
    [WLIB_I]AP: Starting network in 5-0
    [WLIB_I]Connected.
    [WLIB_I]Status: Start Successful. Entering Enable State.
    [WLIB_I]Disconnected.
    [WLIB_I]Channel scanning not needed
    [WLIB_I]User Preferred channel idx 5-0
    [WLIB_I]Selecting 20MHz ch from One of ... 0 1 2 3 4 5
    [WLIB_I]Selected Channel Tbl Idx 5-0
    [WLIB_I]AP: Starting network in 5-0
    [WLIB_I]Connected.
    [WLIB_I]Status: Start Successful. Entering Enable State.
    [01-01 00:00:02 ty N][lr:0x100abaab] cur stat:13  0x10078421 -->>
    [01-01 00:00:02 ty N][lr:0x100abae5] wifi netstat changed to:13  -->>
    [01-01 00:00:02 ty N][lr:0x100abafb] report wifi netstat[13] to callback  -->>
    [01-01 00:00:02 ty N][lr:0x10078439] last wifi stat:255, wifi stat 13
    [01-01 00:00:02 ty N][lr:0x10078445] size:111032
    [01-01 00:00:02 ty N][lr:0x1007859f] start ez & ap auto blink
    [01-01 00:00:02 ty N][lr:0x100add25] timer stated, short timer:0x0, long timer:0x100adb65
    [01-01 00:00:02 ty N][lr:0x100cc67b] bt startup attr:ff
    [01-01 00:00:02 ty N][lr:0x1008844f] upd product_id type:1 keyh84mvjw3x7qdf
    xTaskCreate, name: host_main_thread_hdl, priority: 8, stack size: 5120
    [01-01 00:00:02 ty I][tal_thread.c:184] thread_create name:host_main_thread_hdl,stackDepth:5120,totalstackDepth:33792,priority:8
    [01-01 00:00:02 ty I][lr:0x100bb15d] le acl buf sz = 251,max buf = 5
    
    [01-01 00:00:02 ty I][lr:0x100b9b7b] acl buf sz = 251, max pkt = 5, avail pkt = 5
    
    [01-01 00:00:02 ty I][lr:0x100bb625] GAP init: stop adv
    [01-01 00:00:02 ty I][lr:0x1007e775] ble_hs_timer reset:100
    [01-01 00:00:02 ty I][lr:0x10080ed9] Stack sync
    [01-01 00:00:02 ty I][lr:0x10080eb9] Init/Deinit Event
    [01-01 00:00:02 ty N][lr:0x10088411] ty bt sdk init success finish
    [01-01 00:00:02 ty N][lr:0x100bbb4b] Start Adv
    [01-01 00:00:02 ty N][lr:0x100999c7] __devos_init_evt success
    [01-01 00:00:02 ty I][lr:0x100bb625] GAP init: stop adv
    [01-01 00:00:02 ty I][lr:0x1007e775] ble_hs_timer reset:0
    [01-01 00:00:02 ty N][lr:0x100bbb4b] Start Adv
    [01-01 00:00:02 ty N][lr:0x10087fc1] ble adv updated
    xTaskCreate, name: TCP_ap_v4, priority: 5, stack size: 3584
    [01-01 00:00:02 ty I][tal_thread.c:184] thread_create name:TCP_ap_v4,stackDepth:3584,totalstackDepth:37376,priority:5
    [tkl_wifi_get_mac:1229] if: 0, mac: d8:d6:68:49:57:8c
    ble_mac: 8d:57:49:68:d6:d8
    [tkl_wifi_get_mac:1229] if: 1, mac: d8:d6:68:49:57:8d
    ble_mac: 8d:57:49:68:d6:d8
    [01-01 00:00:02 ty E][lr:0x100a93c1] timer is not run,wait
    [01-01 00:00:02 ty I][lr:0x1007e879] ble_hs_timer_exp:
    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]
    


    and some more random pics of the PCB Close-up of a section of a PCB with visible electronic components. Close-up of a PCB section with visible capacitors and an MB10F bridge rectifier. Electronic module on a PCB with a visible QR code. The image shows a small circuit board with wires attached to components. Image of a PCB with several green capacitors and wires on a work mat background. A photo of a circular PCB with colorful SMD LEDs on a wooden table. Close-up of a BP5758 integrated circuit on a PCB with colored LED lights.

    pinched from the Daybetter thread https://www.elektroda.com/rtvforum/topic3925050.html

    Diagram of current flow in the BP5758D circuit with MCU.

    the adventure continues...
  • #13 20984119
    gregmarfaing
    Level 7  
    Posts: 16
    Help: 2
    Rate: 3

    Aww... this sucks!
    And it's really weird that it broke as the flashing part was really straightforward for me and the module worked flawlessly before breaking it myself.
    Still, good luck with the next one! I'll buy a new one soon as (I don't know if it's the same in other countries) these cheap things are always on sale at the beginning of the month at AliExpress
  • #14 20984227
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    yeh annoying. maybe I killed something testing continuity right through to each pin on the IC. no matter, theyre cheap and another will be here in 5 days. Can't be too precious about these cheapo things.

    Can't say I'd noticed them being cheaper at the beginning of the month really.
  • #16 20995184
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    This may require one little change more. You need to add the related file to Make. Here is an example how I did that for power metering:
    https://github.com/openshwprojects/OpenLN882H/commit/5e1e686bc5884ef0abee362bc791be660a541a2b
    Helpful post? Buy me a coffee.
  • #19 21002234
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    If you have enabled this driver and updated the SDK, and it compiles fine with:
    
    #define ENABLE_DRIVER_BP5758    1
    

    then you should next try using it on LN882H to see if driver is available.
    Helpful post? Buy me a coffee.
  • #20 21002248
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    oh. I enabled the driver with #define ENABLE_DRIVER_BP5758 1

    but does this need you to OK again it now before I can try a test workflow build?

    Screenshot showing a notification about a workflow awaiting approval on the GitHub platform.
  • ADVERTISEMENT
  • #21 21002253
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    I think that you can still click here:
    Screenshot of a version control system interface showing a build log with several commits.
    and get the build files from the commit build.
    Helpful post? Buy me a coffee.
  • #22 21002260
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    ah crap yes. you're right. AND I remember your guide says this 😳

    Added after 30 [minutes]:

    hmm

    Screenshot of a user interface showing driver information and a text command.

    the latest bin does include driver enable in main https://github.com/openshwprojects/OpenBK7231...mits/277443b2a56f0343a84afe548b226ddbc5712a3f

    A configuration file excerpt with driver definitions showing the enabling of driver BP5758.

    and you've already merged the LN882H PR to add driver file for LNH882H https://github.com/openshwprojects/OpenLN882H/pull/9

    Screenshot showing details of a merged pull request on GitHub.

    so, not sure now
  • #23 21002388
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    Updating the SDK requires also a manual update of dependencies in the main App repository. I did it myself on the App, but did you merge my changes into your fork?

    Still, if that were missing, then you'd get linker errors...

    Oh, I've found a problem! We didn't have such define! We have just one large define for all 4 LED drivers:
    Source code snippet in an editor with LED driver definitions.
    Sorry, I should have caught it earlier.
    Helpful post? Buy me a coffee.
  • #24 21002439
    divadiow
    Level 38  
    Posts: 5038
    Help: 438
    Rate: 891
    aha! that explains why I didn't see any other BP5758 defines for other chipsets

    Does this mean all LED drivers under that umbrella define need adding to LN882H?

    Screenshot of compilation errors indicating undefined references in LED driver code.
  • #26 21009504
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    We can give it a try
    Helpful post? Buy me a coffee.
  • #28 21010121
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    Good job, but now, if we want to release it, you need to create a separate PR, because your PR also enables that unusual LED driver on Beken...
    Helpful post? Buy me a coffee.
  • #30 21010227
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14589
    Help: 654
    Rate: 12611
    Both approaches are acceptable. Let me check out the new PR.
    Helpful post? Buy me a coffee.

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