logo elektroda
logo elektroda
X
logo elektroda

TUYA PC473 3-Phase Energy Meter Teardown: CT Clamp & CB3S Module Insights

ipasitt 2880 26
ADVERTISEMENT
  • #1 21261496
    ipasitt
    Level 2  
    Bidirectional 3-phase energy meter with a relay and three sensors.

    This device is two-way 3-phase energy metering with 1 channel relay communicating over wi-fi. It reports voltage, current, power factor, active energy, and reverse energy.
    The body can be removed by unscrewing 2 screws at the back and lightly pressing the 2 latches on top and bottom; be gentle at the latches as they easily break.


    There are 2 layers of PCBs stacked over each other, securely soldered and with precise spacing to fit top and bottom cases. I recommend not de-soldering the part.
    I closely looked at the chip and it is CB3S. I managed to flash BK7231N, but cannot proceed with the config on dp_ids, still searching for a profile and template that would fit.
    Bidirectional 3-phase energy meter with visible PCB.

    Two-phase energy meter with visible two PCB layers.

    Flashing can be done by wiring to GND UIRXD UITXD 3V3.
    Close-up of a PCB with pin markings and a red arrow pointing to the UART section.
  • ADVERTISEMENT
  • #2 21262695
    p.kaczmarek2
    Moderator Smart Home
    Hey, are you sure it's a TuyaMCU device? Have you tried our TuyaMCU guide?
    https://www.elektroda.com/rtvforum/topic4038151.html

    Is the device already flashed with OpenBeken? If you've flashed it already, we can try by checking for communication with a basic TuyaMCU config (start driver, set wifi state 0x04) and with request state command.
    https://github.com/openshwprojects/OpenBK7231T_App/blob/main/docs/autoexecExamples.md

    Or maybe can you provide better photos of the device? Maybe it's not a TuyaMCU device after all?
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #4 21262967
    p.kaczmarek2
    Moderator Smart Home
    So HT7032 connects to the WiFi module via UART?

    What did it report in Tuya app, did it report both WiFi module and MCU versions?

    Do you have 2MB flash backup?

    By the way... HT7032 ?
    https://patents.google.com/patent/CN216211301U/en
    Quote:

    6. The three-phase intelligent electric energy meter with the built-in electronic local load switch of claim 5, wherein the type of the metering chip is HT7032, the sampling resistor of the current sampling circuit is 0805 chip resistor, and the sampling resistor of the voltage sampling circuit is 1206 chip resistor.


    Electronic circuit schematic with HT7032 chip.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #8 21263544
    p.kaczmarek2
    Moderator Smart Home
    Well, I can't see even UART baud rate in this file... what do you think, @divadiow ? It seems this device may be using a custom SPI protocol.
    Block diagram of the HT7032 chip with marked interface pins.
    This is not a TuyaMCU at all...
    Helpful post? Buy me a coffee.
  • #9 21263559
    divadiow
    Level 34  
    >>21263503

    storage area in this file contains:

    Code: JSON
    Log in, to see the code


    and the boot log

    Code: Text
    Log in, to see the code


    When pairing with Tuya app you get offered an update from 1.0.5 to 1.0.10

    Device update to version 1.0.10 App display for device PC473 with on/off toggle option. Screenshot of an app with a software update notification.

    after pairing and on 1.0.5 the storage area now contains all the dpID info:

    Code: JSON
    Log in, to see the code


    not seeing any mention of baud speeds

    Added after 3 [minutes]:

    >>21263505

    this secondary binary is already 1.0.10 and contains the dpIDs. did you pair and update this one?

    Added after 9 [minutes]:

    strings from 1.0.5 bin
  • ADVERTISEMENT
  • #10 21263573
    divadiow
    Level 34  
    ipasitt wrote:
    These 4 pins are which HT7032 communicates with Wi-Fi.

    could this mean it's either SPI, QSPI or SSI?

    Added after 1 [hours] 17 [minutes]:

    attached is the output log of 1.0.5 boot, pairing to Tuya app, subsequent upgrade to 1.0.10 then boot of 1.0.10
  • #12 21263784
    ipasitt
    Level 2  
    >>21263559

    I had already paired with TUYA app and upgraded to 1.0.10. Somehow the device still shows 1.0.5 maybe I did not power the device with AC current when I pair with Tuya app, but the upgrade process gone through. Currently I had already flash BK7231N. I don't know how to go from here.

    Added after 36 [minutes]:

    >>21263544

    Is there any chance to get this device working with OpenBeken?
  • #13 21263926
    divadiow
    Level 34  
    ipasitt wrote:
    Is there any chance to get this device working with OpenBeken?

    well I guess OpenBeken will run now on the CB3S but it won't be much use. The communication with the HT7032 will need deciphering and some code writing to accommodate this meter.

    So no, OpenBeken will not give you a fully working non-cloud/Tuya device at present.

    Added after 3 [hours] 22 [minutes]:

    Cloudcutter profiles added for both fw versions https://github.com/tuya-cloudcutter/tuya-clou...mmit/1cd52f62b0fe41e291c28d4aeecd82ac9b93c8e1
  • #14 21264326
    ipasitt
    Level 2  
    >>21263926

    Thank you, what great news, I was using cloudcutter a few days ago without any luck. I will go back and try again.
  • #15 21264343
    divadiow
    Level 34  
    cool. still, HT7032 is an unknown
  • #16 21265256
    ipasitt
    Level 2  
    >>21263573

    I saw many config mention it is SPI communication between HT7032 to wifi. Correct me if I am wrong.

    Added after 3 [minutes]:

    >>21263926

    I had already flashed my device to openBeken, and I went back to Tuya-CloudCutter and failed again. It looks for SmartLive AP !!!
    Any way to work around.

    Thanks
  • #17 21265285
    divadiow
    Level 34  
    ipasitt wrote:
    I had already flashed my device to openBeken, and I went back to Tuya-CloudCutter and failed again. It looks for SmartLive AP !!!Any way to work around.

    im not sure I understand. Cloudcutter is just a way to convert from factory firmware to OpenBeken on devices with exploitable firmware. The end result when running OpenBeken is not any different to UART flashing the device.
  • #18 21265324
    ipasitt
    Level 2  
    >>21265285
    Screenshot of the OpenBK7231N configuration with a list of available pins and their assignments.
    I mean I am stuck at the config page going nowhere. If I do it from the CloudCutter I would get the dp_id from there. Perhaps I am wrong.
  • #19 21265401
    p.kaczmarek2
    Moderator Smart Home
    TuyaMCU is UART only protocol, as far as I know. In order to support your device, we need either:
    - a full documentation of used chip along with SPI protocol specs (commands, etc)
    - some well described communication captures of the SPI lines made with some logic analyzer like Sigrok
    - a reference code of already existing and working driver for the mentioned SPI measurement chip
    Helpful post? Buy me a coffee.
  • #20 21266519
    ipasitt
    Level 2  
    >>21265401

    This is getting out of my knowledge. I am trying my very best to get more information. Would it be best to send one unit to you?

    Best regards.
  • #22 21279592
    p.kaczmarek2
    Moderator Smart Home
    The article you linked is only showing a generic basics of what SPI protocol is. It's a device-independent description of SPI and it's modes.

    We, on other hand, need a device-specific documentation of SPI commands and registers of HT7032.

    The best I can find is this chinese patent, but there doesn't seem to be any protocol details there...
    Helpful post? Buy me a coffee.
  • #24 21280945
    p.kaczmarek2
    Moderator Smart Home
    Very nice, they even include read operation sample, where did you find it?
    SPI read operation example in a Hi-Trend Technology document.
    There is also registers data in this document, but there is a lot of those registers.
    Helpful post? Buy me a coffee.
  • #25 21280952
    divadiow
    Level 34  
    p.kaczmarek2 wrote:
    where did you find it?

    persistence. spamming the right company and contacts :)

    Added after 1 [hours] 7 [minutes]:

    and in response to query "I notice the rar file attached was labelled as for the HT6025, please confirm this can be used with HT7032."

    Code: Text
    Log in, to see the code
  • #26 21285031
    p.kaczmarek2
    Moderator Smart Home
    So here is formatted Read:
    Code: C / C++
    Log in, to see the code

    Write is in this document as well:
    Fragment of documentation showing an example of an SPI write operation.
    Hopefully I've wrote it down without errors:
    Code: C / C++
    Log in, to see the code
    Helpful post? Buy me a coffee.
  • #27 21321680
    ipasitt
    Level 2  
    Hi,
    Any development to support SPI protocol ?

Topic summary

The discussion revolves around the TUYA PC473 three-phase energy meter, which features a two-way energy metering system with Wi-Fi communication. Users are exploring the device's capabilities, including its ability to report various electrical parameters and the potential for firmware flashing. The main focus is on the CB3S chip and its compatibility with OpenBeken firmware. Participants are troubleshooting issues related to communication protocols, specifically the HT7032 chip's connection to the Wi-Fi module via UART and potential SPI communication. There are inquiries about flashing the device, obtaining configuration files, and the challenges faced in transitioning from factory firmware to OpenBeken. The conversation highlights the need for specific documentation and communication captures to support the SPI protocol for the HT7032 chip.
Summary generated by the language model.
ADVERTISEMENT