logo elektroda
logo elektroda
X
logo elektroda

[Solved] Setting Up GPIO for LED Garage Batten Light with BK7231N - 1.17.157 Flash

MnM1 1590 15
ADVERTISEMENT
  • #1 20632411
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    Hi,

    I have a garage batten Led light:

    Setting Up GPIO for LED Garage Batten Light with BK7231N - 1.17.157 Flash

    Setting Up GPIO for LED Garage Batten Light with BK7231N - 1.17.157 Flash

    I have successfully flashed with BK7231N - 1.17.157
    It is on the Wwifi and I can connect to the interface.

    looking at the Tuya GPIO file with bk7321flasher I get the below:

    
    {
    	"rstnum":"3",
    	"rstcor":"c",
    	"Jsonver":"1.0.1",
    	"brightmin":"15",
    	"title20":"0",
    	"deftemp":"100",
    	"c_lv":"1",
    	"mutex":"1",
    	"wfcfg":"spcl_auto",
    	"pmemory":"1",
    	"pairt":"18",
    	"irfunc":"0",
    	"cmod":"cw",
    	"nightled":"0",
    	"wt":"20",
    	"cwtype":"0",
    	"onofftime":"800",
    	"prodagain":"1",
    	"rstbr":"50",
    	"remdmode":"1",
    	"cagt":"20",
    	"w_lv":"1",
    	"c_pin":"7",
    	"notdisturb":"0",
    	"module":"CB3L",
    	"cwmaxp":"100",
    	"dmod":"0",
    	"rgbt":"0",
    	"onoffmode":"0",
    	"brightmax":"100",
    	"w_pin":"6",
    	"wfct":"3",
    	"pwmhz":"16000",
    	"rsttemp":"100",
    	"category":"0502",
    	"defcolor":"c",
    	"defbright":"100",
    	"crc":"95",
    	"}~jd`uAgw_di0|Atls_ca_cntbv":"40.00",
    	"pv":"2.2",
    	"lpv":"3.3",
    	"pk":"keyyepxwk9my9esq",
    	"firmk":"keyyepxwk9my9esq",
    	"cadv":"0",
    	"cdv":"1.0.0",
    	"dev_swv":"1.0.0",
    	"s_id":"null",
    	"dtp":"0",
    	"sync":"0",
    	"attr_num":"0",
    	"mst_tp_0":"0",
    	"mst_ver_0":"null",
    	"mst_tp_1":"0",
    	"mst0er_1":"null",
    	"mst_tp_2":"0",
    	"mst_ver_2":"null",
    	"mst_tp_3":"0",
    	"mst_ver_3":"null "
    }
    


    
    Device configuration, as extracted from Tuya: 
    - LED Cool (Channel 4) on P7
    - LED Warm (Channel 5) on P6
    Device seems to be using CB3L module, which is using BK7231N.
    And the Tuya section starts at UNCOMMON POSITION 0
    




    I have configured it accordingly however I cannot turn it on or off as there are things missing I think.

    Setting Up GPIO for LED Garage Batten Light with BK7231N - 1.17.157 Flash

    Can anyone help with the Turn Off/Turn On part of the configuration?

    Thanks
    Attachments:
    • BK7231N_TuyaConfig_GarageLight-2.bin (72 KB) You must be logged in to download this attachment.
  • ADVERTISEMENT
  • #2 20632492
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    Hello, what do you mean by "turn on and off", how your current OBK main page looks like? Do you have a temperature slider? Is the "On"/"Off" button showing up there? Is it working?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20632513
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    Yes, all is there on the main page. Nothing is missing.

    But with the current GPIO configuration, the light doesn't turn off or on when I press the button on the web page.

    Setting Up GPIO for LED Garage Batten Light with BK7231N - 1.17.157 Flash

    Setting Up GPIO for LED Garage Batten Light with BK7231N - 1.17.157 Flash
  • #4 20632544
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315

    So what do the sliders do? Do they work correctly?

    Or do you observe something like, I don't know, temperature slider is changing brightness, etc?

    Maybe you need the "alternate CW mode" flag?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #5 20632607
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    That is what I am saying - nothing happens. I press the ON button on the main page - The lights do not come on.
    Since lights are not on when I press the OFF button nothing happens.

    As the lights are not ON then the sliders will not work either.

    So in summary - can not turn ON the lights.
  • #6 20632611
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    Ok, so, maybe, let's try with basics. Use GPIODoctor to test each pin in relay mode (on and off), try to set all pins to state 1 (ON, aka high) and tell me, does anything light up?
    https://www.elektroda.com/rtvforum/topic3976371.html
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #7 20632623
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    Ok only PIN 6 and PIN 7 turned ON the light.
    PIN 6 - Warm White
    PIN 7 - Cool White

    The rest of the PINS did nothing

    Setting Up GPIO for LED Garage Batten Light with BK7231N - 1.17.157 Flash

    Added after 7 [minutes]:

    But now the front page looks like this

    Setting Up GPIO for LED Garage Batten Light with BK7231N - 1.17.157 Flash
  • #8 20632630
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315
    Ok, now change the roles of P6 and P7 to PWM, does the light work now?

    If not, go to flags, enable "show raw PWM controllers" to show raw sliders for each PWM. Change those sliders on main page. Do they adjust the light colors, one for cool, second warm?
    Helpful post? Buy me a coffee.
  • #9 20632645
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13

    Changed them:

    Setting Up GPIO for LED Garage Batten Light with BK7231N - 1.17.157 Flash

    Enabled the raw option but there is no button for ON or OFF on the main page now:

    Setting Up GPIO for LED Garage Batten Light with BK7231N - 1.17.157 Flash

    Sliders do work and light dims or increases if I use them.
  • #10 20632662
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315

    And now, if you disable "show raw PWM controllers", does the main page work?

    If not, try setting cool channel to 0 and warm to 1...
    Helpful post? Buy me a coffee.
  • #11 20632682
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13

    Setting the PWM 6 to 1 and PWM 7 to 0 seems to have worked.

    However, there is one issue - the light is not as bright as it was when it was running the Tuya firmware. It is much dimmer now.
    I find that when I go to GPIO Doctor on HIGH, the light is much brighter too.

    Any ideas?
  • Helpful post
    #12 20632695
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315

    What do you have on the main page now, what are the channel values at full brightness?

    Maybe you need to enable alternate PWM frequency in flags.
    Helpful post? Buy me a coffee.
  • #13 20632697
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13

    This is the main page now, with light working:

    Setting Up GPIO for LED Garage Batten Light with BK7231N - 1.17.157 Flash

    I will try your suggestion and see.
  • #14 20634661
    Nimierkki
    Level 6  
    Posts: 10
    >>20632682
    I also have this same exact brightness issue with another vendor's device, what I flashed with Openbeken. Did you find any solution?
  • #15 20634764
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14394
    Help: 650
    Rate: 12315

    @Nimierkki Keep in mind that for "I2C" LED drivers like SM2135 or BP5758, you can set the current via console command. Or is your device using PWMs without any custom controllers?
    Helpful post? Buy me a coffee.
  • #16 20733478
    MnM1
    Level 10  
    Posts: 175
    Help: 4
    Rate: 13
    Lights installed.
    They seem very bright in the garage - the issue where they seemed not that bright might had been a perception error.

