logo elektroda
logo elektroda
X
logo elektroda
Dostępna jest polska wersja

Czy wolisz polską wersję strony elektroda?

Nie, dziękuję Przekieruj mnie tam

[BK7231N / CB3S] Generic Tuya Water Pump flashing and setup OpenBK7231N_QIO_1.17.240.bin

SoundreameR 3216 2

TL;DR

  • An ultra-cheap Chinese Tuya house-plant water pump with a CB3S module and an unlabeled SOP16 custom MCU was flashed with OpenBeken.
  • The CB3S drives the pump motor on P7, the LEDs on P8, and receives both front buttons through the custom MCU on P14.
  • OpenBK7231N_QIO_1.17.240.bin uploaded with hid_download_py on the third attempt using the power-cycling method, without grounding the reset pin.
  • Clicking the pump button toggles the pump, while the Wi‑Fi button triggers AP mode through OpenBeken event handlers.
  • The two buttons are only simulated as one input by the custom MCU, so they do not behave independently.
ADVERTISEMENT
📢 Listen (AI):

  • Hello again! It's been a while since I last posted. Found this ultra-cheap house plant water pump from China and I was pretty determined to make it work with open source firmware, whatever is inside. [BK7231N / CB3S] Generic Tuya Water Pump flashing and setup OpenBK7231N_QIO_1.17.240.bin

    Turns out there's a CB3S inside along with some unlabeled custom MCU in a SOP16 package. Probably designed that way to facilitate battery powered mode, which the PCB does seem to be fully capable of doing but the pump plastic housing was refactored and modified for USB powering instead. The two buttons on the front panel are wired through the custom MCU which is connected only via P14 to the CB3S. Luckily the CB3S directly controls the two LEDs and the pump motor through P7 and P8.

    Using hid_download_py I managed to upload OpenBeken to the module from the third attempt using the power-cycling method because of lack of hands to ground the reset pin.
    sudo ./uartprogram /home/ivan/Downloads/OpenBK7231N_QIO_1.17.240.bin -d /dev/ttyUSB0 -w -s 0x0 -u


    Close-up of a circuit board featuring a CB3S module with labeled RX, TX, GND, and 3.3V pins along with other components.

    It took me some trial and error but eventually I figured out the two buttons could be utilized by listening for short click and long hold on the same input as it seems the custom MCU is simulating a single button on that input pin. Tapping the wifi button generates a long press event and tapping the pump power button generates a short click event. Pressing the buttons any other way doesn't produce any different events. That's just how the custom MCU behaves.

    Adding
    backlog AddEventHandler OnClick 14 ToggleChannel 1; AddEventHandler OnHoldStart 14 backlog OpenAP
    to the startup gives the two buttons somewhat useful functions of toggling the pump on and off and setting the board into AP mode respectively.

    Adding template as response to this post after I get a thread ID.

    The image shows a hand holding a small white water pump with two buttons and Wi-Fi symbols on its front panel. Top view of a water pump with WiFi and power buttons. Water pump control module with exposed PCB and wires.

    Added after 1 [minutes]:

    Here's the template I am using:

    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Tuya Generic Water Pump",
      "model": "WIFI-V1.11",
      "chip": "BK7231N",
      "board": "WIFI-V1.11",
      "flags": "1024",
      "keywords": [
        "CB3S",
        "BK7231N",
        "water",
        "pump"
      ],
      "pins": {
        "7": "Rel;1",
        "8": "WifiLED_n;0",
        "14": "Btn;2"
      },
      "command": "backlog AddEventHandler OnClick 14 ToggleChannel 1; AddEventHandler OnHoldStart 14 backlog OpenAP",
      "image": "https://obrazki.elektroda.pl/2842963700_1694381412_thumb.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/viewtopic.php?p=20728797#20728797"
    }
    


    Cool? Ranking DIY
    About Author
    SoundreameR
    Level 3  
    Offline 
    SoundreameR wrote 5 posts with rating 1. Live in city Calgary. Been with us since 2023 year.
  • ADVERTISEMENT
  • #2 20728909
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14649
    Help: 655
    Rate: 12661
    Very good and comprehensive review. Futhermore, it's a new device to me. I haven't seen that one yet. Well done!

    So it's an USB-powered one? What kind of USB adapter is recommended, will 500mA be enough? Have you tried to measure the current consumption when motor is running?
    Helpful post? Buy me a coffee.
  • #3 20729728
    SoundreameR
    Level 3  
    Posts: 5
    Rate: 1
    Thanks! Good questions, but unfortunately I don't have a ready answer.

    The device is USB powered. The PCB is equipped for battery mode, all the necessary circuitry is there.
    The plastic housing even has a battery compartment for 4xAA, but the wiring is missing and there's a sticker explaining that for better performance stability you should use USB power instead.
    It has a micro USB and I don't remember seeing any power ratings anywhere, not on the device itself, nor in the store ad or the user manual that came with it.
    I've tested it through my laptop's USB and it's running fine, but perhaps a 1A adapter would be a reasonable choice.
    There are 2 beefy capacitors on the PCB so it should be fine.
    I haven't measured the actual current draw because I don't have the appropriate tools to do so. I've recently moved and all I have in terms of tools sums up to a questionable multimeter and a CP2102 USB to UART stick.


    Added after 8 [hours] 31 [minutes]:

    Ok I checked the box again and found this pamphlet which suggests 600 mAh. So yeah, 1A should be more than enough.
    Promotional flyer showing a Wi-Fi controlled smart watering device.
