logo elektroda
logo elektroda
X
logo elektroda

[Solved] Configuring OBK-Flashed RGB LED Corner Lamp KB-1500B with BK7231N CBU from Aliexpress

bruceda 6351 23
Best answers LABEL_AI_GENERATED

How can I find the missing OpenBeken configuration for an OBK-flashed BK7231N CBU RGB corner lamp with an unknown LED controller?

Your lamp is not a PWM device; the strip marking `SM16703P` means you should use the SM16703P serial LED driver and address it as grouped LED segments instead of searching for RGB PWM pins [#20520009][#20709852] Start it with `startDriver SM16703P`, initialize the strip with `SM16703P_Init `, set colors with `SM16703P_SetPixel R G B`, and send the frame with `SM16703P_Start` [#20709852] The thread determined that one `SetPixel` affects one 3-LED segment, so you may need to map the segment order and swap color channels if the order is not RGB; the observed behavior suggested a nonstandard order such as BRG [#20733941] The driver uses hardware SPI, and on Beken the data output is only available on P16, so the LED data line needs to be on P16 [#20734037] OpenBeken later gained a functional WS2812B driver that is also compatible with SM16703P-like strips, so that is another path if you revisit the device [#21042428]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT
  • Requesting help to identify remaining OBK configuration

    #1 20515385
    bruceda
    Level 3  
    Posts: 7
    Hi everyone

    I have an RGB LED corner lamp that I have flashed with OBK, using Tuya CloudCutter. The lamp is from AliExpress, model KB-1500B. The module is a BK7231N CBU. It includes WiFi, Bluetooth, IR remote and a microphone to sync lights to music. I have traced the buttons and can see the button presses in the web app logs.

    Any tips to find the rest of the config I need?

    Configuring OBK-Flashed RGB LED Corner Lamp KB-1500B with BK7231N CBU from Aliexpress Configuring OBK-Flashed RGB LED Corner Lamp KB-1500B with BK7231N CBU from Aliexpress Configuring OBK-Flashed RGB LED Corner Lamp KB-1500B with BK7231N CBU from Aliexpress Configuring OBK-Flashed RGB LED Corner Lamp KB-1500B with BK7231N CBU from Aliexpress Configuring OBK-Flashed RGB LED Corner Lamp KB-1500B with BK7231N CBU from Aliexpress Configuring OBK-Flashed RGB LED Corner Lamp KB-1500B with BK7231N CBU from Aliexpress
  • ADVERTISEMENT
  • Helpful post

    Suggest testing all six BK7231N PWM pins with relay roles

    #2 20515416
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14755
    Help: 659
    Rate: 12880
    Hello @bruceda ,
    do you have original binary file? We could extract GPIO roles from there.

    If not, please note that BK7231N has six possible PWM pins. You can see that even in our configuration page:
    Configuring OBK-Flashed RGB LED Corner Lamp KB-1500B with BK7231N CBU from Aliexpress
    So, you are looking for 3 PWMs for RGBs and you have 6 possible PWM pins.
    There is not much to test.
    So I'd suggest it: For all 6 PWMs, set a Relay role, set channel 0 for PWM0, channel 1 for PWM 1, etc.
    Then try toggling each relay (while remembering on which PWM pin is it) and note which LED strip color changes.
    That way you can quickly narrow down to the 3 PWM pins you are looking for.

    Once you have already figured out correctly 3 PWM pins, then change their roles to PWM, as they should be, and then setup their channel order so Red is Red, Green is Green, etc... Remember, channel 0 is Red, 1 is green, 2 is blue. It will also work if you start numbering from 1.

    TLDR: guessing 3 PWMs from 6 possible PWMs is quick and easy to do.

    Alternate option would be to open CBU pinout on Tuya page, see which pins are PWMs are probe them with multimeter to see which PWMs are connected to MOSFETs


    EDIT:
    Sorry, I reviewed the images again, and it seems you don't have a PWM-based device. What is the marking on the chip on the LED strip?
    Helpful post? Buy me a coffee.
  • #3 20518768
    bruceda
    Level 3  
    Posts: 7
    Sorry, slow reply

    The chip on the LED strip says SM16703P and KZBSAFAC21

    I don't have the original binary from the device, I stupidly rushed into flashing it in my enthusiasm to try out your work.
  • SM16703P driver still unsupported, needs testing

    #4 20520009
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14755
    Help: 659
    Rate: 12880
    SM16703P has been reported so far on only one device from Action store and driver is WIP but we have a slight issue with flash caching. We can give it another try for you, but unfortunately right now this particular chip is not yet supported.

    Those chips are very, very rare. We usually have PWM-based devices or with "i2c-like" LED drivers. Tens of thems.

    Would you like to help us with testing the future driver? Or do you have some knowledge and can help with implementation?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20520070
    bruceda
    Level 3  
    Posts: 7
    Hi

    Happy to help with both the testing and driver development. I'm not experienced with this sort of thing but I have a background in technology, including development and electronics. Don't worry, I'm not someone's nanna asking for help with getting on the line to use the interwebs :-)
  • ADVERTISEMENT
  • #6 20709852
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14755
    Help: 659
    Rate: 12880
    @bruceda can you try?

    To test this you can follow these steps:

    1. Start driver
    startDriver SM16703P


    2. Init Driver
    SM16703P_Init [[pixelcount]]


    3. Set Pixel
    SM16703P_SetPixel 1 255 0 0
    SM16703P_SetPixel 2 0 255 0
    SM16703P_SetPixel 3 0 0 255


    4. Start Output (each call will trigger one
    SM16703P_Start
    Helpful post? Buy me a coffee.
  • SM16703P data only reaches first 12 LEDs

    #7 20725135
    bruceda
    Level 3  
    Posts: 7
    @p.kaczmarek2
    Apologies for the slow reply, I just saw your message now. Thank you for suggesting the above commands.

    I have tried applying them and I have included the logged output below. I enabled ExtraDebug to give as much detail as possible. I left MAIN and GEN disabled to cut down on logging noise.

    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [startDriver SM16703P]
    Debug:CMD:Adding command SM16703P_Init
    Debug:CMD:Adding command SM16703P_Start
    Debug:CMD:Adding command SM16703P_SetPixel
    Info:CMD:[WebApp Cmd 'startDriver SM16703P' Result] OK
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [SM16703P_Init 90]
    Info:CMD:Register driver with 90 LEDs
    Debug:CMD:spi master dma init: mode:0, rate:3000000
    Debug:CMD:max_hz = 3000000
    Debug:CMD:spi_master:[CTRL]:0x00c20400
    Debug:CMD:spi_master [CTRL]:0x00c20400
    Debug:CMD:spi_master [CONFIG]:0x0000000c
    Debug:CMD:spi dma tx init
    Debug:CMD:spi dma tx config: length:1082, first:0
    Info:CMD:[WebApp Cmd 'SM16703P_Init 90' Result] OK
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [SM16703P_SetPixel 1 255 0 0]
    Info:CMD:Set Pixel 1 to R 255 G 0 B 0
    Info:CMD:Raw Data 0xee 0xee 0xee 0xee - 0x88 0x88 0x88 0x88 - 0x88 0x88 0x88 0x88
    Info:CMD:[WebApp Cmd 'SM16703P_SetPixel 1 255 0 0' Result] OK
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [SM16703P_SetPixel 2 0 255 0]
    Info:CMD:Set Pixel 2 to R 0 G 255 B 0
    Info:CMD:Raw Data 0x88 0x88 0x88 0x88 - 0xee 0xee 0xee 0xee - 0x88 0x88 0x88 0x88
    Info:CMD:[WebApp Cmd 'SM16703P_SetPixel 2 0 255 0' Result] OK
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [SM16703P_SetPixel 3 0 0 255]
    Info:CMD:Set Pixel 3 to R 0 G 0 B 255
    Info:CMD:Raw Data 0x88 0x88 0x88 0x88 - 0x88 0x88 0x88 0x88 - 0xee 0xee 0xee 0xee
    Info:CMD:[WebApp Cmd 'SM16703P_SetPixel 3 0 0 255' Result] OK
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [SM16703P_Start]
    Error:CMD:before enable tx 0x00043a0c
    Error:CMD:enable tx 0x00043a0d
    Debug:CMD:spi dma tx finish callback
    Info:CMD:[WebApp Cmd 'SM16703P_Start' Result] OK

    When I power on the controller all LEDs go bright white. When I execute the SM16703P_Start command the bottom 3 LEDs stay white, the next 3 are blue, next 3 red and then 3 green. After that the remaining LEDs all stay bright white. I can't get a good photo of this, the camera won't pick up the colours.
  • #8 20725246
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14755
    Help: 659
    Rate: 12880
    What if you do:
    
    SM16703P_SetPixel 1 255 0 0
    SM16703P_SetPixel 2 0 255 0
    SM16703P_SetPixel 3 0 0 255
    SM16703P_SetPixel 4 255 0 0
    
    Helpful post? Buy me a coffee.
  • Extra blue LEDs indicate wrong pixel mapping

    #9 20726415
    bruceda
    Level 3  
    Posts: 7

    I get a similar result but now there are three extra blue LEDs at the top of the colored sequence with the rest still bright white.
    Here is the output:
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [startDriver SM16703P]
    Debug:CMD:Adding command SM16703P_Init
    Debug:CMD:Adding command SM16703P_Start
    Debug:CMD:Adding command SM16703P_SetPixel
    Info:CMD:[WebApp Cmd 'startDriver SM16703P' Result] OK
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [SM16703P_Init 90]
    Info:CMD:Register driver with 90 LEDs
    Debug:CMD:spi master dma init: mode:0, rate:3000000
    Debug:CMD:max_hz = 3000000 
    Debug:CMD:spi_master:[CTRL]:0x00c20400 
    Debug:CMD:spi_master [CTRL]:0x00c20400 
    Debug:CMD:spi_master [CONFIG]:0x0000000c 
    Debug:CMD:spi dma tx init
    Debug:CMD:spi dma tx config: length:1082, first:0
    Info:CMD:[WebApp Cmd 'SM16703P_Init 90' Result] OK
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [SM16703P_SetPixel 1 255 0 0]
    Info:CMD:Set Pixel 1 to R 255 G 0 B 0
    Info:CMD:Raw Data 0xee 0xee 0xee 0xee - 0x88 0x88 0x88 0x88 - 0x88 0x88 0x88 0x88
    Info:CMD:[WebApp Cmd 'SM16703P_SetPixel 1 255 0 0' Result] OK
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [SM16703P_SetPixel 2 0 255 0]
    Info:CMD:Set Pixel 2 to R 0 G 255 B 0
    Info:CMD:Raw Data 0x88 0x88 0x88 0x88 - 0xee 0xee 0xee 0xee - 0x88 0x88 0x88 0x88
    Info:CMD:[WebApp Cmd 'SM16703P_SetPixel 2 0 255 0' Result] OK
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [SM16703P_SetPixel 3 0 0 255]
    Info:CMD:Set Pixel 3 to R 0 G 0 B 255
    Info:CMD:Raw Data 0x88 0x88 0x88 0x88 - 0x88 0x88 0x88 0x88 - 0xee 0xee 0xee 0xee
    Info:CMD:[WebApp Cmd 'SM16703P_SetPixel 3 0 0 255' Result] OK
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [SM16703P_SetPixel 4 255 0 0]
    Info:CMD:Set Pixel 4 to R 255 G 0 B 0
    Info:CMD:Raw Data 0xee 0xee 0xee 0xee - 0x88 0x88 0x88 0x88 - 0x88 0x88 0x88 0x88
    Info:CMD:[WebApp Cmd 'SM16703P_SetPixel 4 255 0 0' Result] OK
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [SM16703P_Start]
    Error:CMD:before enable tx 0x00043a0c
    Error:CMD:enable tx 0x00043a0d
    Debug:CMD:spi dma tx finish callback
    Info:CMD:[WebApp Cmd 'SM16703P_Start' Result] OK


    I tried adding:
    SM16703P_SetPixel 5 0 255 0
    SM16703P_SetPixel 6 0 0 255

    Doing this, the pattern just continues, 3W, 3B, 3R, 3G, 3B, 3R, 3G then all the rest are white
  • SM16703 strip variants may control 3 or 6 LEDs

    #10 20732999
    jkwim
    Level 13  
    Posts: 186
    Help: 4
    Rate: 25
    Interesting discussion.

    SM16703P LED Strips work in a similar fashion to WS2811 LED Strips. That is, a data stream needs to be transmitted to the Din of the first LED and then transmitted out via the Dout connection in the LED. An arrow on the LED strip marks the direction of the data flow.

    Some LED strips are made with 3 LEDs being controlled by a single control chip. These work by changing color in 3 LEDs at once. From the description, the OP's device seems to have this kind of strip.

    I did not realize that OpenBK had a configuration option for SM16703 strips.

    In Tasmota, the command LEDx is used to set the colors of each LED in the strip. That is, if I need the first 3 LEDs to be Color1, Color2, and Color3, there are two ways to achieve it.

    1. Use Three commands:
    LED1 Color1
    LED2 Color2
    LED3 Color3

    2. A single command:
    LED Color1 Color2 Color3

    So can somebody explain what would be the corresponding commands on OpenBK to achieve a similar setup.

    Once that is known, each LED can be tested, and then a script can be formulated to light up the LEDs in any fashion.

    Also,

    Yes, Also (with a smile)

    using DDP, it should be possible to drive a LED animation by integrating with WLED. I have successfully integrated a couple of RGB Smart Bulbs with WLED to run an animation from WLED. So in the same manner, we should be able to integrate a Pixel LED strip using DDP protocol. Each LED can be addressed separately.

    I am trying to figure out which of my devices can be quickly hacked to add a LED strip.


    Added after 3 [hours] 41 [minutes]:

    Found these two images from the internet which suggest that there could be two variants of 16703 chips.

    One says that the chip controls 3 x LEDs the other one (which is SM16703P) controls 6 LEDs.

    If the OP can attach a photo with a longer part of the strip visible we could determine correctly which is what.


    1. MT16703
    Image of LED strips with visible MT16703IC and SM16703P chips, labeled Detail.

    2. SM16703P
    Close-up of an LED strip with SM16703P chip, capable of controlling six LEDs.
  • ADVERTISEMENT
  • Strip appears to use MT16703 with one chip per 3 LEDs

    #11 20733874
    bruceda
    Level 3  
    Posts: 7

    Welcome to the conversation @jkwim.

    Here are some additional images. My strip looks closer to the MT16703 image than the SM16703P image that you included. You can see in the second, closer image below that there is one chip per three LEDs. This also matches the behavior I observed when testing the commands noted above.

    Image of an LED strip with three LEDs per chip. Close-up of an LED strip with three LEDs per chip.
  • SM16703P segment mapping and BRG color order

    #12 20733941
    jkwim
    Level 13  
    Posts: 186
    Help: 4
    Rate: 25
    Ok! Now things make sense.

    SM16703P_SetPixel 1 255 0 0
    SM16703P_SetPixel 2 0 255 0
    SM16703P_SetPixel 3 0 0 255
    SM16703P_SetPixel 4 255 0 0
    SM16703P_SetPixel 5 0 255 0
    SM16703P_SetPixel 6 0 0 255

    
                 3W, 3B, 3R, 3G, 3B, 3R, 3G
    LED segments 0   1   2   3   4   5   6


    So you got 6 segments covered.

    Add a command for LED Segment 0
    
    SM16703P_SetPixel 0 255 0 0


    That should turn the first segment into Blue.

    So depending on the number of segments in the strip, add additional SetPixel command and you could have all of them change color.

    However, there is a catch. Generally, the LED strips have a different color order.

    From the look of things, your strip has BRG instead of RGB.
    SM16703P_SetPixel 1 255 0 0
                         B  R G


    So by adopting the correct notation, you could now make them into any color that you want.

    The driver for SM16703 appears to be working.

    Now you need to see how fast it can change colors. Perhaps a loop which changes the color in some pattern will show how fast the colors can be changed. Then you can add a delay between each iteration to slow down the change to suit the eye.

    Added after 15 [minutes]:

    I think it is time that I grab a device where I can solder a wire to an unused PWM pin and try this driver with a WS2812 strip that I have. If it works I will be dancing.

    Thank you all for this discussion.
  • WS2812B test script using hardware SPI on P16

    #13 20734037
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14755
    Help: 659
    Rate: 12880
    Ah, so there is one strip per 3 LEDs... and here I thought we have a bug!

    @jkwim , the following driver is using hardware SPI port, which Data Out pin is available only on P16. This is a limitation on Beken side.

    Added after 37 [minutes]:

    WS2812B test with OBK:



    Script:
    
    
    setChannel 10 1
    
    again:
    addChannel 10 1
    SM16703P_SetPixel $CH10-2 0 0 255
    SM16703P_SetPixel $CH10-1 0 255 0
    SM16703P_SetPixel $CH10 255 0 0
    SM16703P_Start
    delay_s 0.5
    goto again
    
    Helpful post? Buy me a coffee.
  • WS2812 strip on P16 with GRB order and 5V tap

    #14 20734889
    jkwim
    Level 13  
    Posts: 186
    Help: 4
    Rate: 25

    Great!
    We have smoke now!

    I soldered a JST connector to P16 of CBU module of my IR Remote Controller and connected a WS2812 LED strip. The strip color order is GRB.
    Tapped 5V and GND from AMS1117 regulator input. That is USB +5V and GND theoretically so as long as the USB port receives enough current from an external power supply, the number of LEDs can be increased without compromising the capacity of the AMS1117.

    Close-up of a blue PCB with connected wires, a microcontroller, and a USB port.

    Close-up of an electronic module with a WS2812 LED strip connected to a connector, with LEDs shining in different colors.

    startDriver SM16703P
    SM16703P_Init 16
    SM16703P_SetPixel 0 255 0 0
    SM16703P_SetPixel 1 0 255 0
    SM16703P_SetPixel 2 0 0 255
    SM16703P_Start



    However, I got different observations when I tried your looping script.

    After initial progression, the colors changed in a different manner. I have a feeling that the color gets mixed with previous colors instead of refreshing.

    BTW, I need to understand the "Channels" better as it is not very clear what a Channel is in this context.
  • #15 20735456
    jkwim
    Level 13  
    Posts: 186
    Help: 4
    Rate: 25

    Today I hit an issue.

    I changed the delay time to be 0.2 seconds.

    Now the device does not connect to WiFi anymore.

    I can get into AP Mode (by power on/off x5 times).

    How can I disable autoexec.bat using the command prompt in basic GUI? App launch is not possible in AP Mode.
  • #16 20736178
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14755
    Help: 659
    Rate: 12880
    I think you should be still able to use lfs_format, at least after you do unsafe start.
    Helpful post? Buy me a coffee.
  • Alias cannot be used as if target command

    #17 20736429
    jkwim
    Level 13  
    Posts: 186
    Help: 4
    Rate: 25
    p.kaczmarek2 wrote:
    I think you should still be able to use lfs_format, at least after you do an unsafe start.

    lfs-format
    worked!
    Screenshot of the Command Tool showing messages about formatting and mounting.
    Thank you


    Added after 5 [hours] 59 [minutes]:

    I am trying to build a script based on your example above for a simple animation.

    Your script did not have a over flow detection in the loop so I am trying the following:

    startDriver SM16703P
    SM16703P_Init 16
    //SM16703P_SetPixel 0 255 0 0
    //SM16703P_SetPixel 1 0 255 0
    //SM16703P_SetPixel 2 0 0 255
    //SM16703P_Start
    
    alias InitChannel10 setChannel 10 1
    //setChannel 10 1
    InitChannel10
    
    again:
    addChannel 10 1
    echo "1: $CH10"
    if $CH10>16 then InitChannel10
    echo "2: $CH10"
    //SM16703P_SetPixel $CH10-2 0 0 255
    //SM16703P_SetPixel $CH10-1 0 255 0
    //SM16703P_SetPixel $CH10 255 0 0
    //SM16703P_Start
    delay_s 0.5
    goto again


    Response:
    Info:GEN:CHANNEL_Add channel 10 has changed to 12507
    
    Info:GEN:CHANNEL_Set channel 10 has changed to 12507 (flags 0)
    
    Info:CMD:"1: 12507"
    Error:CMD:cmd InitChannel10 NOT found (args )
    Info:CMD:"2: 12507"


    I am having trouble getting the following working

    if $CH10>16 then InitChannel10


    if I use following syntax it complains that for if command the 4th argument should be 'else'

    if $CH10>16 then setChannel 10 1

    Info:EVENT:CMD_If: fourth argument always must be 'else', but it's '10'
    

    So I decided to use the definition
    alias InitChannel10 setChannel 10 1


    Now it complains that it cannot find the command

    Error:CMD:cmd InitChannel10 NOT found (args )
    


    How to I reset the value of Channel back to 1 if it is greater than 16?
  • #18 20736924
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14755
    Help: 659
    Rate: 12880
    Hint: read documentation.
    Better hint: as far as I remember, the addChannel command has an optional clamp or wrap ability. So you can basically just modify addChannel line to wrap from, let's say, 50, back to 0, etc...

    See docs here: https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md
    Helpful post? Buy me a coffee.
  • AddChannel increments PWM brightness with clamping

    #19 20736951
    jkwim
    Level 13  
    Posts: 186
    Help: 4
    Rate: 25
    Thanks!

    AddChannel [ChannelIndex][ValueToAdd][ClampMin][ClampMax][bWrapInsteadOfClamp] Adds a given value to the channel. Can be used to change PWM brightness. Clamp min and max arguments are optional.


    Tried

    echo "1: $CH10"
    addChannel 10 1 0 16 1
    echo "2: $CH10"


    Info:CMD:"2: 16"
    Info:CMD:"1: 16"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 0
    Info:GEN:CHANNEL_Set channel 10 has changed to 0 (flags 0)
    Info:CMD:"2: 0"
    Info:CMD:"1: 0"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 1
    Info:GEN:CHANNEL_Set channel 10 has changed to 1 (flags 0)
    Info:CMD:"2: 1"
    Info:CMD:"1: 3"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 4
    Info:GEN:CHANNEL_Set channel 10 has changed to 4 (flags 0)
    Info:CMD:"2: 4"
    Info:CMD:"1: 4"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 5
    Info:GEN:CHANNEL_Set channel 10 has changed to 5 (flags 0)
    Info:CMD:"2: 5"
    Info:CMD:"1: 6"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 7
    Info:GEN:CHANNEL_Set channel 10 has changed to 7 (flags 0)
    Info:CMD:"2: 7"
    Info:CMD:"1: 8"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 9
    Info:GEN:CHANNEL_Set channel 10 has changed to 9 (flags 0)
    Info:CMD:"2: 9"
    Info:CMD:"1: 10"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 11
    Info:GEN:CHANNEL_Set channel 10 has changed to 11 (flags 0)
    Info:CMD:"2: 11"
    Info:CMD:"1: 11"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 12
    Info:GEN:CHANNEL_Set channel 10 has changed to 12 (flags 0)
    Info:CMD:"2: 12"
    Info:CMD:"1: 16"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 0
    Info:GEN:CHANNEL_Set channel 10 has changed to 0 (flags 0)
    Info:CMD:"2: 0"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 1
    Info:GEN:CHANNEL_Set channel 10 has changed to 1 (flags 0)
    Info:CMD:"2: 1"
    Info:CMD:"1: 6"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 7
    Info:GEN:CHANNEL_Set channel 10 has changed to 7 (flags 0)
    Info:CMD:"2: 7"
    Info:CMD:"1: 7"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 8
    Info:GEN:CHANNEL_Set channel 10 has changed to 8 (flags 0)
    Info:CMD:"2: 8"
    Info:CMD:"1: 12"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 13
    Info:GEN:CHANNEL_Set channel 10 has changed to 13 (flags 0)
    Info:CMD:"2: 13"
    Info:CMD:"1: 13"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 14
    Info:GEN:CHANNEL_Set channel 10 has changed to 14 (flags 0)
    Info:CMD:"2: 14"
    Info:CMD:"1: 2"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 3
    Info:GEN:CHANNEL_Set channel 10 has changed to 3 (flags 0)
    Info:CMD:"2: 3"
    Info:CMD:"1: 3"
    Info:GEN:CHANNEL_AddClamped channel 10 has changed to 4
    Info:GEN:CHANNEL_Set channel 10 has changed to 4 (flags 0)
    Info:CMD:"2: 4"


    It appears to get wrapped. However I notice jumps. Wonder those are only for the skips in echo command output.

    Added after 57 [minutes]:

    Managed to get a basic loop going:
    
    startDriver SM16703P
    SM16703P_Init 16
    
    alias InitChannel10 setChannel 10 1
    //setChannel 10 1
    InitChannel10
    
    again:
    
    echo "1: $CH10"
    addChannel 10 1 0 15 1
    SM16703P_SetPixel $CH10 255 0 0
    SM16703P_Start
    delay_s 1
    SM16703P_SetPixel $CH10 0 0 0
    
    goto again



    However I have a feeling that the driver may be having timing issues.

    There are spurious led lit ups here and there. I may have a my setup issues as well which contributes to this behaviors.
    1. The fact that I am using 5V to power the LEDs and taps the 3.3V for signal pin from Beken.
    2. The 5V that I use may not be stable

    I will next try connecting the LEDs to 3.3V output of the LDO so that power and data both are at 3.3V

    At the moment if I change the delay to anything other than 1s the strip goes nuts. Spurious lit ups and skips become more.
  • #20 20737024
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14755
    Help: 659
    Rate: 12880
    Wait, are you testing it with WS2812B?

    I didn't mention it earlier but the driver is for SM16703. It works on WS2812B by a pure coincidence, timings are slightly different. On my WS2812B strip, for example, it starts addressing somehow at fifth or so LED and then wraps around.

    I will have to try to adjust it to work correctly with classic WS's
    Helpful post? Buy me a coffee.
  • #21 20737320
    jkwim
    Level 13  
    Posts: 186
    Help: 4
    Rate: 25
    p.kaczmarek2 wrote:
    Wait, are you testing it with WS2812B?


    Yes.

    Perhaps you could add a flag to switch between WS2812B and SM16703.
  • #22 20748295
    jkwim
    Level 13  
    Posts: 186
    Help: 4
    Rate: 25
    Any update on WS2812 capability?
  • #23 21042162
    bruceda
    Level 3  
    Posts: 7

    TBH, I have given up on getting the lamp working with the original controller and LED strip. I purchased a new controller and installed WLED and a WS2812 strip and I am using this now with great success.
  • #24 21042428
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14755
    Help: 659
    Rate: 12880
    Actually OpenBeken has now a functional WS2812B driver.
    See related topic and let me know if any assitance is needed, I can help with device setup:
    OpenBeken WS2812B driver (compatible with SM16703P, etc) - short scripting presentation
    Helpful post? Buy me a coffee.

Topic summary

LABEL_AI_GENERATED
The discussion revolves around configuring an RGB LED corner lamp (model KB-1500B) that has been flashed with OBK firmware using a BK7231N CBU module. Users share insights on identifying PWM pins for RGB control, troubleshooting issues with the SM16703P LED driver, and testing commands to manipulate LED colors. The conversation highlights the challenges faced due to the rarity of the SM16703P chip and the need for a compatible driver. Participants also explore the possibility of using WS2812B strips as an alternative, with successful implementations reported after switching controllers and using WLED firmware. The community offers support for testing and developing drivers for these LED configurations.
AI summary based on the discussion. May contain errors.

FAQ LABEL_AI_GENERATED

TL;DR: 90 LEDs and “P16 only” define this OBK KB-1500B fix: use OpenBeken’s SM16703P/WS2812 driver, not PWM guessing, because the AliExpress BK7231N CBU lamp uses a serial pixel strip with one chip per 3 LEDs. [#20725135]

Why it matters: This prevents wasting time on six BK7231N PWM candidates when the lamp actually needs a data-stream LED driver.

Setup LED control Data pin or method Thread result
Original KB-1500B strip SM16703P-style serial pixels Hardware SPI on P16 Worked partially in tests
PWM RGB assumption 3 PWM channels from 6 candidates BK7231N PWM pins Rejected after chip marking check
Replacement setup WS2812 strip with WLED New controller User reported “great success”
Later OpenBeken option WS2812B driver compatible with SM16703P OpenBeken scripting Functional by April 2024

Key insight: The lamp is not a normal RGB PWM device. Treat each 3-LED block as one addressable segment and verify color order before scripting effects.

Quick Facts

  • The tested KB-1500B lamp used a BK7231N CBU module with WiFi, Bluetooth, IR remote, microphone, and Tuya CloudCutter-flashed OpenBeken. [#20515385]
  • BK7231N exposes 6 possible PWM pins, but this lamp needed a serial SM16703P-style LED driver instead of 3 RGB PWM outputs. [#20515416]
  • Test initialization used SM16703P_Init 90, SPI DMA at 3000000 Hz, and a DMA transmit length of 1082. [#20725135]
  • The observed strip behavior was grouped: 3W, 3B, 3R, 3G, 3B, 3R, 3G, showing one control chip per 3 LEDs. [#20726415]
  • OpenBeken’s hardware SPI driver for this class of strip uses the Beken data-out pin available only on P16. [#20734037]

How do I configure an OBK-flashed AliExpress KB-1500B RGB LED corner lamp with a BK7231N CBU module?

Configure it as a serial SM16703P-style LED strip, not a 3-channel PWM lamp. The KB-1500B thread device used BK7231N CBU and a strip chip marked SM16703P. Start with startDriver SM16703P, then initialize the LED count. Test segments with SM16703P_SetPixel and send output with SM16703P_Start. If colors map incorrectly, adjust your RGB order in commands. Later, OpenBeken also gained a functional WS2812B driver compatible with SM16703P-style scripting. [#21042428]

How can I identify the GPIO roles for a BK7231N CBU device after flashing OpenBeken without saving the original Tuya firmware binary?

Identify GPIO roles by testing pins or reading the LED driver hardware. For PWM devices, assign Relay roles to all 6 possible BK7231N PWM pins. Use channel 0 for PWM0, channel 1 for PWM1, and continue. Toggle each relay and record the changed color. For this lamp, that method became secondary because the strip chip marking showed SM16703P, not a PWM MOSFET setup. A multimeter can also trace PWM pins to MOSFETs when the board uses PWM. [#20515416]

What is the SM16703P LED driver chip, and how is it different from a normal PWM-controlled RGB LED strip?

"SM16703P is a serial RGB LED driver chip that receives a data stream and forwards it through the strip, controlling addressable LED groups instead of using separate red, green, and blue PWM pins." A normal PWM RGB strip needs 3 PWM outputs. The thread’s SM16703P-style strip accepted pixel data through a single data path. That changed the OpenBeken setup from GPIO PWM mapping to driver commands such as SM16703P_SetPixel. [#20732999]

How do I test an SM16703P LED strip in OpenBeken using startDriver, SM16703P_Init, SM16703P_SetPixel, and SM16703P_Start commands?

Test the strip by starting the driver, initializing pixel count, setting pixels, then sending output. 1. Run startDriver SM16703P and SM16703P_Init 90. 2. Run SM16703P_SetPixel 1 255 0 0, SM16703P_SetPixel 2 0 255 0, and SM16703P_SetPixel 3 0 0 255. 3. Run SM16703P_Start to transmit one frame. In the thread, this produced white LEDs plus blue, red, and green groups. [#20725135]

Why does my SM16703P strip change colors in groups of three LEDs instead of controlling each LED individually?

It changes in groups of 3 because one controller chip drives three physical LEDs. The close-up strip photo showed one chip per 3 LEDs. The test pattern confirmed it: segment commands produced 3W, 3B, 3R, 3G style groups. That means OpenBeken’s pixel index addresses a segment, not every individual LED package. Use segment-based effects unless you replace the strip with per-pixel hardware. [#20733874]

What pixel count should I use with SM16703P_Init when one controller chip drives three LEDs on an RGB strip?

Use the number of addressable controller segments, not the physical LED count, when one chip drives 3 LEDs. If a strip has 90 physical LEDs and each chip controls 3 LEDs, use about 30 addressable segments. The thread initially tested SM16703P_Init 90, but observations showed grouped control. Count chips or divide physical LEDs by 3 for this strip type. [#20733941]

Why does an OpenBeken SM16703P strip show colors in the wrong order, such as BRG or GRB instead of RGB?

It shows wrong colors because the strip’s internal color order differs from OpenBeken’s RGB command order. In the thread, SM16703P_SetPixel 1 255 0 0 appeared as blue, suggesting BRG mapping. A WS2812 test strip later used GRB order. Keep the same command syntax, but remap values mentally or in scripts. For example, send values in the strip’s actual BRG or GRB order. [#20733941]

How can I create a simple OpenBeken script to animate SM16703P or WS2812 LEDs using channels, addChannel, delay_s, and goto?

Create a loop that increments a channel, writes one pixel, starts output, delays, clears it, and repeats. The working example initialized 16 LEDs, used channel 10 as the moving index, and delayed 1 second. Core lines were addChannel 10 1 0 15 1, SM16703P_SetPixel $CH10 255 0 0, SM16703P_Start, delay_s 1, and goto again. This creates a simple moving red segment. [#20736951]

How do I use addChannel with clamp or wrap parameters in OpenBeken to loop an LED animation counter?

Use addChannel [ChannelIndex] [ValueToAdd] [ClampMin] [ClampMax] [bWrapInsteadOfClamp]. For a 16-step loop, use addChannel 10 1 0 15 1. Channel 10 increments by 1, stays within 0–15, and wraps to 0 after 15. This avoids a broken if expression and removes the need for an alias reset command. [#20736951]

What should I do if an OpenBeken autoexec.bat script causes my BK7231N device to stop connecting to WiFi?

Enter AP mode, perform an unsafe start if needed, then format the local file system. In the thread, a script with delay_s 0.2 made the device stop connecting to WiFi. The device still entered AP mode after 5 power cycles. The recovery advice was to use lfs_format, then retry startup without the bad script. This clears scripts stored in the OpenBeken file system. [#20736178]

How can I clear or disable OpenBeken scripts from AP mode using lfs_format or lfs-format?

Run lfs-format from the basic GUI command prompt after entering AP mode. The thread user confirmed lfs-format worked after the device failed to connect to WiFi. Another post referred to lfs_format; the successful command shown was lfs-format. This formats the LittleFS storage and removes scripts such as autoexec.bat, so the device can boot cleanly. [#20736429]

What is Tuya CloudCutter, and how is it used to flash OpenBeken onto BK7231N smart devices?

"Tuya CloudCutter is a flashing method used to replace Tuya firmware with OpenBeken on supported smart devices, avoiding the original cloud firmware path after the device is prepared." In this thread, it flashed an AliExpress KB-1500B corner lamp using a BK7231N CBU module. The user did not save the original binary before flashing, so later GPIO recovery relied on testing and chip identification. [#20515385]

What is the P16 pin limitation when using OpenBeken hardware SPI to drive SM16703P or WS2812B LED strips on Beken chips?

OpenBeken’s hardware SPI LED driver can output data only on P16 for this Beken setup. The driver uses the hardware SPI port, and its Data Out pin is available only on P16. This matters when wiring a CBU module to SM16703P or WS2812B strips. If your data wire connects elsewhere, the driver will not output correctly without changing hardware or driver strategy. [#20734037]

OpenBeken SM16703P driver vs WLED with WS2812B strips — which setup is better for an RGB corner lamp?

Use WLED with WS2812B for easiest polished effects, but use OpenBeken when you want BK7231N integration. The thread owner eventually replaced the original controller and strip with a new controller, WLED, and WS2812 strip, reporting great success. However, OpenBeken later had a functional WS2812B driver compatible with SM16703P-style strips. Choose OpenBeken for OBK scripting; choose WLED for mature LED animations. [#21042162]

What power and signal-level issues should I check when connecting a 5V WS2812B LED strip to a 3.3V BK7231N CBU module?

Check power stability, shared ground, and 3.3 V data compatibility with a 5 V LED strip. In the thread, a WS2812 test used 5 V and GND from the AMS1117 input while the Beken signal pin remained 3.3 V. The user saw spurious LED light-ups, skips, and worse behavior when delay changed from 1 second. They planned to test 3.3 V LED power to align power and data levels. [#20736951]
AI summary based on the discussion. May contain errors.
ADVERTISEMENT