FAQ
TL;DR: With 4 mapped pins and one critical fix — "IR requires a very precise timing" — this FAQ shows WX300P owners how to flash a Tuya CBU/BK7231N RGB controller with OpenBK, keep IR_NEC working, and bind remote buttons through addEventHandler2 without PowerSave breaking decoding. [#20897350]
Why it matters: This thread turns a hard-to-reuse Tuya RGB strip controller into a documented OpenBK setup with working PWM, IR control, serial flashing points, and repeatable boot behavior.
| Setting |
IR result |
Notes |
PowerSave 1 |
IR_UNKNOWN |
Sleep interferes with IR timing |
PowerSave 0 |
IR_NEC returns |
Required for reliable remote decoding |
Key insight: On this WX300P build, the template was already correct; the real blocker was power saving. If IR decoding changes after reboot or autoexec.bat edits, set PowerSave 0 explicitly and test again.
Quick Facts
- OpenBK template data for this controller maps GPIO 6, 7, and 8 to
PWM;3, PWM;2, and PWM;1, and maps GPIO 26 to IRRecv;1. [#20897195]
- The dumped Tuya data shows firmware values including
swv 1.0.1, bv 40.00, pv 2.2, lpv 3.3, and default country_code CN. [#20897195]
- The CBU pinout exposed in the thread places RX2 on pin 6, TX2 on pin 7, GND on pin 13, and 3V3 on pin 14, which is enough for serial access and logs. [#21011454]
- A working IR setup used NEC address
0xFBE2 with button codes such as 0x26 for ON, 0x25 for OFF, 0x5A for brighter, and 0x10 for dimmer. [#20904671]
How do I flash a Tuya WX300P RGB strip controller with a CBU/BK7231N module using OpenBK?
Flash it over the CBU module’s exposed UART pins. 1. Connect
RX2 pin 6,
TX2 pin 7,
GND pin 13, and
3V3 pin 14 on the CBU. 2. Use the OpenBK flasher referenced in the thread. 3. After flashing, apply the WX300P OpenBK template so PWM and IR map correctly. The thread confirms the template for
model WX300P,
chip BK7231N, and
board CBU worked on this unit.
[#21011454]
Why does IR_NEC decoding on the WX300P turn into IR_UNKNOWN after I enable PowerSave in OpenBK?
PowerSave breaks reliable IR timing on this controller. The maintainer states,
"IR requires a very precise timing," and sleep activity can disrupt that timing. In the thread,
PowerSave 1 made the logs show
IR_UNKNOWN, while setting
PowerSave 0 from the command line brought
IR_NEC back immediately. On this WX300P, reliable remote decoding and power saving did not coexist.
[#20897350]
What is a CBU module, and how is it related to the BK7231N chip in Tuya devices like the WX300P?
"CBU" is a Tuya Wi‑Fi module that carries the main radio and GPIO hardware, exposing power, UART, PWM-capable pins, and reset on a castellated module footprint. In this thread, the WX300P controller uses a
CBU board, and its OpenBK template identifies the underlying
chip as BK7231N. That means CBU is the module form factor, while BK7231N is the SoC inside it.
[#20897195]
What is OpenBK or OBK, and what does an OpenBK template do for a Tuya RGB strip controller?
"OpenBK" is open firmware for Beken/Tuya devices that replaces factory firmware, exposes commands, drivers, and event handlers, and lets you remap hardware features through a device template. On this WX300P, the template defined the device name, module type, and pin roles. Specifically, it mapped
three PWM outputs and
one IR input, which made the controller usable right after flashing.
[#20897195]
Which GPIO pins are used on the Tuya WX300P CBU board for RGB PWM and the IR receiver?
The posted OpenBK template uses
GPIO 6,
GPIO 7, and
GPIO 8 for PWM, and
GPIO 26 for the IR receiver. In template syntax, those appear as
6: PWM;3,
7: PWM;2,
8: PWM;1, and
26: IRRecv;1. That pin map was reported as correct for this WX300P variant with the CBU module.
[#20897195]
Where are the RX and TX pins on the CBU module, and how do I connect them for flashing or serial logs?
The CBU exposes UART directly on the module. The pin table posted in the thread lists
RX2 on pin 6 and
TX2 on pin 7; it also lists
GND on pin 13 and
3V3 on pin 14. Connect your USB‑UART adapter to those four points for flashing or logs, and use the matching RX/TX crossover. The maintainer explicitly says the CBU module has RX/TX available easily.
[#21011454]
How can I map IR remote buttons to actions in OpenBK with addEventHandler2 on a WX300P controller?
Map each remote code to a command with
addEventHandler2. A working example on this WX300P used NEC address
0xFBE2 and commands like
led_enableAll 1,
led_enableAll 0,
led_basecolor_rgb #ff0000, and
add_dimmer 10. Put those lines in
autoexec.bat, keep
PowerSave 0, reboot, and press each button to confirm the expected event fires. That method solved on/off, colors, brightness, and mode cycling.
[#20904671]
What do the IR_NEC logs 0xFBE2 and button codes like 0x26 or 0x25 mean in OpenBK?
They identify the remote protocol frame that OpenBK decoded. In the working examples,
IR_NEC 0xFBE2 0x26 triggered LED ON and
IR_NEC 0xFBE2 0x25 triggered LED OFF. Here,
0xFBE2 is the shared NEC address seen across buttons, while the final byte changes per key. That lets you bind each button to a different command with separate
addEventHandler2 entries.
[#20901171]
How should I configure autoexec.bat for a Tuya WX300P so SSDP, Wemo, IR remote control, and LED commands all work together?
Use one backlog line for services, then add IR handlers below it. The working file started with
backlog powersave 0; startDriver SSDP; startDriver Wemo, then added NEC handlers for ON, OFF, six colors, brighter, dimmer, and two
led_nextColor actions. The key requirement is explicit
powersave 0 in
autoexec.bat; removing a previous
powersave 1 line did not automatically reset the state on reboot.
[#20904671]
Why didn't bk7231flasher 1.1.6 extract the config from the firmware dump of this Tuya WX300P?
The thread reports that
bk7231flasher_1.1.6 dumped the firmware but
did not extract the config, and it gives no fix. The only concrete conclusion is that this firmware layout or partition data was not parsed successfully by that tool version on this unit. The user still captured the boot log and original dump, so the failure was specific to config extraction, not to reading flash at all.
[#20897195]
How do I use add_dimmer correctly in OpenBK for IR remote brightness control instead of led_dimmer on a BK7231N LED strip controller?
Use
add_dimmer with a step value, not
led_dimmer, for button-based brightness changes here. The user first found that
led_dimmer 1 and
led_dimmer -1 only toggled the strip instead of adjusting brightness. The working fix was
addEventHandler2 IR_NEC 0xFBE2 0x5A add_dimmer 10 and
... 0x10 add_dimmer -10. On this setup,
10-step increments gave correct brightening and dimming from the remote.
[#20904671]
What is the difference between led_dimmer, add_dimmer, led_basecolor_rgb, and led_nextColor in OpenBK LED control commands?
They control different parts of LED behavior. In this thread,
led_basecolor_rgb set an exact color such as
#ff0000 or
#FFFFFF.
led_nextColor cycled to the next color.
add_dimmer changed brightness by a relative amount, such as
10 or
-10. By contrast, the user reported
led_dimmer did not work as intended on the remote buttons and only toggled the strip on this controller.
[#20904671]
How can I extract or reverse engineer IR button codes and actions from the factory Tuya firmware on a BK7231N device?
You usually cannot extract them directly from the known Tuya JSON partition. The maintainer says there are
no IR codes in the JSON partition that we know, and deeper reverse engineering would be a
very big and time consuming effort. For this WX300P, the practical method was simpler: press every remote button, read the logged NEC codes, and assign actions manually with event handlers.
[#20899778]
PowerSave vs reliable IR reception in OpenBK: which setting is better for a Tuya WX300P with an IR remote?
Choose
PowerSave 0 if you want stable IR remote control. The thread shows a direct tradeoff: with power saving enabled, NEC decoding fell back to
IR_UNKNOWN; with power saving disabled,
IR_NEC returned. The maintainer even considered adding a warning when both features are enabled together. On this specific WX300P use case, reliable IR reception mattered more than sleep behavior.
[#20897706]
What troubleshooting steps help when a Tuya WX300P works with the OpenBK template but the remote behaves inconsistently after reboot or config changes?
Start by checking PowerSave, then retest the raw IR logs. 1. Run
PowerSave 0 and reboot. 2. Confirm logs show
IR_NEC, not
IR_UNKNOWN. 3. Reapply only the known-good
autoexec.bat lines and add handlers back gradually. One edge case from the thread matters: deleting
powersave 1 from
autoexec.bat did
not automatically restore the old state, so a manual
PowerSave 0 command was needed to recover decoding.
[#20897367]
Comments
So, when I initially flashed and only set the OBK template, I was seeing IR_NEC logs when pushing buttons on the remote. Now I have to enable flag 15 to see just IR_UNKNOWN show. https://obrazki.elektroda.pl/5589369400_1704662087_thumb.jpg... [Read more]
PowerSave is usually trying to sleep device often, maybe you need to try without it. IR requires a very precise timing. [Read more]
yes. setting powersave to 0 from command line brings the IR_NEC back. I had removed powersave 1 from the autoexec and rebooted, assuming this would put powersave to 0, but I guess it doesn't. [Read more]
I may look into it today and maybe add some kind of warning to main WWW panel when both PowerSave and IR are enabled [Read more]
Is there a way to extract the IR codes and their actions from the factory firmware, like with GPIO, or is the only option to push every button on the remote and manually add an event handler? [Read more]
There are no IR codes in the JSON partition that we know and any futher potential reverse engineering would be a very big and time consuming effort, I don't think it would be reasonable to do it. We may... [Read more]
For anyone interested, I have this set for the power on/off and the basic color buttons using this remote. At the moment, the dimmer command just turns the LED strip on and off rather than adjusting brightness... [Read more]
Which commands would you like to see? Don't forget that we have also such a command: led_nextColor See more: https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/commands.md [Read more]
OK cool. I'm using Mode+ and Mode- buttons for basic next colour cycling addEventHandler2 IR_NEC 0xFBE2 0x8A led_nextColor addEventHandler2 IR_NEC 0xFBE2 0x8 led_nextColor and oh, I should be... [Read more]
Usually you may get some more output in console if you change log level to debug or to everything, but I am not sure if that slider will output anything more. [Read more]
Yes, I set it to the highest level. Not to worry, all sorted. [Read more]
Hi, Just bought one of these, since I’m a bit newbies to the tuya scene (been using/programing esp32/tasmota), how do you program this? Direct connection to the tx/rx pins on the cbu module , or are... [Read more]
CBU module has RX/TX available easily. https://obrazki.elektroda.pl/3756074600_1710917603_thumb.jpg Pin number Symbol I/O type Function 1 P14 I/O Common GPIO, which can be reused as... [Read more]