logo elektroda
logo elektroda
X
logo elektroda

Tuya ATORCH AT4P(WP/BW) Smartlife Energy monitor (BK7231N) (C3BS) (CH573F) (BL0924)

crg1darkspr1te 

Hi All,
I have started on getting OpenBK ready for this device ,
https://pt.aliexpress.com/item/1005004407477380.html?gatewayAdapt=glo2bra
It is a 100A wifi (disabled BT) energy monitor.
Internals pictures as follows
i total of 3 units each Identical on the outside, purchased as the same model and 2 of the 3 software wise have less features but higher software version.
Software AT4PWP V1.04 will show Power Factor, Voltage, history, current (A) ,load (W) , energy used kw/h , frequency, bill and cpu temp on client app and main screen.
Software AT 4PBW V1.05 will show Voltage, Load (W) and current with on/off history on client app but displayss all the above and humidity ? on the lcd. it also has exact same pcb and markings.
AT4PBW
AT4PWP
openbk autoexec.bat

startDriver TuyaMCU
startDriver NTP
tuyaMcu_setBaudRate 115200
setChannelType 1 toggle
setChannelType 2 Voltage_div10
setChannelType 3 Power
setChannelType 4 Current_div1000
setChannelType 5 Frequency_div100
setChannelType 6 ReadOnly
setChannelType 7 Temperature
setChannelType 8 ReadOnly
setChannelType 9 ReadOnly

//ch 1 (dpid 1) power relay control
linkTuyaMCUOutputToChannel 1 bool 1
//ch 2(dpid 20) voltage
linkTuyaMCUOutputToChannel  20 1 2
//ch 3(dpid 19) power watts
linkTuyaMCUOutputToChannel 19 1 3
//ch 4 (dpid 18)current Amps
linkTuyaMCUOutputToChannel 18 1 4
//ch 5 (dpid (133) frequency 
linkTuyaMCUOutputToChannel 133 1 5
//ch 6 (dpid  102) energy cost used
linkTuyaMCUOutputToChannel 102 1 6
// ch 7 (dpid 135) temp
linkTuyaMCUOutputToChannel 135 1 7
//ch 8 (dpid  134) power factor 
linkTuyaMCUOutputToChannel 134 raw 8
//ch 9 (dpid  123) energy consumed
linkTuyaMCUOutputToChannel 123 1 9


pinouts of the ch573

PB15 -> pin 3 of JP3
PB14 -> Pin 2 of JP3 -> Button 1
PB13 -> CB3S RXD1
PB12 -> CB3S TXD1
PB11 -> pin 4 of JP2 -> bt led
PB10 - > pin 3 of JP2 -> Button 3
PB7 -> bl0942 adc/energy monitor RX
PB4 -> bl0942 adc/energy monitor TX
PB23 -> bt uart tx Ac6328 (zh-jieli.com) -> pin 2  of JP4 (not fitted)
PB22 -> bt uart rx AC6328 -> pin 4 of JP4 (not fitted) 
PA4 -> Button 2
PA9 -> Relay control 

About Author
crg1darkspr1te wrote 22 posts with rating 12 , helped 2 times. Been with us since 2022 year.

Comments

p.kaczmarek2 15 Dec 2022 12:07

Very good job, did you figure dpIds yourself? From what I can see, there was no compound device-specific packet types? For example, this device: Hiking DDS238-2 Smart Meter had one custom packet... [Read more]

crg1darkspr1te 15 Dec 2022 16:23

The dplds were pulled from the logs once i figured that the baud rate had to be changed (many a time i fotgot to add that and assume wiring at fault, lmao) most stick to the listed ones for power/current/voltage/frequency... [Read more]

crg1darkspr1te 17 Dec 2022 12:01

I found more, this one passed my eyes but brain did not see, when i unpacked/decrypted the factory firmware i found a .json file with ID's in it that match this hardware { "gw_bi":... [Read more]

crg1darkspr1te 18 Dec 2022 08:40

