logo elektroda
logo elektroda
X
logo elektroda

Flashing Issues with LSC Light Bulbs Model 2578539.2 Using BK7231 UART Flasher

mattistiret1 2445 35
ADVERTISEMENT
  • #31 21431975
    p.kaczmarek2
    Moderator Smart Home
    So your Tuya config contains:
    Code: JSON
    Log in, to see the code

    but your device is using pins 7 and 8 in reality?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #32 21432264
    gehaxelt
    Level 6  
    Yes, exactly! Bktool's dissect_dumps outputs pins 9/24 with the SM2235 driver, but in reality I got the bulb to work pin 7/8 with the BP5758D driver.
  • ADVERTISEMENT
  • #33 21432275
    divadiow
    Level 35  
    glad you found the right pins. There are currently 8 other devices in the devicelist with the same
  • ADVERTISEMENT
  • #34 21432855
    p.kaczmarek2
    Moderator Smart Home
    This is very strange. Can you do pin extraction on your device again and share created file, so we can just double-check that it has incorrect pins?
    https://www.youtube.com/watch?v=VDbaLR_0YWs
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #35 21434152
    gehaxelt
    Level 6  
    Hi again,

    sure, let's debug this! The original dump can be found in >>21425425. Here are the commands I used for extraction of the config/template:

    
    $> pacman -Qi bk7231tools 
    Name            : bk7231tools
    Version         : 2.0.2-1
    
    $> bktools dissect_dump -O output -e --rbl --storage lcs-led-rgbw-lb2.img 
    RBL containers:
    	0x10f9a: bootloader - [encoding_algorithm=NONE, size=0xea20]
    		extracted to output
    	0x129f0a: app - [encoding_algorithm=NONE, size=0xec1a0]
    		extracted to output
    Storage partition:
    	0x1ee000: 28 KiB - 3 keys
    	- 'gw_bi'
    	- 'tuya_seed'
    	- 'gw_di'
    WARNING:root:Block by ID 2 does not exist, returning empty
    		extracted all keys to output/lcs-led-rgbw-lb2_storage.json
    WARNING:root:Block by ID 2 does not exist, returning empty
    		extracted 'gw_bi' to output/lcs-led-rgbw-lb2_storage_gw_bi.bin
    		extracted 'tuya_seed' to output/lcs-led-rgbw-lb2_storage_tuya_seed.bin
    		extracted 'gw_di' to output/lcs-led-rgbw-lb2_storage_gw_di.bin
    App code `user_param_key`:
    	- found! Extracted to output/lcs-led-rgbw-lb2_user_param_key.json
    	
    $> cat output/lcs-led-rgbw-lb2_user_param_key.json
    {
    	"2235ccur": 14,
    	"2235wcur": 6,
    	"Jsonver": "1.1.9",
    	"brightmax": 100,
    	"brightmin": 5,
    	"cagt": 20,
    	"category": "0505",
    	"cmod": "rgbcw",
    	"colormax": 100,
    	"colormin": 10,
    	"colorpfun": 1,
    	"crc": 72,
    	"cwmaxp": 100,
    	"cwtype": 0,
    	"defbright": 100,
    	"defcolor": "c",
    	"deftemp": 100,
    	"dmod": 8,
    	"gmkb": 60,
    	"gmkg": 60,
    	"gmkr": 80,
    	"gmwb": 75,
    	"gmwg": 70,
    	"gmwr": 100,
    	"iicb": 0,
    	"iicc": 4,
    	"iicg": 1,
    	"iicr": 2,
    	"iicscl": 24,
    	"iicsda": 9,
    	"iicw": 3,
    	"module": "CBU",
    	"notdisturb": 0,
    	"onoffmode": 1,
    	"pairt": 600,
    	"pmemory": 1,
    	"prodagain": 0,
    	"remdmode": 1,
    	"rgbt": 15,
    	"rstbr": 50,
    	"rstcor": "c",
    	"rstnum": 5,
    	"rsttemp": 100,
    	"title20": 1,
    	"wfcfg": "spcl",
    	"wfct": 10,
    	"wt": 20
    }
    	
    => Pin 24 (scl) and 9 (sda) was extracted in combination with the SM2235 driver.
    


    I've attached the "Tuya GPIO Config" obtained from the flashed OBK bulb. Trying to import that file in BK7231Flasher.exe (run with mono on Linux) throws an exception:

    
    Sorry, exception occured: System.ArgumentNullException: Buffer cannot be null.
    Parameter name: buffer
      at System.IO.MemoryStream..ctor (System.Byte[] buffer, System.Boolean writable) [0x00009] in <296872a6734f443990477e3abd954b57>:0 
      at System.IO.MemoryStream..ctor (System.Byte[] buffer) [0x00000] in <296872a6734f443990477e3abd954b57>:0 
      at (wrapper remoting-invoke-with-check) System.IO.MemoryStream..ctor(byte[])
      at BK7231Flasher.TuyaConfig.fromBytes (System.Byte[] data) [0x0013f] in <0c14a74d79404cf69fc2e40bca5b14d7>:0 
      at BK7231Flasher.TuyaConfig.fromFile (System.String fname) [0x00024] in <0c14a74d79404cf69fc2e40bca5b14d7>:0 
      at BK7231Flasher.FormMain.importTuyaConfig (System.String file) [0x00008] in <0c14a74d79404cf69fc2e40bca5b14d7>:0 
    


    But then again, the lamp works with the following configuration:

    
      "pins": {
        "7": "BP5758D_DAT;0",
        "8": "BP5758D_CLK;0"
      },
    


    Does that help?
  • #36 21434397
    p.kaczmarek2
    Moderator Smart Home
    That's interesting, it really looks like a previous version left over in the Tuya keys partition. There are no mentions of pin "8" at all. Maybe they had to change their batch at factory internally and used hardcoded pins for BP5758D while not removing old config?

    Unless we have some kind of JSON extraction bug, I don't know, maybe config partition can have it's own previous version stored as well as in the fragments...
    Helpful post? Buy me a coffee.

Topic summary

The discussion addresses flashing issues with LSC Light Bulbs model 2578539.2 using the BK7231 UART flasher, where users encountered "bus failed" errors and suspected incorrect UART pin connections or lack of power to the chip. Initial attempts to flash using default pinouts (e.g., pins 9 and 24 for I²C) failed. Investigation revealed the bulb uses a BP5768 LED driver chip, differing from the BP5758 driver supported by existing esphome libraries. Successful flashing was achieved by identifying the correct UART and I²C pins (notably pins 7 and 8 for BP5758D data and clock lines) through oscilloscope measurements and pin extraction from a working bulb. Users shared configurations and importable OBK (OpenBeken) driver settings, emphasizing the need to stop old drivers, clear GPIO roles, and assign correct pin roles for BP5758D. Firmware dumps and Tuya configuration extractions showed discrepancies between documented and actual pin assignments, suggesting factory changes or legacy config remnants. Attempts to flash back original firmware using OpenBeken were discussed, with advice to reboot after config changes and verify driver operation via web UI. The community noted that some firmware versions (e.g., 1.5.2) are patched, preventing cloudcutter profile creation. Overall, the solution involved manual pin discovery, correct driver selection (BP5758D for BP5768 chip), and proper OBK configuration to enable flashing and control of the LSC 2578539.2 bulbs.
Summary generated by the language model.
ADVERTISEMENT