logo elektroda
logo elektroda
X
logo elektroda

[BK7231N] How to add BL0939 SPI support for Tuya 2x CT Smart Power Meter Clamp?

geoagache 45 0
ADVERTISEMENT
  • #1 21923738
    geoagache
    Level 1  
    Posts: 1
    Hello, I am looking to get OpenBeken working on a Smart Power Meter Clamp (Dual Channel CT). It is a Tuya-based device with the FCC ID: 2BL6A-WMDL. Inside, the Wi-Fi module is a CB3S (BK7231N). Power monitoring is handled by the BL0939 chip, but instead of the usual UART connection, it is wired via the SPI interface.
    I have reverse-engineered the board tracks and identified the complete pinout configuration:
    SPI Pins connected to BL0939:
    SDO (MISO): P6
    SDI (MOSI): P24
    SCLK (Clock): P26
    Other Function Pins:
    CF (Power Pulse): P14
    ZX (Zero Crossing): P23
    Relay/Control (RL): P8
    Button/LED (1K): P7
    Since this device uses two current clamps (CT1 and CT2) via the BL0939 SPI interface, I would greatly appreciate it if support for this specific configuration could be added to the driver list (similar to the existing BL0942SPI driver). I have high-resolution photos of the PCB and I am ready to flash any test binary builds to help debug and calibrate the measurements.

    For reference, here is the official Tuya DP structure extracted from the device:

    * **General:**
    * Device ID:
    bf00d07292695276fczfts

    * **Channel 1 (CT1):**
    * Voltage:
    cur_voltage
    (DP 20)
    * Current:
    cur_current
    (DP 18)
    * Power:
    cur_power
    (DP 19)
    * State:
    cur_state1
    (DP 105)
    * Forward Energy (Total):
    add_ele
    (DP 17)
    * Reverse Energy:
    ct1_reverse
    (DP 115)
    * Daily Forward:
    ct1_day_forward
    (DP 106)
    * Daily Reverse:
    ct1_day_reverse
    (DP 116)
    * Record Power:
    record_power1
    (DP 123)
    * **Channel 2 (CT2):**
    * Voltage 2:
    cur_voltage2
    (DP 114)
    * Current 2:
    cur_current2
    (DP 112)
    * Power 2:
    cur_power2
    (DP 113)
    * State:
    cur_state2
    (DP 108)
    * Forward Energy:
    ct2_forward
    (DP 111)
    * Reverse Energy:
    ct2_reverse
    (DP 117)
    * Daily Forward:
    ct2_day_forward
    (DP 109)
    * Daily Reverse:
    ct2_day_reverse
    (DP 118)
    * Record Power:
    record_power2
    (DP 124)
    * **Total:**
    * Total Forward:
    total_forward
    (DP 119)
    * Total Reverse:
    total_reverse
    (DP 121)
    [BK7231N] How to add BL0939 SPI support for Tuya 2x CT Smart Power Meter Clamp?
    [BK7231N] How to add BL0939 SPI support for Tuya 2x CT Smart Power Meter Clamp?
    [BK7231N] How to add BL0939 SPI support for Tuya 2x CT Smart Power Meter Clamp?
    [BK7231N] How to add BL0939 SPI support for Tuya 2x CT Smart Power Meter Clamp?
    [BK7231N] How to add BL0939 SPI support for Tuya 2x CT Smart Power Meter Clamp?
    Circuit board with black relay, green screw terminal block, and power components on a concrete surface
    Close-up of a green PCB with SMD components and attached wires; blurred background.


    Thank you for your incredible work on this project!
    Attachments:
    • readResult_BK7231N_QIO_wmdl-2c.bin (2 MB) You must be logged in to download this attachment.
  • ADVERTISEMENT
ADVERTISEMENT