Remove diffusing filter.
Undo 3 screws.
Unplug ribbon cable from LED board.
Gently pry off back cover with small flat tool. Plastic is very soft/brittle.
CB2L module is soldered to power board.
I don't know this system much. Maybe Python's hid_download_py can work. You can see CB2S (very similar to CB2L) dumping in this video: https://www.youtube.com/watch?v=PKkiqDNFIx8
Issue was with forms.
System.Windows.Forms.dll
"The Carbon driver has not been ported to 64bits, and very few parts of Windows.Forms will work properly, or at all"
Was able to get the app working in VM.
Continuing breakdown and UART flashing -
Wire up power to extension pins and grab TX, RX, and CEN off the back of the board.
CEN can be grounded to the large ground pad on the board.
Below is the dump information:
Device configuration, as extracted from Tuya:
- LED Green (Channel 2) on P24
- LED Cool (Channel 4) on P8
- LED Blue (Channel 3) on P6
- LED Warm (Channel 5) on P7
- LED Red (Channel 1) on P26
Device seems to be using CB2L module, which is using BK7231N.
And the Tuya section starts, as usual, at 2023424
Just got a single pack of one of these and it uses a different module. There isn't consistency. Configuration values are the same. Module firmware from Lumary before flashing was 2.3.x in the Tuya app.
Selected by firmware and it flashed OTA like normal.
Can you post Tuya Config? So you got BK7231T version that time?
Already flashed it. Yes it was WB2L with newer firmware.
Manufacturer date was sept. 21. Manf date on others was Dec. 21
Added after 1 [hours] 29 [minutes]:
Plot thickens. Manf date 2022, Aug. Completely new revision of the board. Could not configure the pins the same. Light wouldn't work. Opened it to see what was going on.
Module CB2L
Had to cut the board to expose the back of the module for the pins.
And cannot find tuya config
Backup 2MB created, now will attempt to extract Tuya config.
Failed to extract Tuya keys - magic constant header not found in binary
Sorry, failed to find Tuya Config in backup binary.
Bin attached
Attachments:
readResult_BK7231N_QIO_n_2023-28-6--20-29-59.bin(2 MB)
You must be logged in to download this attachment.
There are PWM-SDA and PWM-SCL markings on the board. This indicates a "I2C-like" LED driver such as BP5758, SM2135, etc. Please see where are the SDA/SCL signals going. What is the name of the chip? It should be in SOIC8 case or similiar.
KP18058 looks like one of those "I2C-like" LED driver chips, where only two digital lines (SDA and SCL) are used to control 5 channels of LEDs. The problem is, KP18058 doesn't seem to be well known. There are only few google results for that. It seems it has a product page here:
http://www.kiwiinst.com/productinfo/1248723.html It seems that only full datasheet is available per request:
http://www.kiwiinst.com/productinfo/1248723.html
That basically means we don't have KP18058 support in OpenBeken and currently don't know how to add it.
But, maybe, it has the same protocol as SM2135, or BP5758, SM2235, or BP1658CJ:
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/drivers.md So I've been thinking maybe you can try to check if any of those drivers are working for your chip. For SM2135, set the two pin roles in config module, then reboot your device, and check if RGB control works. Do the same for other LED drivers.
If KP18058 is indeed a separate chip with yet another protocol ,then we need to either get the datasheet or two wire communication capture sample for analysis, so I can write a driver for that.
Can you provide more information where was your device bought?
More info on this setup - (third revision with SDA). I had a wiring issue in original read.
Read @ 115200
Write @ 921600
Other rates fail.
I corrected and the results of read are below:
Code: JSON
Log in, to see the code
Device configuration, as extracted from Tuya:
- UnknownDAT on P8
- UnknownCLK on P7
- LED remap is 1 2 0 3 4
Device seems to be using CB2L module, which is using BK7231N.
And the Tuya section starts, as usual, at 2023424
But, maybe, it has the same protocol as SM2135, or BP5758, SM2235, or BP1658CJ:
https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/drivers.md So I've been thinking maybe you can try to check if any of those drivers are working for your chip. For SM2135, set the two pin roles in config module, then reboot your device, and check if RGB control works. Do the same for other LED drivers.
I have tried the three available drivers and none work. If I can assist let me know. I do not have a spectrum analyzer.
Please stand by @swpharis , we will need your help with testing once @DeDaMrAz does packets capture. I wonder how the protocol looks like. Some such LED drivers are using 8 bits per channel, giving us 256 possible options per color, but others are also 10-bit (1024 options per color).
Google translated from Chinese.:
KP18058 is a high-precision five-channel full-pressure LED linear constant current moderation chip, which can be independently set by the I2C (Inter-Integrated-Circuit Bus) interface 5 street currents to support various modes of light adjustment. The CW channel is an analog light-tuning method. The RGB channel supports analog lighting and chopping wave lighting, while supporting 1024 gray-order lighting per road to meet the lighting needs in various settings.
It finally arrived!! Can confirm CB2L module inside and that KP18058ESP driver IC is inside. It will take some time to get to it and figure out the protocol but now we can at least work on this
Looking forward to figuring this out - just reporting some progress, please be patient.
Very good job with drawing the schematic, @DeDaMrAz . It looks like a classic Tuya IoT device circuit, though.
A fusible resistor at the input, sadly (as often) without a varistor, not much interference filters except their classic "inductor between two 400V caps" filter, then a step down (non isolated) converter (again, usual, I have never seen Tuya product with capacitive dropper, it seems those droppers are less and less used), and finally, CB2S with I2C lines (with pull up resistors) connected to the "I2C" LED controller.
My best guess is because this is a 110-120V ONLY device that is why 200V but bad design overall, regardless of it being a "classic" and low cost I don't like it at all.
Were you able to get it to work with the BP5758 driver? I am not able to get it to function. Maybe I am doing something wrong?
It was just a thought, because they looked very, very similar. Thanks for trying but unfortunately you will have to wait for the protocol to be decoded - we will try probably this weekend.
✨ The discussion focuses on the Lumary 5/6 Inch Downlight using the CB2L module with a BK7231N chip and a KP18058esp LED driver IC. Initial hardware disassembly steps include removing the diffusing filter, screws, and unplugging the ribbon cable to access the soldered CB2L module. The KP18058esp is identified as a five-channel I2C-like LED driver supporting 1024 grayscale levels per channel, controlling RGB and CW LEDs. Attempts to dump firmware and extract Tuya configuration faced challenges due to varying module revisions and firmware versions. The KP18058 protocol was unknown initially, with no existing OpenBeken support, but similarities to drivers like SM2135 and BP5758 were explored. Pin assignments for SDA and SCL lines were identified (P8 and P7 respectively), and a driver implementation was developed and integrated into OpenBeken firmware builds (from version 1.17.189 onwards). Commands such as startDriver KP18058, KP18058_Map for channel mapping, and KP18058_RGBCW for LED control were introduced. Testing confirmed functional control of RGB and CW channels, with ongoing refinements including pin role selection and brightness calibration. The power board schematic reveals a typical Tuya IoT device design with a non-isolated step-down converter and minimal input filtering. Users reported a brightness discrepancy in the cool white channel, likely adjustable via KP18058_Current command parameters. The device is available on Amazon with different listings and hardware revisions, complicating uniform support. The project is open for community testing and contributions.
TL;DR: This FAQ gives OpenBeken users 15 answers and the expert warning "SHOCK HAZARD" for flashing Lumary 5/6 Inch Downlights with CB2L, BK7231N, and KP18058ESP, solving disassembly, UART flashing, pin roles, channel mapping, and dim cool-white issues. [#20659312]
Why it matters: The same Lumary-looking downlight can contain CB2L, WB2L, or TYWE2S hardware, so correct identification prevents failed flashing and unsafe probing.
Variant discussed
Module
Chip family
LED control
OpenBeken outcome
Lumary US-DL6A-4 4-pack
CB2L
BK7231N
KP18058ESP, DAT P8, CLK P7
Supported with KP18058 roles
Single-pack September 2021 unit
WB2L
BK7231T
Same configuration values
Flashed OTA by firmware selection
Received test unit
TYWE2S
ESP-based Tuya module
No KP LED controller
Not the target KP18058 board
Key insight: Treat each Lumary 5/6 inch downlight as a board-specific device. Open it, identify the module and LED driver, then apply KP18058_DAT on P8 and KP18058_CLK on P7 only when the KP18058ESP board is present.
Quick Facts
The working KP18058ESP Lumary template uses BK7231N, CB2L, flags 1024, GPIO7 as KP18058_CLK, and GPIO8 as KP18058_DAT. [#20680104]
UART testing reported read at 115200 baud and write at 921600 baud; other rates failed on that setup. [#20635729]
The extracted KP18058 Tuya configuration used iicsda: 8, iicscl: 7, brightmin: 5, brightmax: 100, and cwmaxp: 100. [#20635729]
The early PWM-only CB2L board mapped RGB and white channels as green P24, cool P8, blue P6, warm P7, and red P26. [#20630634]
KP18058 current control accepts values from 0 to 31; KP18058_Current 14 30 sets RGB to 14 and CW to 30. [#21434389]
How do I disassemble a Lumary 5/6 inch downlight to access the CB2L module and LED driver board?
Remove the diffuser, undo 3 screws, unplug the ribbon cable, then pry off the back cover carefully.
Remove the diffusing filter.
Undo the 3 screws and disconnect the LED-board ribbon cable.
Use a small flat tool on the back cover, because the plastic is soft and brittle.
The CB2L module sits soldered to the power board. [#20625124]
What is the CB2L module in a Lumary downlight, and how is it related to the BK7231N chip?
CB2L is the soldered Wi-Fi module used on several Lumary downlight revisions. "CB2L is a Tuya-style wireless module that provides Wi-Fi control for the light, using the BK7231N chip as its main microcontroller." The extracted device configuration explicitly reported CB2L and BK7231N together. [#20630634]
What is the KP18058ESP LED controller, and why does OpenBeken need a specific driver for it?
KP18058ESP is a five-channel LED controller that needs its own OpenBeken protocol driver. "KP18058ESP is an I2C-like RGBCW LED driver chip that controls five LED channels over SDA and SCL, using a protocol not handled by SM2135, BP5758, SM2235, or BP1658CJ." OpenBeken initially lacked support, so developers decoded the two-wire protocol. [#20635653]
How can I dump the flash from a BK7231N or CB2L device on macOS if the BK GUI Flash tool crashes under Mono?
Use Python hid_download_py, or run the BK GUI Flash tool in a virtual machine. The Mono build failed on macOS because System.Windows.Forms.dll used a Carbon driver not ported to 64-bit. A forum video showed similar CB2S dumping, and Python was reported working. [#20630634]
What UART pins and flashing speeds worked for reading and writing the Lumary CB2L downlight firmware?
Power the extension pins, then connect TX, RX, and CEN on the board back. Ground CEN to the large ground pad when needed. The successful setup read firmware at 115200 baud and wrote firmware at 921600 baud. Other baud rates failed on the third KP18058 board revision. [#20635729]
Which OpenBeken pin roles should I use for the Lumary 5/6 inch downlight with KP18058ESP on BK7231N?
Use KP18058_CLK on GPIO7 and KP18058_DAT on GPIO8 for the documented Lumary US-DL6A-4 template. The template identifies the device as Lumary 5/6 Inch Downlight, model US-DL6A-4, chip BK7231N, and board CB2L. It also tags the device as KP18058ESP and 110V. [#20680104]
How should I configure KP18058_DAT and KP18058_CLK in OpenBeken for the Lumary US-DL6A-4 downlight?
Assign GPIO8 to KP18058_DAT and GPIO7 to KP18058_CLK in the OpenBeken pin configuration. Earlier testing hardcoded P8 as SDA and P7 as SCL, then later builds added selectable KP18058 pin roles. The published template uses exactly those two roles for US-DL6A-4. [#20680104]
What does the OpenBeken command KP18058_Map 2 0 1 3 4 do for RGB, warm white, and cool white channel mapping?
KP18058_Map 2 0 1 3 4 remaps KP18058 physical channels to the desired RGBWC order. The developer described 20134 as RGBWC and suggested adding it to autoexec.bat. On the confirmed Lumary setup, startDriver KP18058 plus KP18058_Map 2 0 1 3 4 made the light work correctly. [#20665364]
Why did SM2135, BP5758, SM2235, and BP1658CJ drivers not work with the KP18058ESP LED controller?
Those drivers failed because KP18058ESP used a different two-wire command protocol. The existing OpenBeken drivers were worth testing because their chips also use SDA and SCL. Testing found the three available drivers did not work, so developers captured and decoded KP18058 traffic instead. [#20635765]
KP18058ESP vs BP5758 vs SM2135: how do these I2C-like LED driver chips differ for RGBCW lights?
KP18058ESP, BP5758, and SM2135 all use two digital lines, but they do not guarantee protocol compatibility. KP18058ESP controlled five RGBCW channels in this Lumary board through DAT on P8 and CLK on P7. BP5758 looked similar enough to test, yet it still failed before native KP18058 support arrived. [#20661196]
Why do different Lumary downlights from similar Amazon listings contain different modules like CB2L, WB2L, or TYWE2S?
Lumary shipped similar-looking downlights with different internal revisions and modules. One single-pack unit used WB2L with newer 2.3.x Tuya firmware, while other units used CB2L. A later received light had TYWE2S and no KP LED controller, proving listing appearance did not guarantee the same board. [#20644531]
What should I do if Tuya config extraction fails with a magic constant header not found error on a Lumary downlight backup?
Treat the device as a different revision and inspect the board manually. One August 2022 CB2L board produced magic constant header not found and no Tuya config from a 2 MB backup. The user then identified SDA/SCL board markings and confirmed a KP18058ESP chip by opening the light. [#20634833]
How can I troubleshoot a Lumary KP18058 downlight where the cool white channel is much dimmer than warm white in OpenBeken?
Check the LED remap and then test KP18058 current settings. The reported faulty case used KP18058DAT on P8, KP18058CLK on P7, and remap 1 2 0 4 3. Cool white glowed near 2% at 100%, then returned bright after power cycling, suggesting configuration or current handling needed testing. [#21434384]
What does the KP18058_Current 14 30 command control, and what current values are safe for RGB and CW LEDs?
KP18058_Current 14 30 sets RGB current to 14 and CW current to 30. Allowed values run from 0 to 31, with 30 described as the default CW value and 31 as maximum. Use caution, because raising current can burn LEDs. [#21434389]
What safety risks should I know about when opening or probing the Lumary 110V downlight power board with a non-isolated LED supply?
The Lumary power board can expose dangerous mains-related LED circuitry while opened. The drawn schematic warning said there was no input-side LED regulation and marked it as a shock hazard. The same discussion identified the device as 110–120V only and criticized the low-cost non-isolated design. [#20659432]