📢 Listen (AI):

FAQ

TL;DR: This FAQ helps OpenBeken users flash a Tuya plant pump with 3 mapped pins and reuse both front buttons. As the thread shows, "1A should be more than enough" after OpenBK7231N_QIO_1.17.240.bin was uploaded by power-cycling a BK7231N/CB3S board and mapping P7, P8, and P14 for relay, LED, and button events. [#20728797]

Why it matters: It turns a very cheap Tuya watering pump into a documented OpenBeken target with known GPIOs, button logic, and practical power guidance.

Option What the thread says Practical takeaway
500 mA USB Asked about, not confirmed by measurement Unverified in this thread
600 mAh note on pamphlet Pamphlet suggests 600 mAh Indicates the device expects more than minimal USB current
1 A USB adapter Suggested as reasonable and "more than enough" Best-supported choice here
4xAA battery mode PCB and housing support it, wiring is missing USB is the actually used power path

Key insight: The pump works cleanly with OpenBeken once you treat both front buttons as different events on the same P14 input. One short-click toggles the pump, and one long-hold starts OpenAP mode.

Quick Facts

  • The confirmed OpenBeken mapping is P7 = Rel;1, P8 = WifiLED_n;0, and P14 = Btn;2 for the WIFI-V1.11 board using a BK7231N chip on a CB3S module. [#20728797]
  • Flashing used uartprogram with OpenBK7231N_QIO_1.17.240.bin, device path /dev/ttyUSB0, start address 0x0, and the power-cycling method instead of manually holding reset low. [#20728797]
  • The enclosure includes space for 4xAA cells, but the shipped unit is micro USB powered and the battery wiring is absent, while a sticker says USB gives better stability. [#20729728]
  • The thread reports no measured motor current, but the best available guidance is a pamphlet suggesting 600 mAh and a practical recommendation that a 1 A USB adapter should be more than enough. [#20729728]

How do I flash a Tuya generic water pump with a CB3S/BK7231N module using OpenBK7231N_QIO_1.17.240.bin and hid_download_py?

Flash it through the BK7231N serial toolchain and then power-cycle the board into download mode. 1. Connect a USB-to-UART adapter such as a CP2102 to the module. 2. Run sudo ./uartprogram /home/ivan/Downloads/OpenBK7231N_QIO_1.17.240.bin -d /dev/ttyUSB0 -w -s 0x0 -u. 3. Reapply power until the bootloader catches; this case succeeded on the third attempt. [#20728797]

What is a CB3S module, and how does it relate to the BK7231N chip in Tuya devices?

A CB3S is the Wi-Fi module on this board, and it carries the BK7231N-based control functions exposed to OpenBeken. "CB3S is a Tuya Wi‑Fi module that carries the BK7231N SoC, exposes GPIO pins, and lets the main board add wireless control without designing a radio section from scratch." In this pump, the CB3S directly drives the motor on P7 and the LED on P8. [#20728797]

Why do the two front buttons on this Tuya water pump show up as short-click and long-hold events on the same P14 input?

They appear that way because both front buttons are routed through a separate SOP16 controller, not directly to two CB3S GPIOs. The thread says that custom MCU talks to the CB3S only through P14 and simulates one logical button there. Pressing the WiFi button generates a long press, while pressing the pump button generates a short click. [#20728797]

Which OpenBeken event handler commands make the water pump button toggle Channel 1 and the WiFi button start OpenAP mode?

Use this startup command: backlog AddEventHandler OnClick 14 ToggleChannel 1; AddEventHandler OnHoldStart 14 backlog OpenAP. It binds a short click on GPIO 14 to ToggleChannel 1 and a hold event on the same pin to OpenAP. That matches the pump button and WiFi button behavior observed on this board. [#20728797]

What template should I use in OpenBeken for a Tuya Generic Water Pump model WIFI-V1.11 with pins 7, 8, and 14 mapped?

Use the posted JSON template for Tuya Generic Water Pump, model WIFI-V1.11, with P7 = Rel;1, P8 = WifiLED_n;0, and P14 = Btn;2. It also sets flags to 1024, identifies the chip as BK7231N, and includes the button-event command for toggling Channel 1 and opening AP mode. This is the exact working template from the thread. [#20728797]

What is OpenAP in OpenBeken, and when would you trigger it from a button hold event?

OpenAP is the recovery-style Wi-Fi access point mode you start when normal network access is unavailable. "OpenAP is an OpenBeken access-point mode that brings the device up with its own Wi‑Fi network, making first-time setup or recovery possible without the original router connection." In this pump, a hold event on P14 starts OpenAP so the WiFi button becomes a setup shortcut. [#20728797]

Why might flashing a BK7231N board require the power-cycling method instead of grounding the reset pin manually?

It may require power-cycling when you cannot reliably control reset and boot timing by hand. The author lacked enough hands to ground the reset pin cleanly, so the board only entered download mode through repeated power cycles. In this case, flashing succeeded on the third attempt, which shows timing can be intermittent on a small CB3S board. [#20728797]

What current consumption does the USB-powered Tuya water pump draw while the motor is running?

The thread does not provide a measured motor current. The author explicitly says no suitable measurement tools were available after moving and only mentions a questionable multimeter and a CP2102 USB-to-UART stick. That means any exact running-current number would be unsupported here. [#20729728]

Which USB power adapter rating is best for this generic Tuya water pump: 500 mA, 600 mA, or 1 A?

A 1 A USB adapter is the best-supported choice in this thread. The device ran from a laptop USB port, and later the box pamphlet suggested 600 mAh, after which the author concluded that 1A should be more than enough. The thread does not confirm 500 mA with measurements. [#20729728]

How does USB power compare with the built-in 4xAA battery option for stability on this Tuya plant watering pump?

USB power is presented as the more stable option on the shipped unit. The PCB includes battery circuitry and the housing has a 4xAA compartment, but the battery wiring is missing and a sticker says to use USB power for better performance stability. In practice, this specific device is configured for micro USB use, not battery operation. [#20729728]

What role does the custom SOP16 MCU play in this water pump, and why are the buttons routed through it instead of directly to the CB3S?

The custom SOP16 MCU handles the front-panel button logic and likely supports the board’s battery-oriented design. The author notes that both buttons pass through that MCU, which connects to the CB3S only on P14. The same post says this layout was probably chosen to facilitate battery-powered mode, even though the sold housing was modified for USB power. [#20728797]

How can I identify which GPIO pins control the pump relay, WiFi LED, and button input on a BK7231N CB3S board?

Identify them by testing outputs and watching which functions react in OpenBeken. On this board, trial and error showed P7 controls the pump output as Rel;1, P8 controls the WifiLED_n, and P14 is the button input. The useful clue was that both front buttons created different event types on the same input pin. [#20728797]

What is hid_download_py or uartprogram, and how is it used to upload OpenBeken firmware to a BK7231N device?

It is the flashing utility used to send a firmware image over UART to the BK7231N bootloader. "uartprogram is a serial flashing tool that writes firmware images to BK7231N-based boards, using a USB-to-UART link and a target flash address such as 0x0." Here it wrote OpenBK7231N_QIO_1.17.240.bin through /dev/ttyUSB0 with the -w -s 0x0 -u options. [#20728797]

What troubleshooting steps help when a CB3S/BK7231N device only flashes successfully on the third attempt or intermittently enters download mode?

Retry the boot-entry sequence and simplify the setup. 1. Keep the UART wiring fixed and correct. 2. Use power-cycling if you cannot hold reset and boot pins consistently. 3. Repeat the process several times; this board finally flashed on the third attempt. An intermittent result here points to timing, not a bad firmware image by itself. [#20728797]

Where can I find the recommended power specification for this Tuya water pump if the device, listing, and manual do not clearly state it?

Check the product box and any paper pamphlet inside it. The thread says the device body, store listing, and user manual did not show a clear rating, but a later recheck of the box found a pamphlet suggesting 600 mAh. That became the only concrete power clue in the discussion. [#20729728]
ADVERTISEMENT