logo elektroda
logo elektroda
X
logo elektroda

[BK7231N/SM2185N] Spectrum Smart 9W RGBCW light bulb Flashing And Driver

leśny_ziutek 2319 16
ADVERTISEMENT
  • LED GLS 9W E-27 Spectrum Smart bulb with color-changing feature.
    https://spectrumled.pl/en/catalogue/product/W...4412/led-gls-9w-e-27-spectrum-smart-woj-14412

    You can buy it on allegro.pl

    Packaging of Spectrum Smart LED 9W E27 bulb with Wi-Fi and Bluetooth features.

    Unfortunately, I have upgraded it to the latest firmware (v1.5.21) so the tuya-cloudcutter didn't work. These are my first steps in this topic, no previous experience with smart bulbs, Tuya, alternative firmwares, etc., hence this fault ;(

    Dodano po 16 [minuty]:

    Fortunately, the teardown and the subsequent UART flashing were successful.

    Disassembled smart LED bulb with visible internal components.

    This bulb uses an I2C driver, SM2185N.

    LED circuit board with electronic components and LEDs in various colors.

    Unfortunately, it doesn't work with the available I2C drivers (tried SM2135 and SM2235). Edit: The SM2235 actually works, see below.

    The board looks like this:

    Close-up of a circuit board with soldered wires and visible tracks and electronic components.

    Connections seem to be standard: P26 is CLK, P24 is DATA.

    See the attached documentation that I found here. It seems to contain the full specification of the protocol used by this chip.

    Cool? Ranking DIY
    About Author
    leśny_ziutek
    Level 12  
    Offline 
    leśny_ziutek wrote 49 posts with rating 9, helped 3 times. Live in city Łódź-Widzew. Been with us since 2006 year.
  • ADVERTISEMENT
  • #2 20812496
    leśny_ziutek
    Level 12  

    Flashed it using the Nucleo board as the USB to UART converter. It should provide enough power for flashing and WiFi, which cannot be said about the FTDI module which I usually use in such cases.

    Nucleo board with connected cables to a module.

    I couldn't get neither BK7231GUIFlashTool nor hid_download_py to work with my Linux/Debian PC. Fortunately the ltchiptool in command line mode works:

    Backup:

    
    $ ltchiptool flash read -d /dev/ttyACM0 -b 115200 BK7231N woj14412-backup.img
    


    Flashing:

    
    $ ltchiptool flash write -d /dev/ttyACM0 -b 115200 ../bk7231flasher/firmwares/OpenBK7231N_QIO_1.17.306.bin
    


    Dodano po 16 [minuty]:

    Two more photos:

    A circuit board with electronic components and four soldered wires.

    Close-up of a circuit board with soldered capacitors and colored wires.

    I hope it will be possible to write a driver for SM2185N. For now I have the very first smart bulb and the very first OpenBeken device but no light ;)

    The next one will be this BL2028N based two channel smart switch:

    Two-zone mini relay Spectrum WOJ+14632 with packaging.

    but this time I will try to be more careful and not upgrade it.
  • ADVERTISEMENT
  • #3 20812649
    p.kaczmarek2
    Moderator Smart Home
    Nice find, we will support is, will you be able to help with testing?

    Here is translated datasheet:
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 20812676
    p.kaczmarek2
    Moderator Smart Home
    @leśny_ziutek from a brief look, it seems that SM2235 driver may work here, the first control byte matches exactly the what I would expect from that driver, the total number of bytes also matches, and it's also 1024 values per each channel
    Helpful post? Buy me a coffee.
  • #5 20812819
    leśny_ziutek
    Level 12  
    Hmm... Tried it without success. Will try one more time.

    Are there logs from I2C communication available anywhere?
  • Helpful post
    #6 20812827
    p.kaczmarek2
    Moderator Smart Home
    No, but the communication is very simple.
    Code: C / C++
    Log in, to see the code

    Bit shift for sending 10 bit value:
    Code: C / C++
    Log in, to see the code

    The constants:
    Code: C / C++
    Log in, to see the code

    Byte meaning in SM2235:
    Bit diagram for SM2235 LED

    The same from SM2185:
    Addressing scheme and instructions for SM2185
    Compare the images, it seems it matches.

    @leśny_ziutek maybe there is some obvious oversight or a mistake made, for example, when you test, do you have SM2235 driver running, is it listed on the main page? Maybe you've chosen wrong GPIO or didn't restart the device?

    Can you attach Tuya CFG partition JSON?
    https://www.youtube.com/watch?v=WunlqIMAdgw
    Helpful post? Buy me a coffee.
  • #7 20812898
    leśny_ziutek
    Level 12  

    p.kaczmarek2 wrote:
    Didn't restart the device?


    Definitely restarted the device when I tried SM2135 but unsure about SM2235. Will try again...

    p.kaczmarek2 wrote:
    Can you attach Tuya CFG partition JSON?
    https://www.youtube.com/watch?v=WunlqIMAdgw


    Ok. I'll try it too.
  • ADVERTISEMENT
  • Helpful post
    #8 20812968
    p.kaczmarek2
    Moderator Smart Home
    SM2135 will certainly not work. It only sends 8 bytes, not 11, and the colors are 8-bit, not 10 bit. Futhermore, the first byte sent is different, so your driver will most likely just ignore SM2135 packets.
    Helpful post? Buy me a coffee.
  • #9 20813757
    leśny_ziutek
    Level 12  
    It works with SM2235 driver!

    Looks like I didn't restart the device when tested this driver.

    Small problem is the reversed "Warm <--- ---> Cool" setting.
  • #10 20813879
    p.kaczmarek2
    Moderator Smart Home
    Have you tried to remap the channels?

    Added after 29 [seconds]:

    Also please attach Tuya CFG partition, so I can add automatic GPIO config for SM2185.
    Helpful post? Buy me a coffee.
  • #11 20814024
    leśny_ziutek
    Level 12  

    SM2235_Map 2 1 0 3 4 command fixed the issue with the reversed warm/cool. The original mapping was 2 1 0 4 3. Thanks!

    I've downloaded the BK7231N_TuyaConfig_obk1F03214D.bin but now have a problem with "drag and drop" it to the bk7231flasher (running in Linux using mono). Is there any other way to load it?
  • #12 20814110
    p.kaczmarek2
    Moderator Smart Home
    Please attach it here and I will check this out.

    Tomorrow morning I will update flasher to also have file open dialog, i was not aware that drag and drop is broken on linux
    Helpful post? Buy me a coffee.
  • #14 20814470
    p.kaczmarek2
    Moderator Smart Home
    Your config indicates that this LED driver is used internally as SM2235.
    Screenshot of firmware programming tool showing JSON section and description.
    Code: JSON
    Log in, to see the code

    Now I will update the flasher for you.

    Added after 7 [minutes]:

    EDIT: Relased https://github.com/openshwprojects/BK7231GUIFlashTool/releases/tag/v1.1.3 can you check?
    Helpful post? Buy me a coffee.
  • #15 20814653
    leśny_ziutek
    Level 12  

    Now I can load the bin file and obtain the JSON and the text description.

    As I've written before, I didn't use BKFlasher to flash this device because of some transmission errors. Instead, I used ltchiptool in cmd mode (GUI mode doesn't work). This is normal if you live without Windows. I'm used to it ;)

    To sum up, all you need to do to get this bulb to work is:

    1. Configure Module:

    - set P24 (PWM4) to SM2235DAT,

    - set P26 (PWM5) to SM2235CLK.

    2. Configure General/Flags:

    - select Flag 4 - [LED] Force show RGBCW controller (for example, for SM2135 LEDs, or for DGR sender),

    - optionally select Flag 12 - [LED] Remember LED driver state (RGBCW, enable, brightness, temperature) after reboot.

    3. Restart the device.

    4. In the Web App execute SM2235_Map 2 1 0 3 4 command to swap the Cool and Warm channels.
  • #16 20831649
    leśny_ziutek
    Level 12  
    Code: JSON
    Log in, to see the code
  • #17 20842623
    p.kaczmarek2
    Moderator Smart Home
    Thank you, device has been added: https://github.com/OpenBekenIOT/webapp/commit/aa9e7d1f0a5d957c2c6929fb25a193277229bd72
    It should be soon live at : https://openbekeniot.github.io/webapp/devicesList.html
    Please submit any other device you may have, we're going to get up to 500 devices soon!
    Helpful post? Buy me a coffee.

Topic summary

The discussion revolves around the Spectrum Smart 9W RGBCW light bulb (model WOJ+14412) which utilizes the BK7231N chip and the SM2185N driver. After a firmware upgrade to v1.5.21, the user faced issues with flashing the device using Tuya-cloudcutter. However, they successfully performed a UART flashing using a Nucleo board and the ltchiptool command line tool. The SM2185N driver was initially incompatible, but the SM2235 driver was found to work after some adjustments, including remapping the color channels. The user shared configuration details and steps to enable the bulb's functionality, including setting specific pins for data and clock signals. The device has been added to the OpenBeken device list for broader community support.
Summary generated by the language model.
ADVERTISEMENT