logo elektroda
logo elektroda
X
logo elektroda

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

crg1darkspr1te 14586 35
ADVERTISEMENT
  • 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.
    Tuya ATORCH AT4P(WP/BW) Smartlife Energy monitor (BK7231N) (C3BS) (CH573F) (BL0924)Screenshot...t Life.jpg Download (186.36 kB) AT4PBW
    Tuya ATORCH AT4P(WP/BW) Smartlife Energy monitor (BK7231N) (C3BS) (CH573F) (BL0924)Screenshot...t Life.jpg Download (241.85 kB) 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 
    

    Cool? Ranking DIY
    About Author
    crg1darkspr1te
    Level 8  
    Offline 
    crg1darkspr1te wrote 22 posts with rating 12, helped 2 times. Been with us since 2022 year.
  • ADVERTISEMENT
  • #2 20335942
    p.kaczmarek2
    Moderator Smart Home
    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 type that contained multiple measurement results and I had to add support for that per user request.
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20336287
    crg1darkspr1te
    Level 8  
    p.kaczmarek2 wrote:
    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 type that contained multiple measurement results and I had to add support for that per user request.

    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 for other devices I did confirm with set loads and power measuring tech, they are within 1v~
    I do have a dump for the cloudcutter people but forgot to sanitize my ssid etc , is there a good guide for that ?
    also additional code
    configuration.yaml for basic feedback
    
    mqtt:
      sensor:
        - unique_id: "Phase One Current"
          name: 'AT4PWP Current'
          state_topic: 'obk04A00E72/4/get'
          unit_of_measurement: 'A'
          value_template: '{{ (value | int)/1000 }}'
        - unique_id: "Phase One Voltage "
          name: 'AT4PWP Voltage'
          state_topic: 'obk04A00E72/2/get'
          unit_of_measurement: 'V'
          value_template: '{{ (value | int)/100 }}'
        - unique_id: "Phase One Power"
          name: 'AT4PWP Power'
          state_topic: 'obk04A00E72/3/get'
          unit_of_measurement: 'W'
          device_class: "power"
          value_template: '{{ (value | int)/100 }}'   
        - unique_id: "Phase One Factor"
          name: 'AT4PWP P/Factor'
          state_topic: 'obk04A00E72/8/get'
          unit_of_measurement: 'pF'
          value_template: '{{ (value | int)/100 }}'
        - unique_id: "Phase One Frequency"
          name: 'AT4PWP Frequency'
          state_topic: 'obk04A00E72/5/get'
          unit_of_measurement: 'Hz'
          value_template: '{{ (value | int)/100 }}'      
      switch:
       - unique_id: "Phase One Operation"
         name: "AT4PWP Relay"
         state_topic: "obk04A00E72/1/get"
         command_topic: "obk04A00E72/1/set"
         qos: 1
         payload_on: 1
         payload_off: 0
         retain: true
    



    Tuya ATORCH AT4P(WP/BW) Smartlife Energy monitor (BK7231N) (C3BS) (CH573F) (BL0924)
  • #4 20339157
    crg1darkspr1te
    Level 8  
    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": {
    		"uuid": "104d88e1258f888b",
    		"psk_key": "P7O982s68Cy1drfbqUwtbcWhk5IJim8MJCOC9",
    		"auth_key": "FQTAn7PvPJXUJEfqhNM4Jv5euG4cE1cq",
    		"ap_ssid": "SmartLife",
    		"ap_passwd": null,
    		"country_code": "CN",
    		"bt_mac": null,
    		"bt_hid": null,
    		"prod_test": false,
    		"fac_pin": "gaylfs73ckmgqylk"
    	},
    	"baud_cfg": {
    		"baud": 115200
    	},
    	"tls_ca_cnt": 0,
    	"timer_arr": {
    		"lastFetchTime": 0,
    		"cnt": 0
    	},
    	"gw_di": {
    		"abi": 0,
    		"id": "fb1c3da2a0e617c161d1sa",
    		"swv": "2.1.6",
    		"bv": "40.00",
    		"pv": "2.2",
    		"lpv": "3.4",
    		"pk": "tjtigg991kvoqqiq",
    		"firmk": "key98r5jq9qqeaxe",
    		"cadv": "1.0.5",
    		"cdv": "1.0.0",
    		"dev_swv": "1.0.0",
    		"s_id": "000004oqga",
    		"dtp": 9,
    		"sync": 0,
    		"attr_num": 1,
    		"mst_tp_0": 9,
    		"mst_ver_0": "1.0.4",
    		"mst_tp_1": 0,
    		"mst_ver_1": null,
    		"mst_tp_2": 0,
    		"mst_ver_2": null,
    		"mst_tp_3": 0,
    		"mst_ver_3": null
    	},
    	"gw_wsm": {
    		"nc_tp": 9,
    		"ssid": "c3Noc22s",
    		"passwd": "c3RlcGNzH2hdb2w=",
    		"md": 0,
    		"random": 0,
    		"wfb64": 1,
    		"stat": 2,
    		"token": "cyRRrZDH",
    		"region": "EU",
    		"reg_key": "4eJR",
    		"dns_prio": 0
    	},
    	"is_stride": 0,
    	"000004poga": [
    		{
    			"type": "obj",
    			"mode": "rw",
    			"property": {
    				"type": "bool"
    			},
    			"id": 1
    		},
    		{
    			"type": "obj",
    			"mode": "rw",
    			"property": {
    				"min": 0,
    				"max": 360000,
    				"scale": 0,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 9
    		},
    		{
    			"trigger": "direct",
    			"type": "obj",
    			"mode": "rw",
    			"property": {
    				"min": 0,
    				"max": 5000000,
    				"scale": 2,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 17
    		},
    		{
    			"type": "obj",
    			"mode": "ro",
    			"property": {
    				"min": 0,
    				"max": 120000,
    				"scale": 3,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 18
    		},
    		{
    			"type": "obj",
    			"mode": "ro",
    			"property": {
    				"min": 0,
    				"max": 2800000,
    				"scale": 2,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 19
    		},
    		{
    			"type": "obj",
    			"mode": "ro",
    			"property": {
    				"min": 0,
    				"max": 30000,
    				"scale": 2,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 20
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"min": 0,
    				"max": 99999,
    				"scale": 2,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 101,
    			"type": "obj"
    		},
    		{
    			"mode": "ro",
    			"property": {
    				"min": 0,
    				"max": 50000000,
    				"scale": 3,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 102,
    			"type": "obj"
    		},
    		{
    			"trigger": "direct",
    			"type": "obj",
    			"mode": "ro",
    			"property": {
    				"min": 0,
    				"max": 5000000,
    				"scale": 2,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 103
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"min": 1,
    				"max": 2750,
    				"scale": 1,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 104,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"min": 1,
    				"max": 1000,
    				"scale": 1,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 105,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"min": 1,
    				"max": 27500,
    				"scale": 0,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 106,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"range": [
    					"chinese",
    					"english"
    				],
    				"type": "enum"
    			},
    			"id": 107,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"min": 1,
    				"max": 9,
    				"scale": 0,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 108,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"min": 0,
    				"max": 9,
    				"scale": 0,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 109,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"min": 3,
    				"max": 99,
    				"scale": 0,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 110,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"type": "bool"
    			},
    			"id": 111,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"range": [
    					"controlled",
    					"normally_open"
    				],
    				"type": "enum"
    			},
    			"id": 112,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"type": "bool"
    			},
    			"id": 113,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"type": "bool"
    			},
    			"id": 114,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"type": "bool"
    			},
    			"id": 115,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"type": "bool"
    			},
    			"id": 116,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"range": [
    					"original",
    					"measurement"
    				],
    				"type": "enum"
    			},
    			"id": 117,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"range": [
    					"safety_protection",
    					"price_bill",
    					"big_data"
    				],
    				"type": "enum"
    			},
    			"id": 118,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"min": 1,
    				"max": 2650,
    				"scale": 1,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 119,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"type": "bool"
    			},
    			"id": 120,
    			"type": "obj"
    		},
    		{
    			"mode": "ro",
    			"property": {
    				"min": 0,
    				"max": 999999999,
    				"scale": 3,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 123,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"range": [
    					"off",
    					"ovp",
    					"ocp",
    					"opp",
    					"lvp",
    					"le"
    				],
    				"type": "enum"
    			},
    			"id": 132,
    			"type": "obj"
    		},
    		{
    			"mode": "ro",
    			"property": {
    				"min": 0,
    				"max": 100000,
    				"scale": 2,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 133,
    			"type": "obj"
    		},
    		{
    			"mode": "ro",
    			"property": {
    				"min": 0,
    				"max": 100,
    				"scale": 2,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 134,
    			"type": "obj"
    		},
    		{
    			"mode": "ro",
    			"property": {
    				"min": 0,
    				"max": 150,
    				"scale": 0,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 135,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"range": [
    					"single_rate",
    					"stair",
    					"peak_valley_stair"
    				],
    				"type": "enum"
    			},
    			"id": 136,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"min": 0,
    				"max": 99,
    				"scale": 0,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 137,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"range": [
    					"open",
    					"colse",
    					"memory"
    				],
    				"type": "enum"
    			},
    			"id": 138,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"type": "bool"
    			},
    			"id": 139,
    			"type": "obj"
    		},
    		{
    			"mode": "ro",
    			"property": {
    				"min": 0,
    				"max": 500000,
    				"scale": 2,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 140,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"type": "bool"
    			},
    			"id": 141,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"min": 0,
    				"max": 500000,
    				"scale": 2,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 142,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"min": 10,
    				"max": 500,
    				"scale": 0,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 143,
    			"type": "obj"
    		}
    	],
    	"wf_start_md": 3,
    	"gw_ai": {
    		"key": "e525223d51e167ed",
    		"lckey": "bfe2af5bce8a2e92",
    		"h_url": "http://a.tuyaeu.com/d.json",
    		"h_ip": "18.197.220.231",
    		"hs_url": null,
    		"hs_ip": null,
    		"hs_psk": "https://a3.tuyaeu.com/d.json",
    		"hs_psk_ip": "18.195.249.137",
    		"mqs_url": null,
    		"mqs_ip": null,
    		"mq_url": "m2.tuyaeu.com:1883",
    		"mq_ip": "52.58.249.45",
    		"ai_sp": null,
    		"ai_sp_ip": null,
    		"mq_psk": "m2.tuyaeu.com:8886",
    		"mq_psk_ip": "52.57.38.165",
    		"lp_url": "baal.tuyaeu.com",
    		"lp_ip": "18.193.97.90",
    		"time_z": "+02:00",
    		"s_time_z": "[]",
    		"wx_app_id": null,
    		"wx_uuid": null,
    		"dy_tls_m": 2,
    		"cloud_cap": 1025,
    		"psk21_key": null
    	},
    	"ble_beaconkey": "CF54EAFC0639362C66CE9CCA3490B374",
    	"astro_timer": {
    		"timestamp": 1670574913,
    		"index": 0
    	},
    	"em_sys_env": "bk7231n",
    	"mf_test_close": true
    }
    

    I've confirmed that the other two devices i have that have different firmware features have different info,
    will paste when am done working on that device (note: they are identical in design/hw but differ in features by software only)


    darkspr1te

    Added after 3 [minutes]:

    this is the same device but software different (AT4PBW)

    
    {
    	"gw_bi": {
    		"uuid": "9b4d31895df5f9c3",
    		"psk_key": "buHJ4QaPGYqooFOI7FqZtMbZNcAhUTe9DaPPq",
    		"auth_key": "AXa0EfeDBQQszjllgwLXitUFIJQ4AviQ",
    		"ap_ssid": "SmartLife",
    		"ap_passwd": null,
    		"country_code": "CN",
    		"bt_mac": null,
    		"bt_hid": null,
    		"prod_test": false,
    		"fac_pin": "biylfs73ckmgqyk1"
    	},
    	"baud_cfg": {
    		"baud": 9600
    	},
    	"tls_ca_cnt": 0,
    	"timer_arr": {
    		"lastFetchTime": 0,
    		"cnt": 0
    	},
    	"gw_di": {
    		"abi": 0,
    		"id": "drr13d10d6f3a4064dmvkf",
    		"swv": "2.1.6",
    		"bv": "40.00",
    		"pv": "2.2",
    		"lpv": "3.4",
    		"pk": "2gieccf4eofewusc",
    		"firmk": "key83r5jq9qqeaxt",
    		"cadv": "1.0.5",
    		"cdv": "1.0.0",
    		"dev_swv": "1.0.5",
    		"s_id": "000004but2",
    		"dtp": 9,
    		"sync": 0,
    		"attr_num": 1,
    		"mst_tp_0": 9,
    		"mst_ver_0": "1.0.5",
    		"mst_tp_1": 0,
    		"mst_ver_1": null,
    		"mst_tp_2": 0,
    		"mst_ver_2": null,
    		"mst_tp_3": 0,
    		"mst_ver_3": null
    	},
    	"gw_wsm": {
    		"nc_tp": 9,
    		"ssid": "c2Nob29s",
    		"passwd": "c2RlcRHzY2hvb2w=",
    		"md": 0,
    		"random": 0,
    		"wfb64": 1,
    		"stat": 2,
    		"token": "fxOhN766",
    		"region": "EU",
    		"reg_key": "35WP",
    		"dns_prio": 0
    	},
    	"is_stride": 0,
    	"000004but2": [
    		{
    			"mode": "rw",
    			"property": {
    				"min": 0,
    				"max": 99999999,
    				"scale": 2,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 1,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"id": 6,
    			"type": "raw"
    		},
    		{
    			"mode": "ro",
    			"property": {
    				"type": "bitmap",
    				"maxlen": 13
    			},
    			"id": 10,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"type": "bool"
    			},
    			"id": 12,
    			"type": "obj"
    		},
    		{
    			"type": "obj",
    			"mode": "ro",
    			"property": {
    				"min": 0,
    				"max": 500000,
    				"scale": 2,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 13
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"type": "bool"
    			},
    			"id": 14,
    			"type": "obj"
    		},
    		{
    			"type": "obj",
    			"mode": "rw",
    			"property": {
    				"min": 0,
    				"max": 500000,
    				"scale": 2,
    				"step": 1,
    				"type": "value"
    			},
    			"id": 15
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"type": "bool"
    			},
    			"id": 16,
    			"type": "obj"
    		},
    		{
    			"mode": "rw",
    			"id": 17,
    			"type": "raw"
    		},
    		{
    			"mode": "rw",
    			"property": {
    				"type": "bool"
    			},
    			"id": 20,
    			"type": "obj"
    		},
    		{
    			"mode": "ro",
    			"id": 29,
    			"type": "raw"
    		}
    	],
    	"ble_beaconkey": "CF54EAFC0639362C66CE9CCA3490B374",
    	"wf_start_md": 3,
    	"astro_timer": {
    		"timestamp": 1671201577,
    		"index": 0
    	},
    	"gw_ai": {
    		"key": "9c8c88640762b14a",
    		"lckey": "27652c4b09be9aec",
    		"h_url": "http://a.tuyaeu.com/d.json",
    		"h_ip": "35.158.200.238",
    		"hs_url": null,
    		"hs_ip": null,
    		"hs_psk": "https://a3.tuyaeu.com/d.json",
    		"hs_psk_ip": "18.195.249.137",
    		"mqs_url": null,
    		"mqs_ip": null,
    		"mq_url": "m2.tuyaeu.com:1883",
    		"mq_ip": "52.57.38.165",
    		"ai_sp": null,
    		"ai_sp_ip": null,
    		"mq_psk": "m2.tuyaeu.com:8886",
    		"mq_psk_ip": "52.58.249.45",
    		"lp_url": "baal.tuyaeu.com",
    		"lp_ip": "18.193.97.90",
    		"time_z": "+02:00",
    		"s_time_z": "[]",
    		"wx_app_id": null,
    		"wx_uuid": null,
    		"dy_tls_m": 2,
    		"cloud_cap": 1025,
    		"psk21_key": null
    	},
    	"mf_test_close": true,
    	"em_sys_env": "bk7231n"
    }
    
  • #5 20340532
    crg1darkspr1te
    Level 8  
    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 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 24 00 00 26 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 36 (Unknown) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 36
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    



    it currently only reports one dpId of 6 but randomly it will report others
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0A 05 00 01 00 1E 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 10, dataType 5-DP_TYPE_BITMAP and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 06 00 00 08 00 00 00 00 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 6, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0C 01 00 01 00 1C 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 12, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0D 02 00 04 00 00 C3 50 37 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 13, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 50000
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 14 11 00 00 10 01 01 00 3C 03 01 00 F5 04 01 00 B4 00 00 00 1E 54 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: discarding packet bad expected checksum, expected 84 and got checksum 76
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 14 11 00 00 10 01 01 00 3C 03 01 00 F5 04 01 00 B4 08 00 00 1E 54 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 27 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 16 data bytes
    Info:MAIN:Time 121, idle 480164/s, free 76408, MQTT 0(7), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    


    i am currenlty trying to get openbk to build on my system but i have a lot of installing to do and internet speed here is aweful.

    darkspr1te
  • #6 20340686
    p.kaczmarek2
    Moderator Smart Home
    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: 55 AA 03 24 00 00 26 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 36 (Unknown) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 36
    

    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    

    Those commands are not known to me. I haven't seen them in case of other devices.
    55 AA 03 24 00 00 26 - 0x24 type with 00 00 len (no payload)
    55 AA 03 34 00 01 03 3A - 0x34 type with 00 01 len and 0x03 payload byte

    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 14 11 00 00 10 01 01 00 3C 03 01 00 F5 04 01 00 B4 08 00 00 1E 54 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 27 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 16 data bytes
    

    This looks like a raw measurements results compound packet.
    55 AA 03 07 00 14 11 00 00 10 01 01 00 3C 03 01 00 F5 04 01 00 B4 08 00 00 1E 54
    Raw data:
    V=01 01 00 3C 03 01 00 F5 04 01 00 B4 08 00 00 1E
    One could try guessing which bytes are voltage, current, etc, but without knowing which values to expect, it might not be reliable... would you be able to provide real measurement results and another packet to compare?
    Helpful post? Buy me a coffee.
  • #7 20340742
    crg1darkspr1te
    Level 8  
    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 (RX of tuyaMCU)
    I then went and changed current, over voltage, low voltage and then expense cutoff and then finally switched off the device.
    I will also study it as soon as i can get a working dev env going, i recently reinstalled and having a poor time re-building my various compilers etc .

    darkspr1te
  • ADVERTISEMENT
  • #8 20340901
    p.kaczmarek2
    Moderator Smart Home
    Any more information on those captures? Current voltage, power, etc?

    Lots of data here
    Tuya ATORCH AT4P(WP/BW) Smartlife Energy monitor (BK7231N) (C3BS) (CH573F) (BL0924)

    Some of packets looks like custom data:
    Tuya ATORCH AT4P(WP/BW) Smartlife Energy monitor (BK7231N) (C3BS) (CH573F) (BL0924)
    Tuya ATORCH AT4P(WP/BW) Smartlife Energy monitor (BK7231N) (C3BS) (CH573F) (BL0924)

    Those two compound packets might contain measurement data but I don't need what to look for:
    Tuya ATORCH AT4P(WP/BW) Smartlife Energy monitor (BK7231N) (C3BS) (CH573F) (BL0924)
    I would need to know:
    - your grid voltage
    - how looks like the sample with 60W bulb load and with 10W load

    More custom data:
    Tuya ATORCH AT4P(WP/BW) Smartlife Energy monitor (BK7231N) (C3BS) (CH573F) (BL0924)
    In this custom hex data, I can see ASCII string references like w.temp.0, w.pm25.0, w.aqi.0, w.humidity.0
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #9 20341735
    crg1darkspr1te
    Level 8  
    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 have massive amount of legacy code that does not work on newer esp32/stm32 and other devices i play with i was getting overloaded with downloads of older compilers and such, both in my vm's and my actual linux box (cant cache https :-/ )
    next step is quickly make a isolated 220v psu and opto isolated serial adapter as both my current ones are in use elsewhere.
    side note, setting up a esp32 for serial RX by Two so i can record device on live power as i wont risk my desktop via a ftdi adapter , rather i use a serial- wifi adapter to make the higher watt/volt tests , i dont have much luck not blowing stuff up.


    darkspr1te
  • #10 20341854
    p.kaczmarek2
    Moderator Smart Home
    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.
    Helpful post? Buy me a coffee.
  • #11 20342236
    crg1darkspr1te
    Level 8  
    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
    
    Debug:CMD:cmd [tuyaMcu_sendQueryState]
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=37
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 7 (still set to 1) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0A 05 00 01 00 1E 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 10, dataType 5-DP_TYPE_BITMAP and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 3 (still set to 0) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 06 00 00 08 00 00 00 00 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 6, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0C 01 00 01 00 1C 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 12, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 4 (still set to 0) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0D 02 00 04 00 00 C3 50 37 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 13, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 50000
    Info:GEN:No change in channel 5 (still set to 50000) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 14 11 00 00 10 01 01 00 3C 03 01 00 F5 04 01 00 B4 08 00 00 1E 54 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 27 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 16 data bytes
    Info:MAIN:Time 290, idle 180984/s, free 77384, MQTT 0(18), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=55
    Info:MAIN:Time 471, idle 177359/s, free 77384, MQTT 0(29), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:API:POST to api/cmnd
    Debug:CMD:cmd [tuyaMcu_sendQueryState]
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=56
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 10 01 00 01 01 21 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 16, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 7 (still set to 1) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0A 05 00 01 00 1E 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 10, dataType 5-DP_TYPE_BITMAP and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 3 (still set to 0) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 0C 06 00 00 08 00 00 00 00 00 00 00 00 23 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 19 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 6, dataType 0-DP_TYPE_RAW and 8 data bytes
    Info:MAIN:Time 472, idle 186702/s, free 77384, MQTT 0(29), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=57
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 05 0C 01 00 01 00 1C 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 12 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 12, dataType 1-DP_TYPE_BOOL and 1 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 1 byte: 
    Info:GEN:No change in channel 4 (still set to 0) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 08 0D 02 00 04 00 00 C3 50 37 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 15 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 13, dataType 2-DP_TYPE_VALUE and 4 data bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: raw data 4 int: 50000
    Info:GEN:No change in channel 5 (still set to 50000) - ignoring
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 14 11 00 00 10 01 01 00 3C 03 01 00 F5 04 01 00 B4 08 00 00 1E 54 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 27 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 16 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 14 11 00 00 10 01 01 00 3C 03 01 00 F5 04 01 00 B4 08 00 00 1E 54 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 27 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 16 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 24 00 00 26 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 36 (Unknown) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: (test for TH06 calendar) received 0x24, so sending back time
    Info:TuyaMCU:MCU time to set: 1671439142
    Info:TuyaMCU:ptime ->gmtime => tm_hour: 8
    Info:TuyaMCU:ptime ->gmtime => tm_min: 39
    Info:MAIN:Time 473, idle 170289/s, free 77384, MQTT 0(29), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=57
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 00 00 01 01 04 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 0 (Hearbeat) with 8 bytes
    Info:MAIN:Time 474, idle 153572/s, free 68776, MQTT 0(29), bWifi 1, secondsWithNoPing -1, socks 3/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=58
    Info:MAIN:Time 475, idle 178193/s, free 77384, MQTT 0(29), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=59
    Info:MAIN:Time 476, idle 185501/s, free 77384, MQTT 0(29), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    ExtraDebug:TuyaMCU:TuyaMCU heartbeat_valid = 1, product_information_valid=1, self_processing_mode = 1, wifi_state_valid = 1, wifi_state_timer=0
    Info:MAIN:Time 477, idle 182957/s, free 77384, MQTT 0(29), bWifi 1, secondsWithNoPing -1, socks 2/38
    Debug:MQTT:MQTT deduper sent 0, culled duplicates 0, culled too fast 0
    
    

    at the time this was logged the voltage was 228v/29watts/0.13amps


    when i was on the bk firmware before it did pass the wifi screen and would display "some" dpid's , however to get it to do that i had to flash the firmware from the other device (at4pwp/1.04)

    Added after 2 [minutes]:

    and at time am getting the other commands
    
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 1C 00 00 1E 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 28 (SetTime) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: received TUYA_CMD_SET_TIME, so sending back time
    Info:TuyaMCU:MCU time to set: 1671439219
    Info:TuyaMCU:ptime ->gmtime => tm_hour: 8
    Info:TuyaMCU:ptime ->gmtime => tm_min: 40
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 1C 00 00 1E 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 28 (SetTime) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: received TUYA_CMD_SET_TIME, so sending back time
    Info:TuyaMCU:MCU time to set: 1671439219
    Info:TuyaMCU:ptime ->gmtime => tm_hour: 8
    Info:TuyaMCU:ptime ->gmtime => tm_min: 40
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 1C 00 00 1E 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 28 (SetTime) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: received TUYA_CMD_SET_TIME, so sending back time
    Info:TuyaMCU:MCU time to set: 1671439219
    Info:TuyaMCU:ptime ->gmtime => tm_hour: 8
    Info:TuyaMCU:ptime ->gmtime => tm_min: 40
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 1C 00 00 1E 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 28 (SetTime) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: received TUYA_CMD_SET_TIME, so sending back time
    Info:TuyaMCU:MCU time to set: 1671439219
    Info:TuyaMCU:ptime ->gmtime => tm_hour: 8
    Info:TuyaMCU:ptime ->gmtime => tm_min: 40
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 1C 00 00 1E 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 28 (SetTime) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: received TUYA_CMD_SET_TIME, so sending back time
    Info:TuyaMCU:MCU time to set: 1671439219
    Info:TuyaMCU:ptime ->gmtime => tm_hour: 8
    Info:TuyaMCU:ptime ->gmtime => tm_min: 40
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 1C 00 00 1E 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 28 (SetTime) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: received TUYA_CMD_SET_TIME, so sending back time
    Info:TuyaMCU:MCU time to set: 1671439219
    Info:TuyaMCU:ptime ->gmtime => tm_hour: 8
    Info:TuyaMCU:ptime ->gmtime => tm_min: 40
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 34 00 01 03 3A 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 52 (Unknown) with 8 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: unhandled type 52
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 1C 00 00 1E 
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 28 (SetTime) with 7 bytes
    Info:TuyaMCU:TuyaMCU_ProcessIncoming: received TUYA_CMD_SET_TIME, so sending back time
    Info:TuyaMCU:MCU time to set: 1671439219
    Info:TuyaMCU:ptime ->gmtime => tm_hour: 8
    Info:TuyaMCU:ptime ->gmtime => tm_min: 40
    Info:MAIN:Time 550, idle 186128/s, free 77384, MQTT 0(34), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.10.162 gate=192.168.10.1 mask=255.255.255.0 mac=a0:92:08:c0:18:cc 
    Info:GEN:sta: 1, softap: 0, b/g/n
    


    Added after 2 [minutes]:

    ok some small progress my side,

    
    //ch 7 (dpid 16) power on/off
    linkTuyaMCUOutputToChannel  16 bool 7
    


    Added after 3 [hours] 21 [minutes]:

    ok ive worked out the following from dpId 17
    
    Info:TuyaMCU:TuyaMCU_ProcessIncoming[ver=3]: processing command 7 (State) with 27 bytes
    Info:TuyaMCU:TuyaMCU_ParseStateMessage: processing dpId 17, dataType 0-DP_TYPE_RAW and 16 data bytes
    Info:TuyaMCU:TUYAMCU received: 55 AA 03 07 00 14 11 00 00 10 01 01 00 3C 03 01 00 F5 04 01 00 B4 08 00 00 1E 54
    


    14th bit overccurrent amps (0x3c here) Dec 60Amps
    17/18 overvoltage (0x00 0xf5) dec 245V
    21/22 lowvoltage ( 0xb4 before decimal 0x08 after decimal) Dec 180.08 V

    when i change them in the menus they change here.

    darkspr1te
  • #12 20343991
    crg1darkspr1te
    Level 8  
    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 listed in the openbk code
    
    #define TUYA_CMD_HEARTBEAT     0x00
    #define TUYA_CMD_QUERY_PRODUCT 0x01
    #define TUYA_CMD_MCU_CONF      0x02
    #define TUYA_CMD_WIFI_STATE    0x03
    #define TUYA_CMD_WIFI_RESET    0x04
    #define TUYA_CMD_WIFI_SELECT   0x05
    #define TUYA_CMD_SET_DP        0x06
    #define TUYA_CMD_STATE         0x07
    #define TUYA_CMD_QUERY_STATE   0x08
    #define TUYA_CMD_SET_TIME      0x1C
    #define TUYA_CMD_SET_RSSI      0x24
    

    those are whats listed in openbk but the tuya docs also mention
    
    ver - cmd - function
    0x00 0x36 Rf commands (rf433 remotes) 
    0x00 0x22 Report status (sync)
    0x00 0x34 Report status (record-type)
    0x03 0x0a Update MCU (dangerous) 
    0x03 0x0c Get system time in GMT
    0x03 0x0e Test Wi-Fi functionality (scanning)
    0x03 0x0f Get module’s memory (wifi module)
    0x03 0x20 (Optional) Enable weather services
    0x03 0x34 Proactively request weather data 
    0x03 0x25 (Optional) Disable heartbeats
    0x03 0x2a (Optional) Pairing via serial port
    0x03 0x2b Get the current network status
    0x03 0x2c Test Wi-Fi functionality (connection)
    0x03 0x36 Report and send data of extended DPs
    

    There are more listed that deal with voice, fan control and more. Am going to look at adding CMD 0x36 functions and the test wifi functions as my tuyaMCU uses those features I think,
    I've finally got my dev environment up but alas we are now into the power shedding period of our year and most days i wont have time/power to do improvements.

    i did note that the docs did not mention command 0x52 (8 bytes) so that one is still unknown to me

    darkspr1te
  • #13 20344925
    p.kaczmarek2
    Moderator Smart Home
    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 bytes of data

    The beginning should be obvious:
    55AA 00 21 0040
    HDER VV TP LENG
    0040 length = 64 bytes length + header (2) + version (1) + type (1) + len field (2) + checksum (1) = 71 bytes, it matches, then:
    01 08
    772E74656D702E300 – NULL Terminated ASCII “w.temp.0”
    0040 00000 16 0C
    772E68756D69646974792E300 – NULL Terminated ASCII “w.humidity.0”
    0040 00000 46 08
    772E706D32352E300 – NULL Terminated ASCII “w.pm25.0”
    0040 00000 26 07
    772E6171692E300 – NULL Terminated ASCII “w.aqi.0”
    0040 00000 6C 30

    I don't know why 0040 repeats every time for each variable. Also, what is 0x46 0x08 for humidity? 26 07 for pm25 (air quality guideline?) and 6C 30 for aqi?
    Helpful post? Buy me a coffee.
  • #14 20345544
    crg1darkspr1te
    Level 8  
    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
    Quote:

    (Optional) Enable weather services
    Enable the module to get the weather data.

    The MCU sends the following command.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x03
    Command 1 0x20
    Data length 2 N((L+K)+(L+K)…)
    Data n L: consumes 1 byte and indicates the length of K.
    K: indicates the name of the request parameter.
    Example:
    L: 0x06, K: w.temp.
    L: 0x06, K: w.pm25.
    L: 0x0a, K: w.humidity.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
    For more information about the weather data, see Weather Service.
    For example, if the MCU requests w.temp and w.pm25, it sends 55 aa 03 20 00 0e 06 77 2e 74 65 6d 70 06 77 2e 70 6d 32 35 80.

    The module returns the following command.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x00
    Command 1 0x20
    Data length 2 0x0002
    Data 2 Data[0]:
    0x00: failure.
    0x01: success.
    Data[1]:
    0x00: no error.
    0x01: invalid data format.
    0x02: exception.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
    For example, 55 aa 00 20 00 02 01 00 22

    (Optional) Send weather data
    The module will send the weather data immediately as the weather service is enabled and then sends data every 30 minutes.

    The module sends the following command.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x00
    Command 1 0x21
    Data length 2 N((LKTLV)+(LKTLV)+…)
    Data Data
    0x00: indicates a failure.
    0x01: indicates an unauthorized parameter service. Check whether you have subscribed to specific weather services or whether you have enabled the weather services through the 0x20 command.
    0x01: indicates a success.
    L: the length of the parameter name.
    K: the name of the parameter.
    T: 0x00 indicates an integer and 0x01 indicates a string.
    L: the length of the field name.
    V: the value of the field.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
    The MCU returns the following command.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x03
    Command 1 0x21
    Data length 2 0x0000
    Data 0 None
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
    If a request contains two request parameters such as w.temp and w.pm25, only w.temp returns a value, you need to check whether the request parameter name is correct.

    For more information about the weather data, see Weather Service.

    For example, if the weather data is w.humidity:69, w.temp:32, and w.pm25:10, the module will send the following command.
    55 aa 00 21 00 30 01 0a 77 2e 68 75 6d 69 64 69 74 79 00 04 00 00 00 45 06 77 2e 74 65 6d 70 00 04 00 00 00 20 06 77 2e 70 6d 32 35 00 04 00 00 00 10 1e 5c

    Proactively request weather data
    Besides passively receiving weather data from the module, the MCU can proactively request weather data using this command.
    The minimum request interval is one minute. If the MCU sends multiple requests within one minute, the request is only processed once.
    The module only uses this command to confirm a request and sends weather data still through the command 0x21.
    The MCU sends the following command.

    Field Length Description
    Header 2 0x55aa
    Version 1 0x03
    Command 1 0x34
    Data length 2 0x0001
    Data 1 0x03 (subcommand)
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
    For example, 55 aa 03 34 00 01 03 3a

    The module returns the following command.

    Field Bytes Description
    Header 2 0x55aa
    Version 1 0x00
    Command 1 0x34
    Data length 2 0x0002
    Data 1 0x03 (subcommand)
    1
    0x00: success.
    0x01: failure.
    Checksum 1 Start from the header, add up all the bytes, and then divide the sum by 256 to get the remainder.
    For example, 55 aa 00 34 00 02 03 00 38



    this is found on the link i posted before
    https://developer.tuya.com/en/docs/iot/tuya-c...tle-24-Proactively%20request%20weather%20data
    " target="_blank" rel="nofollow noopener ugc" class="postlink inline" title="" >
    https://developer.tuya.com/en/docs/iot/tuya-c...tle-24-Proactively%20request%20weather%20data



    darkspr1te
  • #15 20345606
    p.kaczmarek2
    Moderator Smart Home
    I will try to add parsing of that data to OpenBeken later today.

    Will commit soon:
    Tuya ATORCH AT4P(WP/BW) Smartlife Energy monitor (BK7231N) (C3BS) (CH573F) (BL0924)
    Helpful post? Buy me a coffee.
  • #16 20347175
    crg1darkspr1te
    Level 8  
    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 + 4] << 24 | data[ofs + 5] << 16 | data[ofs + 6] << 8 | data[ofs + 7];
    			addLogAdv(LOG_INFO, LOG_FEATURE_TUYAMCU, "TuyaMCU_ParseStateMessage: raw data 4 int: %i\n", iVal);
    			// apply to channels
    			TuyaMCU_ApplyMapping(fnId, iVal);
    		}
    		//**new Code**
    		else if (sectorLen == 8) {
    			iVal = data[ofs + 4] << 8 | data[ofs + 5];
    			addLogAdv(LOG_INFO, LOG_FEATURE_TUYAMCU, "TuyaMCU_ParseStateMessage: raw data 8 int: %i\n", iVal);
    			// apply to channels
    		
                            TuyaMCU_ApplyMapping(fnId, iVal);
    			result = MQTT_PublishMain_StringInt("voltage", iVal);
    			// current
    			iVal = data[ofs + 7] << 8 | data[ofs + 8];
    
    			result = MQTT_PublishMain_StringInt("current", iVal);
    			// power
    	
    			iVal = (data[ofs + 4] << 8 | data[ofs + 5]) * (data[ofs + 7] << 8 | data[ofs + 8]);
    
    			result = MQTT_PublishMain_StringInt("power", iVal);
    
    		}
    		//**end of new code
    		else {
    			tuyaMCUMapping_t* mapping;
    
    			mapping = TuyaMCU_FindDefForID(fnId);
    
    			if (mapping != 0) {
    


    i am still learning this whole eco system so excuse poor coding and layout.

    this now at least allows me to read the data. sadly because the software is different it does not return as much info compared to the other unit which is disappointing. I have 3 more units on the way from the supplier who assures me they are all 3 the same mcu 1.04 model.
    I've looked into the possability of dumping the ch573 cpu but all indicators point to it erasing if you connect a programming cable. how ever my current 1.04 mcu has a update pending, I could man in middle attack the new update and then apply it to the other mcu's if it's not a feature killing firmware and drops all the data collecting ability the unit has.

    A couple of questions on the code base, the function void TuyaMCU_ParseQueryProductInformation(const byte* data, int len) , does it store the product ID so it can be accessed in code or it it only displayed in the logs ? if we store it we can then do model specific functions when we have a overlap in the command functions (something the tuya docs do mention).
    the CB3S module in my device also support BLE, are there any BLE function in OpenBk yet ?


    darkspr1te
  • #17 20347227
    p.kaczmarek2
    Moderator Smart Home
    This is not the correct way to do that.
    Please see this commit:
    https://github.com/openshwprojects/OpenBK7231...mmit/5a03649f7261413fba0d2c0794894c347381a5a8

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

    This must be configurable and must set channels so we can do automation and display things on GUI.
    I can add a packet support for you, based on your code.

    
    this now at least allows me to read the data. sadly because the software is different it does not return as much info compared to the other unit which is disappointing. 
    

    Maybe OpenBeken needs to send more requests to the TuyaMCU so it replies with more info? We can try adding it.

    
     if we store it we can then do model specific functions when we have a overlap in the command functions (something the tuya docs do mention).
    

    There might be multiple device IDs per same functionality. The assumption is that user defines the TuyaMCU in the autoexec.bat, so through console commands.

    
    the CB3S module in my device also support BLE, are there any BLE function in OpenBk yet ?
    

    No work has been done on BLE yet, but it's in the SDK.
    Helpful post? Buy me a coffee.
  • #18 20814148
    aerzk1971
    Level 2  
    @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 I stayed on wifi is the same thing! I think the wifi system is faulty
  • #19 20814149
    ElektrodaBot
    AI OpenAI ChatGPT4
    aerzk1971 wrote:
    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 I stayed on wifi is the same thing! I think the wifi system is faulty
    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 to zero, have you tried completely power cycling the router? Unplug it from the power source, wait about a minute, and then plug it back in.

    2. Check for Damage: Inspect the router for any visible signs of damage. Sometimes a power surge can cause physical damage to the components.

    3. LED Status: If the green light that usually indicates normal operation isn't coming on, it could mean that the device isn't booting up correctly. Are there any other lights on the device that are lit or blinking?

    4. Connectivity Check: Try connecting to the router using a wired connection (Ethernet cable) to see if it's just the wireless that's affected.

    5. Router's Web Interface: If the wired connection works, access the router's web interface to check the wireless settings haven't been reset or changed. Sometimes a power outage can reset the router to its default settings.

    6. Firmware: If you can access the router's interface, check for firmware updates. An update might resolve the issue if the firmware was corrupted during the power outage.

    7. Surge Protector: In the future, using a surge protector can help protect your electronics from damage caused by power surges.

    If none of these steps work, it's possible the WiFi components inside the router have been damaged and the router will need to be replaced. But before we conclude, can you tell me what is the make and model of your WiFi router, and are there any other abnormalities or changes you've noticed since the power outage?
    You can call me in any topic by writing @ElektrodaBot. Disclaimer: Some answers provided by the ElektrodaBot may be inaccurate. Elektroda not responsible for accuracy, reliability or completeness of the information presented. All ElektrodaBot responses should be verified by the user. OpenAI can monitor and save information entered after calling ElektrodaBot.
  • #20 20814166
    aerzk1971
    Level 2  
    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]:

    AT4P HD smart display with IoT monitor showing Waiting network... message with a QR code for app download. Electrical meter display showing readings: 241.48 V, 0.190 A, 26.04 W, and 3.40369 kWh. User manual cover for AT4P HD Color Screen Digital Display Rail Meter. Close-up of an electronic circuit board with a CB3S module and colored wires. >>20814149
  • #21 20814167
    ElektrodaBot
    AI OpenAI ChatGPT4
    aerzk1971 wrote:
    Based on the information provided and the images you've shared, it appears you're dealing with a smart meter device that has a WiFi connectivity feature for monitoring and control purposes, specifically an AT4P HD Color Screen Digital Display Smart Rail Meter.

    From the images, it's clear that the device is powering up correctly and displaying voltage, current, and power readings, which suggests that the primary functions of the meter are operational. However, the WiFi feature seems to be malfunctioning since the device is stuck on "Waiting network..." and the expected green WiFi indicator lights are not on.

    Here are some steps you can take to attempt to resolve the issue:

    1. Restart the Device: If you haven't already, power cycle the device by turning it off, waiting a few moments, and then turning it back on. This can sometimes resolve temporary glitches.

    2. Inspect the WiFi Module: The last photo you've shared shows a WiFi module with a QR code on it. Make sure that this module is properly seated in its connector on the mainboard. If it appears loose or disconnected, carefully reseat it to ensure a good connection.

    3. Check for Physical Damage: Look for any signs of physical damage to the WiFi module or other components on the board that may have been caused by a power surge.

    4. Manual and Configuration: Refer to the user manual for any WiFi setup instructions or troubleshooting steps. There might be a specific procedure to reset the WiFi module or reconfigure it.

    5. Device Interface: If the smart meter has a user interface accessible via a web browser (either wired or through another network connection method), log in and check the network settings. Ensure that the correct WiFi network details are entered and that the device is not blocked by the router.

    6. Contact Support: If the issue persists and you cannot resolve it using the user manual or by reseating the module, you may need to contact the manufacturer or customer support for further assistance. They might provide firmware updates or additional troubleshooting steps.

    7. Consider Replacement: If the WiFi module is indeed faulty and it's not user-replaceable, or if the device is still under warranty, consider contacting the supplier or manufacturer for a replacement.

    Before proceeding with any internal inspections or adjustments, ensure the device is completely powered off and disconnected from any power source to avoid electric shock or further damage to the equipment. If you're not comfortable with these steps or if they are beyond your expertise, it's advisable to seek professional help.
    You can call me in any topic by writing @ElektrodaBot. Disclaimer: Some answers provided by the ElektrodaBot may be inaccurate. Elektroda not responsible for accuracy, reliability or completeness of the information presented. All ElektrodaBot responses should be verified by the user. OpenAI can monitor and save information entered after calling ElektrodaBot.
  • #22 20814301
    p.kaczmarek2
    Moderator Smart Home
    @aerzk1971 is your device flashed with OpenBeken or is it running Tuya firmware?
    Helpful post? Buy me a coffee.
  • #23 20815706
    crg1darkspr1te
    Level 8  
    >>20814166
    If you are using openbk firmware then the reset wifi via the menu does not work so to get the unit into AP mode to change settings you need to power of then on about five time. If you are using factory firmware then the BK firmware on the device has got currupt. I have 15 of these modules and at some point each one has got currupt. these unit only use the wifi module for just that, the tunya mcu on board does the buttons, screen, settings control. This so far has not shown any curruption on any unit.
    To fix the firmware you will have to de-solder bk board and flash using a uart adapter.

    if you have a original backup then flash that, if you want "un-touched" backup from one of these units i can provide but you will have to alter the mac address to match your original.


    darkspr1te
  • #24 21008516
    denveronly
    Level 2  
    Hello there.
    I recently brought 3 devices like on photo. It has a bit other model name A4PTW. It has same screen, size and specs. Has a temperature sensor. I brought it as a Thermostat in DIN rail. Menu in tuya looks like this
    App interface with temperature settings and power status.

    Have a few questions.

    1) Im a bit upset due to weak wifi signal on both 3 items i have. Wifi AP has strong signal, and is situated in 5 meters of direct sight. Im haveing random disconnections and connections every 1-2 minutes. Im thinking to Solder a Orange PI antenna to all units same as someone did for ESP. Is the Antenna wiring Okay? Will it work same on my chip?
    Close-up of an ESP chip with an antenna soldered to the PCB tracks.

    2) Im very exited about this project and thinking to flash the openbeken firmware and studying the possibilities. Does my model have support? i dont want to flash and have a cut version, without temp control or else.
  • #25 21008933
    p.kaczmarek2
    Moderator Smart Home
    Which device model do you have exactly, can you provide detailed photos from the inside? In worst case we can try adding support for your device together. They should be still TuyaMCU-based.

    I haven't tried connecting external antenna yet.
    Helpful post? Buy me a coffee.
  • #26 21031914
    Anonymous
    Level 1  
  • #28 21038497
    divadiow
    Level 34  
    wpa1 wrote:
    Is it possible to download firmware from this 1.0.9 via UART and upload it to other devices?


    Can't say I've ever seen any discussion about flashing factory firmware to other MCUs from within OBK. I did wonder about that when the Tuya app offered me an MCU upgrade in a similar device https://www.elektroda.com/rtvforum/topic4003739.html#20945733

    If I was already flashed to OBK I would have to go back to factory BK firmware first. I wouldn't even know there was an MCU upgrade unless someone posted about it somewhere either (or proactively flash to factory, pair with app, check for update).

    wpa1 wrote:
    Does this openbeken software support the display


    I don't think OBK supports any LCD displays, someone else will know better I'm sure. Anyway, won't the other chip on this device be driving the LCD? The display and menus on the other Atorch work as normal after flashing to OBK so I assumed the TuyaMCU was doing that side of things.
  • #29 21038629
    p.kaczmarek2
    Moderator Smart Home
    wpa1 wrote:

    Does this openbeken software support the display or does it only work on the esphome principle and you have to glue everything yourself?

    The device in the first post is using TuyaMCU. This means that the TuyaMCU is controlling the display, not the WiFI module itself.

    OpenBeken have a very good TuyaMCU support, so this kind of device should work good, but you need to know dpID meaning which are per-device, you can read more about TuyaMCU support here:
    TuyaMCU flashing, setup and configuration guide - configure dpIDs for Home Assistant

    Added after 56 [seconds]:

    @denveronly I still can't see much there, how is LCD connected? Is there MCU?
    Helpful post? Buy me a coffee.
  • #30 21094898
    duycaf
    Level 3  
    Hello.
    I also have a AT4P and I am not able to connect to it anymore.
    Does someone was able to fix it? From the datasheet of Cb3s I saw that pin 1 is rst(reset), can I connect this to pin 3 and reset connectivity?
    Many thanks!

Topic summary

The discussion revolves around the Tuya ATORCH AT4P(WP/BW) Smartlife Energy Monitor, focusing on the challenges and solutions related to its firmware and functionality. Users report varying software features across identical models, with some devices lacking certain functionalities despite having higher software versions. The conversation includes troubleshooting WiFi connectivity issues, firmware flashing, and the integration of OpenBeken firmware for enhanced control and monitoring capabilities. Users share insights on command structures, data parsing, and the importance of communication dumps for effective debugging. Additionally, there are discussions about potential hardware modifications, such as adding external antennas to improve WiFi signal strength.
Summary generated by the language model.
ADVERTISEMENT