Topic summary

✨ The discussion revolves around configuring GPIO for a garage batten LED light after flashing it with BK7231N firmware version 1.17.157. The user successfully connected the device to Wi-Fi but faced issues with the light not turning on or off via the web interface. After troubleshooting, it was determined that only specific GPIO pins (PIN 6 for Warm White and PIN 7 for Cool White) activated the light. Adjustments were made to the GPIO settings, including changing pin roles to PWM and enabling raw PWM controllers, which allowed the sliders to control brightness. However, the user noted that the brightness was lower compared to the original Tuya firmware. Suggestions included checking channel values and enabling alternate PWM frequency. Ultimately, the user reported that the lights appeared bright in the garage, indicating a possible perception error regarding brightness.
Generated by the language model.

FAQ

TL;DR: For BK7231N batten lights, Tuya config shows 16 kHz PWM and "LED Cool on P7; LED Warm on P6." Set P6/P7 to PWM and map Warm=1, Cool=0 to restore On/Off control. [Elektroda, MnM1, post #20632411]

Why it matters: This helps OpenBeken users fix non‑responsive CW LEDs after flashing by applying the correct pin roles, mapping, and flags.

Quick Facts

How do I fix the On/Off button not working after flashing BK7231N 1.17.157?

Map the CW channels correctly. Set P6 and P7 to PWM roles, then assign Warm=1 and Cool=0. If needed, temporarily enable “Show raw PWM controllers” to verify each channel. Then disable it and use the standard CW UI with On/Off. Expert tip: “Set cool channel to 0 and warm to 1.” 1) Set P6=PWM, P7=PWM. 2) Warm channel=1, Cool channel=0. 3) Test On/Off on main page. [Elektroda, p.kaczmarek2, post #20632662]

How do I find which pins drive Warm and Cool LEDs on this batten?

Use GPIODoctor in relay mode to toggle each pin. In this case, only P6 and P7 lit the LEDs. P6 controlled Warm White and P7 controlled Cool White. That confirms both channels and avoids guessing in the role configuration. This quick test isolates the active outputs before you set PWM roles or channel IDs in OpenBeken. [Elektroda, MnM1, post #20632623]

What GPIO roles and channel mapping should I use for P6 and P7?

Assign both pins as PWM. Set PWM6 (P6) to channel 1 for Warm and PWM7 (P7) to channel 0 for Cool. This mapping restored full control for the batten in the thread. After applying it, the On/Off button and sliders worked as expected. Always verify on the main page after saving. [Elektroda, MnM1, post #20632682]

Why does enabling “Show raw PWM controllers” remove the On/Off button?

That flag exposes per-channel raw sliders and hides the standard CW UI, including the On/Off switch. It is intended for testing channel behavior, not daily operation. Disable the flag after verification to bring back the main On/Off and the CW controls. This behavior was observed during troubleshooting in the thread. [Elektroda, MnM1, post #20632645]

The sliders work but brightness seems low—what should I change?

Check channel values at full brightness and try the “alternate PWM frequency” flag. This flag can improve brightness perception by changing PWM behavior. Confirm the CW mapping first, then toggle the flag and test again. “Maybe you need to enable alternate PWM frequency,” as suggested by the maintainer. Record before/after to compare objectively. [Elektroda, p.kaczmarek2, post #20632695]

What PWM frequency does the Tuya JSON configure for this light?

The Tuya extract shows pwmhz set to 16,000 Hz. That is a typical high-frequency PWM for LED drivers, reducing visible flicker. It also lists w_pin=6 and c_pin=7, matching Warm and Cool outputs. Use this data to inform your OpenBeken setup if you import pin roles manually. [Elektroda, MnM1, post #20632411]

Do I need the “Alternate CW mode” flag, and when?

Enable it if the color temperature slider changes overall brightness or channel mixing looks wrong. This flag swaps CW handling to match some drivers. As the maintainer noted, “Maybe you need the ‘alternate CW mode’ flag?” Toggle it, then retest sliders and On/Off behavior to confirm improvement. [Elektroda, p.kaczmarek2, post #20632544]

How can I test raw PWM to verify each channel controls the correct LED?

Turn on the “Show raw PWM controllers” flag to display separate PWM sliders. Move each slider and observe which LED channel responds. One slider should adjust Cool and the other Warm. Use this to confirm mapping before relying on the standard CW UI. Then turn the flag off for normal operation. [Elektroda, p.kaczmarek2, post #20632630]

My LED driver is SM2135 or BP5758—how do I increase current or brightness?

For I2C LED drivers like SM2135 or BP5758, set current via console commands. This lets you raise channel current within safe limits. “You can set the current via console command,” per the maintainer. Confirm your driver type first; PWM-only devices do not use these commands. Always test incrementally. [Elektroda, p.kaczmarek2, post #20634764]

After installation, will brightness match Tuya firmware levels?

One installer later reported the lights were very bright in the garage. The earlier dimness concern was likely perception during bench testing. Install environment, angle, and surface reflectance affect perceived luminance. Re-evaluate brightness after mounting before further tweaks. [Elektroda, MnM1, post #20733478]

Which module and SoC does this batten use?

It uses a CB3L module based on the BK7231N SoC. The Tuya JSON and forum notes identify this pairing. Knowing the module helps you select the correct OpenBeken build and pin mappings. It also clarifies that PWM control applies rather than proprietary driver protocols. [Elektroda, MnM1, post #20632411]

How can I extract the Tuya pin map before configuring OpenBeken?

Read the device with bk7321flasher and review the JSON. Look for c_pin and w_pin fields to identify Cool and Warm outputs. In this case, c_pin=7 and w_pin=6. You can also note pwmhz for reference. Use this info to set roles and channels accurately. [Elektroda, MnM1, post #20632411]

What OpenBeken version was used here, and did Wi‑Fi and the UI load correctly?

The device was flashed with BK7231N firmware 1.17.157. It connected to Wi‑Fi and the web interface opened normally. The issue was only with CW control mapping, later resolved by adjusting PWM channels. This confirms basic connectivity was fine from the start. [Elektroda, MnM1, post #20632411]
Generated by the language model.
ADVERTISEMENT