logo elektroda
logo elektroda
X
logo elektroda

[BK7231T - WB2S] Flashing the Denver SHP-200MK2 (Wi-Fi 2in1 Plug with Power Monitoring)

kvakulo 246 2
ADVERTISEMENT
  • Helpful post
    #1 21516877
    kvakulo
    Level 3  
    Here is how to flash the Denver SHP-200MK2 Smart Wi-Fi 2in1 plug with OpenBeken:
    Packaging of Denver Smart Wi-Fi 2 in 1 plug.

    The plug casing is secured with four screws on the back:
    Rear view of a white electrical plug with red arrows pointing to four screws.

    Inside, a WB2S module is found:
    View of the inside of an electrical socket showing wires and electronic components.

    The PCB itself is labelled as WG-05E:
    Close-up of a circuit board with attached wires and electronic components.

    The UART pins are not directly exposed, and the PCB seems to be soldered to the plug’s prongs, so desoldering didn’t look like an easy option.
    Interior of an electrical splitter with visible wires and electrical components.

    I decided to simply cut a bit of the plastic in front to expose the pins:
    Interior of a smart plug showing electronic components and labels for 3.3V, GND, RX, TX pins.

    I soldered four wires to the pins (3.3V, GND, RX, TX) and connected to an USB UART. Then I used the BK7231 GUI Flash Tool to flash OpenBeken.

    The extracted OBK template is as follows:
    
    {
      "vendor": "Denver",
      "bDetailed": "0",
      "name": "Smart Wi-Fi 2in1 plug",
      "model": "SHP-200MK2",
      "chip": "BK7231T",
      "board": "TODO",
      "flags": "1024",
      "keywords": [
        "Wi-Fi plug",
        "Powermeter"
      ],
      "pins": {
        "6": "BL0937SEL;0",
        "7": "BL0937CF1;0",
        "8": "BL0937CF;0",
        "10": "Btn;2",
        "11": "WifiLED_n;0",
        "23": "Btn;1",
        "24": "Rel;2",
        "26": "Rel;1"
      },
      "command": "",
      "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }
    


    I have inserted the following code in the autoexec.bat file to have the Wi-Fi LED off when the plug is connected to Wi-Fi, and to enable energy data.

    
    alias mode_wifi setPinRole 11 WifiLED_n
    alias mode_led_off setPinRole 11 AlwaysHigh
    
    // at reboot, set WiFiLEd
    mode_wifi
    // then, setup handlers
    addChangeHandler WiFiState == 4 mode_led_off
    addChangeHandler WiFiState != 4 mode_wifi
    
    startDriver ntp
    ntp_timeZoneOfs 1:00 
    


    The original firmware is attached for reference.
  • ADVERTISEMENT
ADVERTISEMENT