logo elektroda
logo elektroda
X
logo elektroda

[BK7231T][WB3S] MCU Dimmer SL-02 Firmware Flashing & Configuration Issue

babaganesh 1773 4

TL;DR

  • A BK7231T WB3S-based SL-02 MCU dimmer is being flashed and configured after the original module was removed and dumped.
  • TX traffic from the stock firmware shows Tuya SetDP packets for dpId 21 Enum V=1 and dpId 24 Str V=008303e803e8 while setting green.
  • Using `tuyaMcu_setupLED 24 0` makes dimmer buttons appear in the web UI.
  • The buttons still do not work, and the missing `[TasFormat] [dpIDPower]` mapping seems to be the remaining problem.
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
📢 Listen (AI voice):
  • Close-up of a circuit board with a WB3S module.
    Lamp with a white base and a glowing turquoise shade.

    Removing WB3S with soldering iron wasn't easy, cause copper is very thin and easy to torn apart.
    Otherwise usual flashing.

    I've dump tx pin on original firmware when setting color(green)

    //R 2024-02-23 14:13:14 WiFi received:
    55AA00060005150400010125
    //R 2024-02-23 14:13:15 WiFi received:
    55AA000600101803000C30303833303365383033653807

    Received by WiFi module:
    55 AA 00 06 00 05 1504000101 25
    HEADER VER=00 SetDP LEN dpId=21 Enum V=1 CHK

    Received by WiFi module:
    55 AA 00 06 00 10 1803000C303038333033653830336538 07
    HEADER VER=00 SetDP LEN dpId=24 Str V=008303e803e8 Col: ■ CHK

    And tried config

    startDriver TuyaMCU
    tuyaMcu_setupLED 24 0


    with this I see dimmer buttons on web, but they don't work.
    I guess I missed something in
    >[TasFormat] [dpIDPower]

    Could someone please point me in the right direction

    Cool? Ranking DIY
    About Author
    babaganesh
    Level 3  
    Offline 
    babaganesh wrote 10 posts with rating 2, helped 1 times. Been with us since 2023 year.
  • ADVERTISEMENT
  • Helpful post

    TuyaMCU setup and query-state logging suggested

    #2 20977514
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807
    Here is TuyaMCU guide:
    https://www.elektroda.com/rtvforum/topic4038151.html
    I'd start with:
    
    
    // Start TuyaMCu driver
    startDriver TuyaMCU
    // set TuyaMCU baud rate
    //tuyaMcu_setBaudRate 115200
    // set TuyaMCU default wifi state 0x04, which means "paired",
    // because some TuyaMCU MCUs will not report all data
    // unless they think they are connected to cloud
    tuyaMcu_defWiFiState 4
    

    Then I would run the tuyaMcu_sendQueryState command and capture the LOG.

    Can you provide more information on your device, is it single-color only, or RGB, or RGB + CW?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • TuyaMCU state map for SL-02 dimmer

    #3 20978103
    babaganesh
    Level 3  
    Posts: 10
    Help: 1
    Rate: 2
    lamp is RGB + contrast and brightness.
    With
    
    startDriver TuyaMCU
    tuyaMcu_setBaudRate 115200
    tuyaMcu_defWiFiState 4
    

    in autoexec.bat, here is result of tuyaMcu_sendQueryState

    
    Info:CMD:[WebApp Cmd 'tuyaMcu_sendQueryState' Result] OK
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 14 01 00 01 00 24 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 20 type 1-bool len 1
    Info:TuyaMCU:ParseState: byte 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 1A 02 00 04 00 00 00 00 31 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 26 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 0
    Info:TuyaMCU:Received: 55 AA 03 07 00 05 15 04 00 01 01 29 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 12
    Info:TuyaMCU:ParseState: id 21 type 4-enum len 1
    Info:TuyaMCU:ParseState: byte 1
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 16 02 00 04 00 00 02 58 87 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 22 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 600
    Info:TuyaMCU:Received: 55 AA 03 07 00 08 17 02 00 04 00 00 03 E8 19 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 15
    Info:TuyaMCU:ParseState: id 23 type 2-val len 4
    Info:TuyaMCU:ParseState: int32 1000
    Info:TuyaMCU:Received: 55 AA 03 07 00 10 18 03 00 0C 30 30 31 65 30 33 65 38 30 33 65 38 36 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 23
    Info:TuyaMCU:ParseState: id 24 type 3-str len 12
    Info:TuyaMCU:Received: 55 AA 03 07 00 A2 19 03 00 9E 30 35 34 36 34 36 30 31 30 30 30 30 30 33 65 38 30 33 65 38 30 30 30 30 30 30 30 30 34 36 34 36 30 31 30 30 37 38 30 33 65 38 30 33 65 38 30 30 30 30 30 30 30 30 34 36 34 36 30 31 30 30 66 30 30 33 65 38 30 33 65 38 30 30 30
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 169
    Info:TuyaMCU:ParseState: id 25 type 3-str len 158
    Info:TuyaMCU:Received: 55 AA 03 07 00 06 20 00 00 02 00 00 31 
    Info:TuyaMCU:ProcessIncoming[v=3]: cmd 7 (State) len 13
    Info:TuyaMCU:ParseState: id 32 type 0-raw len 2
    


    some app screens:
    App interface for controlling RGB lamp with color, brightness, and contrast settings. Tuya app with Scene tab open, showing colorful patterns and lighting modes. App screen with scene settings named Colorful featuring color selection and flash modes. LED lighting control app screen with color options and modes. TuyaMCU mobile app with a color wheel for adjusting light hue. App interface for controlling EVOLUTION SL-02 lamp with color and brightness options. App screen for light control showing Soft mode with color options. Smartphone app screen with color and brightness settings for the Gorgeous scene mode. App screen with lighting settings

    with TuyaMCUAnalyzer I've found out:

    ## white tab
    
    dpId=21 Enum V=0
    


    color temp
    
    min dpId=23 Val V=0
    max dpId=23 Val V=1000
    


    brightness
    
    1%     dpId=22 Val V=10
    30%   dpId=22 Val V=299
    80%   dpId=22 Val V=797
    100% dpId=22 Val V=1000
    


    ## color tab
    
    dpId=21 Enum V=1
    


    same purple color and contrast 100
    
    brightness 1   dpId=24 Str V=012303e8000a
    brightness 4   dpId=24 Str V=012303e80026
    brightness 30  dpId=24 Str V=012303e8012c
    brightness 100 dpId=24 Str V=012303e803e8
    


    same purple color and brightness 1
    
    contrast 1   dpId=24 Str V=01230000000a
    contrast 4   dpId=24 Str V=01230025000a
    contrast 30  dpId=24 Str V=01230130000a
    contrast 100 dpId=24 Str V=012303e8000a 
    


    changing color, brightness and contrast 1
    
    red        dpId=24 Str V=015d0000000a
    yellow   dpId=24 Str V=00320000000a
    green    dpId=24 Str V=00650000000a 
    blue      dpId=24 Str V=00e10000000a
    purple   dpId=24 Str V=01230000000a
    


    ## scene tab
    
    dpId=21 Enum V=2
    


    modes
    
    night   dpId=25 Str V=000e0d0000000000000000c80000
    read    dpId=25 Str V=010e0d0000000000000003e801f4
    working dpId=25 Str V=020e0d0000000000000003e803e8
    leisure dpId=25 Str V=030e0d0000000000000001f401f4
    soft    dpId=25 Str V=04464602007803e803e800000000464602007803e8000a00000000
    breath soft    dpId=25 Str V=04646402007803e803e800000000646402007803e8000a0000000064640200e603e803e800000000646402016803e803e800000000
    colorful dpId=25 Str V=05464601000003e803e800000000464601007803e803e80000000046460100f003e803e800000000464601003d03e803e80000000046460100ae03e803e800000000464601011303e803e800000000
    dazzling dpId=25 Str V=06464601000003e803e800000000464601007803e803e80000000046460100f003e803e800000000
    gorgeous dpId=25 Str V=07464602000003e803e800000000464602007803e803e80000000046460200f003e803e800000000464602003d03e803e80000000046460200ae03e803e800000000464602011303e803e800000000
    
  • ADVERTISEMENT
  • #5 21014574
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14724
    Help: 659
    Rate: 12807
    @babaganesh thank you for providing TuyaMCU captures. However, it is not clear from your post, is the device working now with the OBK config I suggested, or is something still missing? The LED devices in OBK should be covered by tuyaMCU_setupLED command, as we discussed in this topic:
    BK7231N, TuyaMCU and individually addressable LEDs - effects control, adding buttons, thermometer
    Helpful post? Buy me a coffee.
