logo elektroda
logo elektroda
X
logo elektroda

Power Meter KWS-302WF: Switching from Shunt to Transformer with HT7017 Chip sometime in the futur ..

Lusant 4743 30
ADVERTISEMENT
  • #31 21617102
    DGAlexandru
    Level 7  
    Hi Lusant,

    thanks for the file... it makes some more light into those "unknown" dpIDs:
    "switch_schedule" for "dp_id": 122 - now it makes sense. In the Smart Life App you can define schedules to control the relay. I think they used a different dpID for this than the 0x10 / 16 one just to have a trace of the owner of the command :P

    I confirm that pressing + and - buttons on the device, for 5s, resets all the values in the device, including this dpID 0x7b / 123. The screen puts underscores "___" at all the values for about 1 second then it switches the Relay to Off and changes the screen to "Relay Off" mode and stays like that.
    It also resets the configured values for UnderVoltage, OverVoltage and so on to their default values.
    Great find!

    Now if I could make Ghidra help me in decompiling the MCU firmware to something I can work with so I can modify it to have at least a "recovery time" option :)

    Added after 25 [minutes]:

    Revised autoexec.bat version based on the new findings now draws the GUI like this:
    Close-up of a measurement device screen showing underscores instead of value readings during reset.

    (I edited my previous message with the autoexec.bat code and updated it there)
  • ADVERTISEMENT

Topic summary

The discussion centers on modifying the Power Meter KWS-302WF to switch its current measurement method from a shunt resistor to a transformer. The device uses an HT7017 measurement chip from HitrendTech, controlled by a PY32F002A MCU, which interfaces with a TM1622 display driver and a WiFi module identified as CBU (likely BK7231N). Communication between HT7017 and PY32F occurs at 4800 bps, while between CBU and PY32F it is at 115200 bps. Efforts include intercepting UART communications and backing up firmware to enable custom firmware flashing, particularly on the CBU WiFi module, using OpenBeken firmware and TuyaMCU protocols. Challenges include potential MCU protection and limited documentation on HT7017. The community provides resources such as firmware backups, dpID mappings, and autoexec.bat configuration examples for TuyaMCU integration, enabling relay control, voltage display, and parameter settings like overvoltage and overcurrent protection. Additional observations highlight incomplete frequency parsing in OpenBK firmware and the absence of recovery time settings after protection trips. A hardware fault involving the U3211 power supply chip is also discussed, with datasheets and sourcing advice provided.
Summary generated by the language model.
ADVERTISEMENT