logo elektroda
logo elektroda
X
logo elektroda

Troubleshooting [RTL8720CF] CSE7759B on Refoss Smart Plug with OpenBeken Firmware

A6uh 510 5
ADVERTISEMENT
  • #1 21419365
    A6uh
    Level 3  
    Refoss Smart Plug with Energy Monitoring from Amazon US
    RTL8720CF
    CSE7759B

    I've been trying to get this smart plug with energy monitoring working on OpenBeken. I was successfully able to flash the new firmware after desoldering the chip. The button, relay, and leds all work fine. However, I can't get the CSE7759B working for the life of me.
    In the logs it constantly puts out
    Info:EnergyMeter:Consumed 252 unwanted non-header byte in CSE7766 buffer
    Info:EnergyMeter:Consumed 245 unwanted non-header byte in CSE7766 buffer
    Info:EnergyMeter:Consumed 249 unwanted non-header byte in CSE7766 buffer
    Info:EnergyMeter:Consumed 249 unwanted non-header byte in CSE7766 buffer
    Info:EnergyMeter:Consumed 245 unwanted non-header byte in CSE7766 buffer

    While showing 0 for voltage, current, and power.

    When I power the device with 120V, attach a load, and monitor the tx pin of the CSE7759B I was able to capture:
    35 92 CC 21 F0 ED 61 00 1A 54 55 5A 02 F9 B8 01
    62 74 08 D0 94 8F 58 7D 56 35 92 CC 23 8A 52 61
    00 1A 55 55 5A 02 F9 B8 00 1C 5D 01 E8 94 8F 58
    7D 56 35 92 CC 25 23 B7 61 00 1A 55 55 5A 02 F9
    B8 00 0C 5D 02 E8 94 8F 58 7D 56 35 92 CC 26 BD
    39 0B 03 A4 AC F9 55 B1 12 96 E1 01 62 E8 08 D0
    94 8F 58 7D 56 35 92 CC 28 56 81 61 00 1A 55 FF
    55 5A 02 F9 B8 00 0C 5D 02 E8 94 8F 18 5D FC D4
    24 98 29 EF D6 61 00 1A 75

    Additional Captures:
    8D 60 FF 55 5A 02 F9 E1 01 74 6C 17 80 94 2F 58 72 EC 51 48 21 09 
    EE 7D 8B 02 D4 14 E6 55 5A 09 CB E1 01 5E 6C 17 A0 94 2F 58 72 EC 51 48 
    61 09 D9 DD 8B 02 D4 14 E6 55 5A 09 CB E1 01 DA 6C 17 A0 94 2F 58 72 EC 
    51 48 98 09 E8 BC 71 00 8D BD 55 5A 02 F9 B8 00 1E EB 00 3E 65 01 91 B0 
    51 48 98 09 E1 F1 8B 02 D4 D4 FF 55 E9 12 96 E1 01 5E 6C 17 A0 94 2F 50 
    72 EC 51 48 21 09 E8 71 71 00 8D BD 55 5A 09 CB E1 05 68 D8 17 A0 94 2F 
    50 72 EC 51 48 98 09 E8 BC 71 00 8E C0 55 5A 02 F9 B8 00 0A EB 00 3E 65 
    01 91 B0 51 48 98 09 A1 F1 97 02 E4 14 FE 55 5A 02 F9 B8 01 5A B6 17 A0 
    94 2F 58 72 EC 51 48 98 09 E8 BC 71 00 8E C0 55 B5 12 96 E1 01 5A 6C 17 
    80 94 2F 58 72 EC 51 48 98 09 E8 BC 71 00 8E C1 55 5A 04 CB E1 01 68 D8 
    17 A0 94 2F 18 B9 58 D4 24 98 09 E8 78 71 00 8E D9 FF 55 5A 02 F9 B8 00 
    0B EB 00 FA 94 2F 18 B9 58 D4 24 98 09 E8 79 71 00 8C D9 FF 55 A9 12 96 
    E1 01 1A 6C 17 A0 94 2F 10 B9 58 D4 24 98 09 E8 71 71 00 8E F7 55 A9 12 
    96 E1 01 DA 6C 17 80 94 2F 18 B9 58 D4 24 98 09 D1 F1 8B 02 F4 DC FF 55 
    5A 02 F9 B8 00 5A B6 17 A0 94 2F 18 B9 58 D4 24 98 09 D1 F1 8B 02 F4 DC 
    FF 55 5A 02 F9 B8 00 16 EB 00 3E 65 01 94 C3 51 48 61 09 D0 F1 8B 02 F4 
    DC FF 55 5A 02 F9 B8 01 5A B6 17 A0 94 2F 18 B9 58 D4 24 98 09 FC 02 71 
    01 7A 16 FD 55 5A 02 F9 B8 00 5A B6 17 A0 94 2F 18 B9 58 D4 28 98 09 F1 
    09 96 02 F4 5C F5 55 5A 09 CB E1 01 5A 4C 1F A0 94 2F 18 B9 58 D4 24 98 
    09 FC 04 8B 02 04 2A FD 55 A9 12 96 E1 01 58 4C 1F A0 94 2F 10 B9 58 D4 
    24 98 09 FC 01 8B 02 04 2A F5 55 E9 12 96 E1 01 50 4C 1F 80 94 2F 18 B9 
    58 D4 08 98 09 F1 09 82 02 04 2A FD 55 A9 12 96 E1 01 D4 4C 1F A0 94 2F 
    18 B9 58 D4 24 98 09 FC 09 8B 02 04 2A FD 55 B1 12 96 E1 01 1A 4C 1F A0 
    94 2F 18 B9 58 D4 24 98 09 FC 00 8B 02 04 2A F8 55 5A 09 CB E1 05 68 98 
    1F 80 94 2F 18 B9 58 D4 24 98 09 FC 02 71 00 90 85 FF 55 E9 12 96 E1 01 
    5E 4C 1F A0 94 2F 18 B9 58 D4 20 98 09 FC 09 8B 02 04 2A FD 55 B9 12 96 
    E1 01 5A 4C 1F 80 94 2F 18 B9 58 D4 24 98 09 FC 02 71 00 91 52 55 69 12 
    9E E1 01 D0 4C 1F A0 94 2F 18 B9 58 D4


    Any help with this would be appreciated. I plan to do a proper teardown once I get this working.
    Attatched are pictures of the board
    Circuit board with electronic components held in a hand. Close-up of a circuit board featuring the RTL8720CF chip. Close-up of a circuit board featuring a green card labeled MR2EHK_REV30 with pins marked as GPIOA_13, RX, TX. Close-up of a circuit board featuring CSE7759B markings.


    If it helps, this is my current template
    {
      "vendor": "Tuya",
      "bDetailed": "0",
      "name": "Full Device Name Here",
      "model": "enter short model name here",
      "chip": "RTL87X0C",
      "board": "TODO",
      "flags": "0",
      "keywords": [
        "TODO",
        "TODO",
        "TODO"
      ],
      "pins": {
        "14": "LED_n;45;0",
        "18": "Rel;44;0",
        "19": "Btn;44;44",
        "20": "LED_n;43"
      },
      "command": "backlog startDriver NTP; startDriver CSE7766",
      "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }
  • ADVERTISEMENT
  • #2 21421025
    miegapele
    Level 15  
    Check which pins of the mcu the power monitoring chip is connected. It might not be using default UART pins. There is a configuration setting to use alternative uart.
    Data captures seems fine they start with 0x55 as espected
  • ADVERTISEMENT
  • #3 21421070
    A6uh
    Level 3  
    I believe TX of the cse7759b is connected to GPIOA_13 and RX is on GPIOA_14. However, the alternate UART setting just stops all the logs altogether.

    Just to double-check, I swapped the module out for an ESP-02S with tasmota, and the power monitoring definitely works correctly there.
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #5 21426637
    A6uh
    Level 3  
    Unfortunately still getting the same thing, except all the pins in the Module section show "error" with this one. Earlier, I did make a build that just dumps all the UART packets to logs. I can reflash that one and post those logs if it'd be useful. Those logs definitely didn't match up with what I was seeing when connected directly to the cse7759b.

    Info:EnergyMeter:Consumed 232 unwanted non-header byte in CSE7766 buffer
    Info:EnergyMeter:Consumed 231 unwanted non-header byte in CSE7766 buffer
    Info:EnergyMeter:Consumed 225 unwanted non-header byte in CSE7766 buffer
    Info:EnergyMeter:Consumed 238 unwanted non-header byte in CSE7766 buffer
    Info:EnergyMeter:Consumed 220 unwanted non-header byte in CSE7766 buffer
    Info:EnergyMeter:Consumed 238 unwanted non-header byte in CSE7766 buffer
    Info:EnergyMeter:Consumed 225 unwanted non-header byte in CSE7766 buffer
    Info:EnergyMeter:Consumed 231 unwanted non-header byte in CSE7766 buffer
    Info:EnergyMeter:Consumed 232 unwanted non-header byte in CSE7766 buffer
    Info:EnergyMeter:Consumed 224 unwanted non-header byte in CSE7766 buffer

    Screenshot of a module pin configuration where all pins show error.

    Edit: Actually, there is something happening? I'm unable to trigger the relay, leds, etc though. Reflashing with a regular build restores use of the relay and leds with the same config.

    Screenshot of OpenRTL87X0C interface displaying energy data

    Edit 2: I rebuilt the firmware with the change you made and the pins all work correctly now. No idea what happened with that build. I need to find something I can use to properly calibrate it in the meantime. However, the voltage has been reporting correctly so far. Only the Power and Current have been a little weird.

    Edit 3: After calibration, it seems to be working fine. I did notice Power reports initially, but after about 10 seconds, drops to 0w and will occasionally jump back up to the correct wattage.
  • #6 21431280
    miegapele
    Level 15  
    Kill-a-watt or equivalent device should be best to calibrate. You might try to use some old incandescent bulb with rated wattage, but that won't be very accurate.
ADVERTISEMENT