📢 Listen (AI voice):

FAQ

TL;DR: For OpenBeken users flashing a BK7231T/WB3S SL-02 lamp, the key finding is that 6 datapoints matter and "I’d start with" startDriver TuyaMCU, tuyaMcu_setBaudRate 115200, tuyaMcu_defWiFiState 4, then tuyaMcu_sendQueryState to map white, color, and scene modes before expecting working dimmer controls. [#20977514]

Why it matters: This FAQ helps OpenBeken and TuyaMCU users turn UART captures into a working RGB+CCT lamp configuration instead of a web UI that shows controls but does nothing.

Feature RGB-only lamp RGB + color temperature lamp in this thread
Main mode selector Color mode only or simpler mapping dpId 21 enum: 0 white, 1 color, 2 scene
White brightness Often one brightness datapoint dpId 22 value, range observed 10–1000
Color temperature Usually absent dpId 23 value, observed 0–1000
Color control Color string datapoint dpId 24 string, 12 hex chars observed
Scenes Optional dpId 25 string, presets plus long scene payloads

Key insight: tuyaMcu_setupLED 24 0 can expose dimmer widgets, but this SL-02 lamp still needs correct mode and datapoint handling for dpId 21, 22, 23, 24, and 25 before brightness and color commands will work reliably.

Quick Facts

  • The lamp reports RGB + color temperature + scenes through TuyaMCU, not as simple GPIO PWM channels, so OpenBeken must map UART datapoints instead of only exposing generic LED sliders. [#20978103]
  • The working base UART setup shown in the thread uses 115200 baud and Wi-Fi state 4, then queries the MCU for its full state. [#20978103]
  • In white mode, observed ranges were brightness 10–1000 on dpId 22 and color temperature 0–1000 on dpId 23; examples included 299 at 30% and 797 at 80% brightness. [#20978103]
  • In color mode, dpId 24 carries a 12-character string such as 012303e803e8; changing only brightness altered the last 4 hex digits from 000a to 03e8. [#20978103]
  • Scene mode uses dpId 25 and can send very long payloads; one captured state had length 158 for presets like soft, colorful, dazzling, and gorgeous. [#20978103]

How do I flash OpenBeken on a BK7231T device with a WB3S module without damaging the thin copper pads during desoldering?

Flash it carefully and minimize mechanical force during WB3S removal. The thread confirms desoldering with a soldering iron was difficult because the copper was "very thin" and easy to tear, while the actual flashing process was otherwise routine. If the pads look fragile, avoid repeated lifting attempts and stop as soon as the module is free enough to work on. That reduces the main failure risk reported in this case: pad damage during removal, not flashing failure after removal. [#20974888]

What is TuyaMCU, and how does it work with OpenBeken on WB3S/BK7231T light devices?

"TuyaMCU" is a serial control protocol that links the Wi-Fi module to a separate lamp controller, exchanging typed datapoints such as bool, value, enum, string, and raw states. In this thread, OpenBeken starts the TuyaMCU driver, sets 115200 baud, marks Wi-Fi as paired, and then queries state so the BK7231T/WB3S module can mirror and control lamp functions over UART instead of driving LEDs directly. [#20977514]

What is a dpId in the TuyaMCU protocol, and how do I map dpId 21, 22, 23, 24, 25, and 32 for an RGB plus color temperature lamp?

"dpId" is a Tuya datapoint identifier that labels one device function, with a fixed data type and payload format, so OpenBeken can map each lamp feature to the correct UART command. For this RGB+CCT lamp, the thread captured dpId 21 as mode enum, 22 as brightness value, 23 as color-temperature value, 24 as color string, 25 as scene string, and 32 as a raw payload of length 2 bytes. [#20978103]

Why do the dimmer controls appear in the OpenBeken web interface after running "startDriver TuyaMCU" and "tuyaMcu_setupLED 24 0" but still not control the lamp?

They appear because OpenBeken enables generic LED controls, but the lamp still needs the right TuyaMCU datapoint mapping. This thread shows the device uses at least five functional datapoints: mode on 21, white brightness on 22, color temperature on 23, color string on 24, and scenes on 25. If OpenBeken only knows 24 0, the UI can render sliders while the MCU ignores commands that lack the correct mode switch or companion datapoints. [#20978103]

How should I configure autoexec.bat for a TuyaMCU RGB+CCT lamp using "startDriver TuyaMCU", "tuyaMcu_setBaudRate 115200", and "tuyaMcu_defWiFiState 4"?

Use those three commands as the base autoexec.bat for this lamp. The thread shows this exact startup sequence:
  1. startDriver TuyaMCU
  2. tuyaMcu_setBaudRate 115200
  3. tuyaMcu_defWiFiState 4
After boot, run tuyaMcu_sendQueryState and inspect the log before adding LED mappings. An OpenBeken maintainer’s advice was, "I’d start with" that configuration, because some MCUs hide datapoints until they think cloud pairing is complete. [#20977514]

What does "tuyaMcu_defWiFiState 4" do, and why can it make some TuyaMCU devices report more complete state data?

It sets the default TuyaMCU Wi-Fi status to value 0x04, meaning the device believes it is paired. The thread explains that some TuyaMCU controllers do not report all datapoints unless they think they are connected to the cloud, so forcing state 4 can unlock a fuller response to tuyaMcu_sendQueryState. In this case, once that setup was used, the lamp returned state entries for dpId 20, 21, 22, 23, 24, 25, and 32. [#20977514]

How can I use "tuyaMcu_sendQueryState" to capture a full TuyaMCU state log and identify the correct datapoints for a smart lamp?

Run it after the TuyaMCU driver is initialized and the baud rate is correct. Use this sequence:
  1. Boot with startDriver TuyaMCU, tuyaMcu_setBaudRate 115200, and tuyaMcu_defWiFiState 4.
  2. Execute tuyaMcu_sendQueryState from the web app.
  3. Read each ParseState line to list datapoint IDs, data types, and values.
In this lamp, that query exposed bool 20, enum 21, value 22 and 23, string 24 and 25, and raw 32. That gives you the real control map before testing UI commands. [#20978103]

Which TuyaMCU datapoints control white mode, color mode, brightness, color temperature, and scenes on the SL-02 RGB lamp discussed in the thread?

dpId 21 selects the operating mode, dpId 22 controls white-mode brightness, dpId 23 controls color temperature, dpId 24 carries color-mode hue/saturation/brightness data, and dpId 25 carries scene presets and scene programs. The thread also shows dpId 21 = 0 for white, 1 for color, and 2 for scene. That split matters because white brightness and color brightness do not use the same datapoint on this lamp. [#20978103]

How do I decode TuyaMCU color strings like "012303e803e8" or "00650000000a" from dpId 24 into hue, saturation, and brightness values?

Read them as three 4-hex-digit fields: hue, saturation, and brightness. The thread’s captures show 0123 03e8 03e8 for purple at full contrast and full brightness, and 0065 0000 000a for green with minimum contrast and brightness 1. Here, 0123 hex equals 291 and matches purple hue, 03e8 equals 1000 for full-scale saturation or brightness, and 000a equals 10 for the minimum observed brightness step. [#20978103]

Why does dpId 21 switch between enum values 0, 1, and 2, and how should those modes be handled in OpenBeken for white, color, and scene tabs?

It switches because dpId 21 is the lamp’s master mode selector. The thread maps 0 to the white tab, 1 to the color tab, and 2 to the scene tab. OpenBeken should therefore change dpId 21 first, then send the matching control payload: dpId 22 and 23 in white mode, dpId 24 in color mode, and dpId 25 in scene mode. If you skip the mode switch, the lamp can ignore otherwise valid brightness or color data. [#20978103]

What can dpId 25 scene strings tell me about preset modes like night, read, working, leisure, soft, breath soft, colorful, dazzling, and gorgeous?

They show that scenes are encoded as structured strings, not simple enum values. The thread captured short scene payloads for night, read, working, and leisure, plus much longer multi-segment strings for soft, breath soft, colorful, dazzling, and gorgeous. That means this lamp stores both fixed presets and animated color sequences inside dpId 25, and some scenes can require far longer payloads than the 12-character color string used by dpId 24. [#20978103]

When setting up OpenBeken LEDs, how does an RGB-only TuyaMCU lamp compare with an RGB plus color temperature lamp in terms of required datapoints and configuration?

An RGB-only lamp is simpler because one color datapoint can cover most user actions, while an RGB+CCT lamp splits functions across more datapoints. This SL-02 device needs separate handling for white mode, color mode, scene mode, white brightness, color temperature, and color strings. In practice, that means tuyaMcu_setupLED may be enough for a basic RGB lamp, but this lamp still needs dpId 21, 22, 23, 24, and 25 mapped correctly. [#21014574]

What troubleshooting steps should I follow if a WB3S/BK7231T lamp responds to TuyaMCU state queries but ignores brightness or color commands from OpenBeken?

First, verify the UART base setup, then verify the mode datapoint, then verify the control datapoint. A practical sequence is: confirm 115200 baud, force Wi-Fi state 4, run tuyaMcu_sendQueryState, and check that dpId 21 changes between 0, 1, and 2 when you switch tabs. If the lamp still ignores commands, the likely fault is incomplete mapping, because this device separates white brightness 22, color temperature 23, color string 24, and scenes 25 instead of accepting one universal dimmer command. [#20978103]

How can TuyaMCUAnalyzer help reverse-engineer an unknown Tuya light by monitoring UART traffic while changing colors, brightness, contrast, and scene modes?

It helps by turning UI actions into observable datapoint changes on UART. In this thread, the analyzer showed white-mode brightness on dpId 22, white temperature on dpId 23, mode changes on dpId 21, color strings on dpId 24, and scene strings on dpId 25. It also exposed scaling, such as brightness values of 10, 299, 797, and 1000 for roughly 1%, 30%, 80%, and 100%. That gives you a repeatable way to map an unknown lamp without guessing. [#20978103]

Where does "tuyaMcu_setupLED" fit into OpenBeken LED support, and what other parameters or mappings might still be missing for this SL-02 firmware configuration?

It fits as OpenBeken’s built-in helper for TuyaMCU LED devices, but it is not always the complete configuration. The maintainer states that LED devices should be covered by tuyaMcu_setupLED, yet this thread still points to missing handling for the SL-02’s specific datapoints and mode logic. A linked webapp pull request also suggests active work around this area, so the remaining gap is not basic TuyaMCU communication but lamp-specific mapping for white, color, and scene behaviors. [#21014574]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT