logo elektroda
logo elektroda
X
logo elektroda

Identifying and Flashing Generic Tuya-Compatible LN882HK-based RGBCW Smart Bulb

caelaron 1251 12
ADVERTISEMENT
  • #1 21228879
    caelaron
    Level 2  
    Here is a LN882HK based smart bulb (RGBCW) that a friend of mine got a bunch of on AliExpress and gave some surplus ones to me:
    Link.

    Packaging of a smart bulb with feature descriptions and QR codes Packaging of RGBCW smart LED bulb. Packaging of the LN882HK (RGBCW) smart bulb on a black background.


    I can't seem to be able to identify a brand (if there is one), but it is advertised as being compatible with the Tuya ecosystem.
    The bulb itself also looks very generic. Removing the lid shows an LED shield with an outer circle of alternating pairs of cold/warm white LEDs, and within 2 rows of 3 multi-cathode RGB LEDs
       15W RGB+CCT smart LED bulb with technical markings on the casing. Interior of a smart bulb showing LEDs and a circuit board.

    Removing some thermal glue from the other edge allows the LED shield to be removed, exposing the main PCB: 
    Close-up view of a circuit board with electronic components.
    Note that the N contact is soldered to the tip of the bulb, whereas the P contact is just clamped between the upper end of the bulbs thread and the lower end of the plastic housing - no idea if this is considered a safety hazard, and also almost impossible to reassemble in the same way. I ended up pulling out the P wire and unsoldering the N wire from the PCB, trying carefully not to burn or break anything.
    The controller used is a LN882HK, where neither the company in general nor the chip itself are known to me or anyone else I know.
    Close-up of the LIGHTNING LN882HK integrated circuit on a printed circuit board.
    Naturally it is also not supported by ESPHome, which led me to do an online search that quickly brought me here.

    The backside exposed 2 pairs of UART TX/RX, where U0 is used for flashing and U1  probably as log terminal (I can only guess, since I didn't need to use it) , 3V3 supply and GND as well as a CEN (chip enable, not needed for flashing) and P21, which needs to be pulled to GND for flashing through UART. 
    Close-up of the SD205-9W circuit board with marked areas for flashing and debug output.
    Red box: used for flashing
    Yellow box: debug output (?) 

    Note that at the bottom right, you can see the cathode connectors of the corresponding LEDs (RGBCW) - the transistors driving them are connected to: 

    P09/GPIOA1 -> C
    P12/GPIOA4 -> W
    P13/GPIOA5 -> R
    P14/GPIOA6 -> G
    P15/GPIOA7 -> B

    For flashing, I used a USB to UART/TTL adapter (3.3V) with the following connection:
    U0-TX -> RX
    U0-RX ->TX
    GND -> GND
    3V3 -> 3V3 (benchtop PSU, current limit 500mA)
    P21 -> GND(during flashing)
    Image of a printed circuit board labeled SD205-9W with attached colored wires.

    For flashing OpenBeken, I followed the description in the flashing guide in this forum(Link) as liked on github. 
    Flashing worked without any problems - after removing the short between GND and P21 and power cycling, I was able to connect to an OpenLN882H_C25E1088 hotspot. 
    Configuration and HomeAssistant integration worked without any hickups, so I'll not go into details  here. 

    Using the GPIO finder, I managed to confirm the connections of the LED groups as I suspected from the PCB: 
    Screenshot of the GPIO Doctor Pins tool showing output settings and low values.

    Code: JSON
    Log in, to see the code



    However, here is where I ran into some issues: 
    If I configure the pins as relays, I'm able to switch all 3 colors (RGB) plus cold/warm white without issue. If I configure them as PWM, I can only use G/B + warm white. 

    I'm not sure whether this is due to the LN882HK (maybe they use timer sharing for PWMs, or the pins need to be configured in a certain way) or just some oversight on my side - maybe I'll look into it some more if I find the time. Also if anyone has an idea what could be the issue, please reach out!

    Summary:

    My main aim was to have a dimmable warm white smart bulb, and thanks to OpenBeken and the instructions on this forum, I managed to get it working within on evening. The one issue remaining is the 5 simultaneous PWMs not working atm, but with an obscure chinese platform such as the LN882, and with such limited background information for developers available (that is not chinese), I think the mere fact that it is working at all is remarkable.
    You have certainly done an amazing job portin OpenBeken to so many platforms as well as provide such detailed instructions on how to flash and use it!

    Many thanks for that, I'll try to provide info on any compatible devices that I come across, as well as any bugs or issues with the software, should any pop up.
  • ADVERTISEMENT
  • #3 21229881
    caelaron
    Level 2  
    >>21229188 Thanks, I'd gladly try it out but the link seems to be dead (or I don't have access to it).
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #5 21229906
    caelaron
    Level 2  
    >>21229885 Works perfectly, thanks!
  • #6 21229911
    divadiow
    Level 34  
    Thanks for confirming/testing
  • #7 21279370
    divadiow
    Level 34  
    @caelaron @davidezborges would you be willing to share the backups of factory firmware from your LN882H devices?
  • #8 21279521
    davidezborges
    Level 6  
    >>21279370 Gladly, how can I upload them to the forum?
  • #9 21279539
    divadiow
    Level 34  
    this option allows the attachment of .bin or .zip files

    Screenshot of an interface with the Add attachment option highlighted in yellow, allowing file attachment.
  • ADVERTISEMENT
  • #11 21296286
    0xWaveD3str0y3r
    Level 1  
    Hi there, I have the same smart light bulb I got from Aliexpress. I did get a backup and flashed already the latest firmware for the device OpenLN882H_1.17.767.bin so far everything went alright with flashing the bulb. I have access to the device Webserver to configure the smart bulb, in the configure section I did set "configure module" with the values 1-4-2-0-1 as in the picture, but the bulb is not responding. I also noted there is no driver being used. I'm new here, perhaps I'm missing something obvious or some details related to the setup. @caelaron @davidezborges I would appreciate some guidance on how to set up the bulb and make it work, at this time the lights are off at all times. Attached some pics and the backup of the original vendor firmware of my device.
    Ps, I just added a pic of the LED's plate, beside the printed dates it seems the same as the one in the first post.
  • #12 21314538
    davidezborges
    Level 6  
    >>21296286 were you able to configure the device?
    if not, connect to a wifi network and use the web application to test different templates. if that doesn't work, you should use a multimeter and trace the pins used to control the LED and start from there.
  • #13 21507316
    avakim
    Level 1  
    Hello,
    quite new here. Nevertheless, it seems that I have the same bulb, flashed it with success. but then I couldn't find any matching and working template.
    Thus, I applied manually the configuration shared at the top,
      "pins": {
        "1": "PWM;4",
        "4": "PWM;5",
        "5": "PWM;1",
        "6": "PWM;2",
        "7": "PWM;3"
      } 
    .
    And it's working as expected, until some random time when the bulb turn off and disconnect.
    My only option is to switch the lamp electrical power off => on, and wait for the bulb to get back. Sometimes it's immediately, other times I have to wait.
    Thus, I feel like a limit is reach at some point, maybe a temperature one, and makes the bulb to set down.

    Do you have an idea what's going on or/and how to fix it?
    Is it maybe a slightly wrong configuration? Or maybe a flag/option could help (I'm very new to OpenBeken firmaware)?

Topic summary

The discussion revolves around identifying and flashing a generic LN882HK-based RGBCW smart bulb, which is compatible with the Tuya ecosystem. A user shared images of the bulb and its internal components, including an LED shield and main PCB. Participants provided links to firmware development resources, specifically mentioning PWM development for the LN882H. A GitHub link was shared for firmware testing, which the user confirmed worked perfectly after initial access issues.
Summary generated by the language model.
ADVERTISEMENT