So on the next device (type AT4PBW, Mcu ver 1.05) i am not getting any feedback at all, in the logs there are quite a few issues Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04... [Read more]

p.kaczmarek2 18 Dec 2022 10:35

Having a full communication dump from the original firmware can help a lot in such cases. It is easier to investigate when you know what's supposed to happen. Info:TuyaMCU:TUYAMCU received:... [Read more]

crg1darkspr1te 18 Dec 2022 11:17

Attached is a realterm hex dump of the device with factory firmware. I reset the device the recorded the provisioning from both the TX and RX of the signal , attached is capture(TX of tuyamcu) and capture2... [Read more]

p.kaczmarek2 18 Dec 2022 12:46

Any more information on those captures? Current voltage, power, etc? Lots of data here https://obrazki.elektroda.pl/5760334200_1671363689_thumb.jpg Some of packets looks like custom data: ... [Read more]

crg1darkspr1te 18 Dec 2022 20:15

Ok, I finally got openbk to build for the N device i have , lots of face palm moments my side getting build env up, I like to use platformio for my ide on win/linux and normally not a issue but as I also... [Read more]

p.kaczmarek2 18 Dec 2022 21:10

You don't need to do the capture via UART, you could launch OpenBeken and then do test with 60W bulb and 10W bulb and show me what OpenBeken receives, I think. [Read more]

crg1darkspr1te 19 Dec 2022 11:05

I have flash the lastest bin file but it seems the device wont go past the ez-pair screen (not accepting the ok from bk device? ) if i do the command tuyaMcu_sendQueryState i will get this in the logs... [Read more]

crg1darkspr1te 20 Dec 2022 07:52

So i did some more digging and found this https://developer.tuya.com/en/docs/iot/tuya-cloud-universal-serial-port-access-protocol And they mentioned the Commands in use, I noticed a few on there not... [Read more]

p.kaczmarek2 20 Dec 2022 18:35

0x21 also seems to be specific to this device. I am not sure about the structure of 0x21 packet yet. Sample whole packet: 55AA002100400108772E74656D702E300004000000160C772E68756D69646974792E3000040000004608772E706D32352E3000040000002607772E6171692E3000040000006C30 71... [Read more]

crg1darkspr1te 21 Dec 2022 07:14

The packet 0x21 is response to the command 55 aa 03 34 00 01 03 3a , proactively request weather data , and the breakdown of 0x21 is as follows this is found on the link i posted before ... [Read more]

p.kaczmarek2 21 Dec 2022 08:37

I will try to add parsing of that data to OpenBeken later today. Will commit soon: https://obrazki.elektroda.pl/1114962300_1671636492_thumb.jpg [Read more]

crg1darkspr1te 22 Dec 2022 09:30

I have been able now to read voltage/current from the device and then manually calculate power , here is my patch , drv_tuyaMCU.c else if (sectorLen == 4) { iVal = data[ofs +... [Read more]

p.kaczmarek2 22 Dec 2022 10:06

This is not the correct way to do that. Please see this commit: https://github.com/openshwprojects/OpenBK7231T_App/commit/5a03649f7261413fba0d2c0794894c347381a5a8 https://obrazki.elektroda.pl/7852314300_1671699832_thumb.jpg... [Read more]

aerzk1971 14 Nov 2023 01:01

@ElektrodaBot I have a wifi problem before it works well but after the last power outage the wifi does not work and the green light no longer lights up I tried all the parameters like setting to zero and... [Read more]

ElektrodaBot 14 Nov 2023 01:05

It definitely sounds like the power outage may have caused some damage to your WiFi equipment. Let's try to troubleshoot the issue step by step. 1. Power Cycle : Although you've mentioned setting things... [Read more]

aerzk1971 14 Nov 2023 02:05

the AT4P HD smart account. the problem everything works well overvoltage amperage cuts off at the request of people the red light comes on except the wifi and the two green lights Added after 1 [minutes]:... [Read more]