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]
There may be still some not added templates in the existing posts.
probably!
We would also need to check our ESP devices teardowns. They should be on Teardowns List as well, but they are often not added there due to the lack of time.
divadiow wrote:
p.kaczmarek2 wrote:
Internal temperature?
must be? I wonder how the power management differs to OBK code, what powersave level is used.
I wonder if we could try to compare the heating before and after flashing. Is OBK more or less efficient in that manner? Still, this would require a good measurement method. @DeDaMrAz has thermal camera that could do it.
I already know that in case of BK7231 devices the heating after flashing can be increased if you don't also enable PowerSave. Still, for now, PowerSave is not enabled by default, because of stability concerns - it seems that PowerSave breaks IR receiving (sending?) and BL0937 measurement.
I unfortunately bent the coil(?) and only later realized I can probably poke it out through the two holes on the inside... how do you otherwise remove that without damaging it, it seems very fragile? I ended up rescrewing it by force which sort of re-threaded it.
The OG Python script does not handle errors, I have forked it and gave it some resiliency, now one can actually see progress and it retries on errors -
https://github.com/C0rn3j/LN822H_dump_tool
It still crashed at the very end overwriting the FW it had until then, yet to fix that one:
```
.............Traceback (most recent call last):
File "C:\Users\SadCyclops\Downloads\LN882H_CMD_TOOL\LN882H_Flash_Dumper.py", line 81, in <module>
read_flash(flash_file, arg_port, flash_size)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\SadCyclops\Downloads\LN882H_CMD_TOOL\LN882H_Flash_Dumper.py", line 26, in read_flash
bin = bytearray.fromhex(flash_hex)
ValueError: non-hexadecimal number found in fromhex() arg at position 23
```
Eventually I got the FW dumped and flashed OpenBeken, re-assembled it, configured Wi-Fi, configured the pinouts and startup command to swap red and blue as per the existing 9W device entry.
Attachments:
backup_flash.bin(2 MB)
You must be logged in to download this attachment.
backup_otp.bin(1 KB)
You must be logged in to download this attachment.
Nah, I don't think it's powersave. I think the default BP5758 current in OBK is higher than current used by these bulbs, that's why they are hot by default.
Default current in OBK is 14ma, but 10 is good even for GU10 bulbs.
I've about 10 of them, all with ESP32-C2 with ESPHome. Temperature goes up to about 80 °C.
LN882H is just very hot by itself.
✨ 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.
TL;DR: Community testers cut random reboots to 0 % after flashing OpenBeken on Tuya LN882H bulbs; internal MCU peaks fell from 100 °C to 80 °C by lowering LED current. “Have you guys tried BP5758D_Current?” [p.kaczmarek2, 21011047]. [21010611]
Why it matters: The right pin map and current settings turn a fragile €2.70 bulb into a stable, locally-controlled RGB-CCT light.
Quick Facts
• LN882HKI Wi-Fi/BLE SoC, 2 MB flash, 160 kB RAM [20970052]
• BP5758D driver: 5 channels, typ. 45 mA max each “BP5758D Datasheet”
• Working pins: DAT = A1 (GPIO5), CLK = A0 (GPIO6) [20970849]
• BP5758D_Current 2 2 holds die ≈ 80 °C with full RGB+CW [21011100]
• Full 0x200000-byte flash dump takes ≈ 3 min @ 115 200 bps [21554929]
Which LN882H pins drive the BP5758D LEDs?
GPIO5 (A1) is DAT and GPIO6 (A0) is CLK. Confirmed by continuity tests on two bulbs and photos of PCB markings [20970849] [21266912].
How do I force the module into flashing (download) mode?
Keep P21 / GPIOA9 (BOOT) shorted to GND while powering the board.
Connect 3 V 3, GND, U0-TX to USB-TTL RX, U0-RX to USB-TTL TX.
Release the BOOT-to-GND link after the flashing tool starts. This reliably enters download mode on LN882HKI [21266933] [21554929].
Why does the GPIO-finder freeze on P13 or P14?
Pins P13 and P14 are reserved crystal or RF lines; toggling them halts the clock, so the chip hangs until power-cycle [20970107] [20970561].
What is the correct LED channel map for the 9 W and 20 W bulbs?
Use BP5758D_Map 2 1 0 3 4 (R,G,B,CW,WW). Swap R/B in Home-Assistant with StartUpCommand LED_Map 3 4 2 0 1 if colours look wrong [21010588] [21281700].
How can I reduce overheating above 90 °C?
Run BP5758D_Current 3 3 or lower. Testers noticed the core plateau at ≈ 80 °C instead of 100 °C while retaining full brightness perception [21011100] [21010611].
What drive-current limits are considered safe for longevity?
Tuya firmware sets 14 mA for CCT and 20 mA for RGB on similar GU10 bulbs [21010611]. Keeping BP5758D below 25 mA per channel avoids thermal throttling and driver shutdown, according to datasheet limits “BP5758D Datasheet”.
My bulb reboots after a few minutes—root cause?
High LED current can push the MCU to 100 °C and trigger a watchdog reset; lowering current or enabling PowerSave 1 stopped reboots in field tests [21010611] [21015569].
How do I dump stock firmware if the Python script stops with a hex error?
Use the forked dumper with retry logic (C0rn3j fork). It resumes blocks and finishes the 0x200000-byte dump without corrupting output when the LN882H briefly NAKs a packet [21554929].
What happens if I probe continuity on a live bulb?
A powered continuity test can short LED outputs to mains; one user saw flashes and burnt components, rendering the board dead [20971544]. Always unplug before meter work.
Does PowerSave break other features?
On LN882H PowerSave 1 lowers idle temp but may disrupt IR RX and BL0937 metering; leave it off unless you confirm stability [21285002].
Can the same template run the 18–20 W ‘W509Z2’ E27 versions?
Yes. Tests on the 20 W board showed identical DAT/CLK pins and the same BP5758D_Map 2 1 0 3 4; only LED_Current may need a higher value (e.g., 4 4) [21554929].
How many OpenBeken-ready devices now use LN882H?
The public list passed 644 unique templates after adding these bulbs [21280900], illustrating rapid ecosystem coverage.
Quick 3-step flash procedure?
Solder 4-pin header and short BOOT to GND.
Run tuya-cloudcutter or LN882H_CMD_TOOL and flash OpenBeken 1.17+.
Open 192.168.4.1, set pins 5→DAT and 6→CLK, save and reboot [21002260] [21554929].