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

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
Comments
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
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]
@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]
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]
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]