logo elektroda
logo elektroda
X
logo elektroda

[RTL87X0C] Tuya EP2 Smart Plug - how to find BL0937 power pins?

me_lon 504 5
ADVERTISEMENT
  • Seeking BL0937 power-measurement pin assignments

    #1 21948489
    me_lon
    Level 2  
    Posts: 4
    Rate: 1
    Hey there,
    i found some used Smartplugs, where EP2 is written on it. They worked with Smart Life / Tuya and only one had v.1.0.4, all the others have 1.0.7. I managed to flash OpenRTL87X0C via tuya-cloudcutter OTA to the 1.0.4 Plug, for the v1.0.7 ones there was no Exploit. And i had no luck in soldering those small pads. 

    [RTL87X0C] Tuya EP2 Smart Plug - how to find BL0937 power pins?[RTL87X0C] Tuya EP2 Smart Plug - how to find BL0937 power pins?
    [RTL87X0C] Tuya EP2 Smart Plug - how to find BL0937 power pins? [RTL87X0C] Tuya EP2 Smart Plug - how to find BL0937 power pins?

    So far i could get REL, Btn and 2 LEDs to work. But how do i find the proper Pins for PowerMeassurement?
    The driver loads fine, but all the values stay at 0. I tried several combinations for BL0973CF, SEL, CF1 and also dInput CH 0 on all the other Pins, with no signal in the logs. 
    Am i doing something completely wrong? 

    There was a moment when i got some power stats, WITHOUT any pins assigned. 

    
    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Full Device Name Here",
      "model": "enter short model name here",
      "chip": "RTL87X0C",
      "board": "TODO",
      "flags": "1024",
      "keywords": [
        "TODO",
        "TODO",
        "TODO"
      ],
      "pins": {
        "1": "Rel;1",
        "12": "Btn;1",
        "17": "LED_n;1",
        "18": "LED_n;2"
      },
      "command": "startDriver BL0937",
      "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }
    

    AI: Can you post clear photos of both sides of the PCB, especially the RTL87X0C module area and the power-measurement chip area, including any chip markings / PCB revision text?
    the photos are in the post
    AI: Can you confirm the exact metering IC marking on the board — is it really BL0937, BL0942, BL0973 or something else — and did you trace which pins from that chip go to the RTL87X0C GPIOs?
    BL0937 is correct
    no i cannot trace them since i wasn't able to solder anything.

    Added after 2 [hours] 46 [minutes]:

    >>21948489

    I got it to work but my button doesn't recognize any input anymore, even if i set the previous settings.
    Here's the working template (button with same settings but not working, strange!!)

    
    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Full Device Name Here",
      "model": "enter short model name here",
      "chip": "RTL87X0C",
      "board": "TODO",
      "flags": "1024",
      "keywords": [
        "TODO",
        "TODO",
        "TODO"
      ],
      "pins": {
        "1": "Rel;1;0",
        "3": "BL0937CF1;0;0",
        "4": "BL0937CF;0;0",
        "12": "Btn;1",
        "17": "LED_n;2",
        "18": "LED_n;3",
        "21": "BL0937SEL;0"
      },
      "command": "backlog setChannelType 3 Current_div100; startDriver BL0937; startDriver NTP; SetupEnergyStats 1 60 60"
    }


    Although i tried to use a divisor for Current, it's still not the proper factor. seems like setChannelType doesn't have any effects:

    [RTL87X0C] Tuya EP2 Smart Plug - how to find BL0937 power pins?
  • ADVERTISEMENT
  • ADVERTISEMENT
  • Firmware dump lacks BL0937 pin mapping data

    #3 21948875
    me_lon
    Level 2  
    Posts: 4
    Rate: 1
    Looks like i've got no luck:

    Sorry, no meaningful pins data found. This device may be TuyaMCU or a custom one with no Tuya config data.
    No module information found.
    Device internal platform - rtl8720cf_ameba, equals RTL87X0C.
    And the Tuya section starts at an UNCOMMON POSITION 1933312 (0x1D8000)
    


    {
      "gw_bi": {
        "uuid": "PEZNb3c6yTbs",
        "psk_key": null,
        "auth_key": "b0lINdU9EM8sn6EE",
        "ap_ssid": "A",
        "ap_passwd": null,
        "country_code": null,
        "bt_mac": null,
        "bt_hid": null,
        "prod_test": false,
        "fac_pin": null
      },
      "gw_di": {
        "abi": 0,
        "id": "8dvL2D5P3lxye1Dce9Et",
        "swv": "1.0.4",
        "bv": "40.00",
        "pv": "2.2",
        "lpv": "3.3",
        "pk": "tkn2s79mzedk6pwr",
        "firmk": null,
        "cadv": "1.0.3",
        "cdv": "1.0.0",
        "dev_swv": "1.0.4",
        "s_id": "000002qgwf",
        "dtp": 0,
        "sync": 0,
        "attr_num": 0,
        "mst_tp_0": 0,
        "mst_ver_0": null,
        "mst_tp_1": 0,
        "mst_ver_1": null,
        "mst_tp_2": 0,
        "mst_ver_2": null,
        "mst_tp_3": 0,
        "mst_ver_3": null
      },
      "tls_ca_cnt": 0,
      "mf_test_close": true,
      "gw_wsm": {
        "nc_tp": 4,
        "ssid": "Y2xvdWRjdXR0ZXJmbGFzaA==",
        "passwd": "YWJjZGFiY2Q=",
        "md": 0,
        "random": 0,
        "wfb64": 1,
        "stat": 2,
        "token": "AAAAAA",
        "region": "AA",
        "reg_key": null,
        "dns_prio": 2
      },
      "gw_ai": {
        "key": "MUEVl8zN5P1K3pPJ",
        "lckey": "tHaOwwtShchaMzlP",
        "h_url": "http://10.204.0.1/d.json",
        "h_ip": "10.204.0.1",
        "hs_url": null,
        "hs_ip": null,
        "hs_psk": "https://a3-eu.lifeaiot.com/d.json",
        "hs_psk_ip": "18.158.227.228",
        "mqs_url": null,
        "mqs_ip": null,
        "mq_url": "10.204.0.1:1883",
        "mq_ip": "10.204.0.1",
        "ai_sp": null,
        "ai_sp_ip": null,
        "mq_psk": "m3-eu.lifeaiot.com:8883",
        "mq_psk_ip": "18.153.246.219",
        "time_z": "+01:00",
        "s_time_z": "[[1648342800,1667091600],[1679792400,1698541200]]",
        "wx_app_id": null,
        "wx_uuid": null,
        "dy_tls_m": 1,
        "cloud_cap": 1025,
        "psk21_key": null
      },
      "is_stride": 0,
      "000002qgwf": [
        {
          "mode": "rw",
          "property": {
            "type": "bool"
          },
          "id": 1,
          "type": "obj"
        },
        {
          "mode": "rw",
          "property": {
            "min": 0,
            "max": 86400,
            "scale": 0,
            "step": 1,
            "type": "value"
          },
          "id": 9,
          "type": "obj"
        },
        {
          "mode": "rw",
          "property": {
            "min": 0,
            "max": 50000,
            "scale": 3,
            "step": 100,
            "type": "value"
          },
          "id": 17,
          "type": "obj"
        },
        {
          "mode": "ro",
          "property": {
            "min": 0,
            "max": 80000,
            "scale": 0,
            "step": 1,
            "type": "value"
          },
          "id": 18,
          "type": "obj"
        },
        {
          "mode": "ro",
          "property": {
            "min": 0,
            "max": 200000,
            "scale": 1,
            "step": 1,
            "type": "value"
          },
          "id": 19,
          "type": "obj"
        },
        {
          "mode": "ro",
          "property": {
            "min": 0,
            "max": 5000,
            "scale": 1,
            "step": 1,
            "type": "value"
          },
          "id": 20,
          "type": "obj"
        },
        {
          "mode": "ro",
          "property": {
            "min": 0,
            "max": 5,
            "scale": 0,
            "step": 1,
            "type": "value"
          },
          "id": 21,
          "type": "obj"
        },
        {
          "mode": "ro",
          "property": {
            "min": 0,
            "max": 1000000000,
            "scale": 0,
            "step": 1,
            "type": "value"
          },
          "id": 22,
          "type": "obj"
        },
        {
          "mode": "ro",
          "property": {
            "min": 0,
            "max": 1000000000,
            "scale": 0,
            "step": 1,
            "type": "value"
          },
          "id": 23,
          "type": "obj"
        },
        {
          "mode": "ro",
          "property": {
            "min": 0,
            "max": 1000000000,
            "scale": 0,
            "step": 1,
            "type": "value"
          },
          "id": 24,
          "type": "obj"
        },
        {
          "mode": "ro",
          "property": {
            "min": 0,
            "max": 1000000000,
            "scale": 0,
            "step": 1,
            "type": "value"
          },
          "id": 25,
          "type": "obj"
        },
        {
          "mode": "ro",
          "property": {
            "type": "bitmap",
            "maxlen": 1
          },
          "id": 26,
          "type": "obj"
        },
        {
          "mode": "rw",
          "property": {
            "range": [
              "off",
              "on",
              "memory"
            ],
            "type": "enum"
          },
          "id": 38,
          "type": "obj"
        },
        {
          "mode": "rw",
          "property": {
            "range": [
              "relay",
              "pos",
              "none"
            ],
            "type": "enum"
          },
          "id": 39,
          "type": "obj"
        },
        {
          "mode": "rw",
          "property": {
            "type": "bool"
          },
          "id": 40,
          "type": "obj"
        },
        {
          "mode": "rw",
          "property": {
            "type": "string",
            "maxlen": 255
          },
          "id": 41,
          "type": "obj"
        },
        {
          "mode": "rw",
          "property": {
            "type": "string",
            "maxlen": 255
          },
          "id": 42,
          "type": "obj"
        },
        {
          "mode": "rw",
          "property": {
            "type": "string",
            "maxlen": 255
          },
          "id": 43,
          "type": "obj"
        }
      ],
      "ble_app_key": "AC4DC96035BE93CC8A3BC3EA3FF35DC5",
      "em_sys_env": "rtl8720cf_ameba",
      "ble_network_key": "06443CFF25D15CCA36DC2373E80622D8",
      "ap_info_v2": "70000000636c6f7564637574746572666c617368000000000000000000000000000000000000000061626364616263640000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000400400006",
      "wf_start_md": 3,
      "timer_arr": {
        "lastFetchTime": 0,
        "cnt": 0
      }
    }
    
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #5 21948895
    me_lon
    Level 2  
    Posts: 4
    Rate: 1
    >>21948892

    Ooooh, no!
    Thank you!!!
    Could it be that the Search didn't find it because my keywords aren't written in Polish language? :)

    Btw: The Plug works now perfectly. How can we move the template into the database in order to find it via webApp?
ADVERTISEMENT