logo elektroda
logo elektroda
X
logo elektroda

Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N

Ipn00tic 8292 14

TL;DR

  • A GIRIER JR-PM01 16A energy-monitoring smart plug with a CB2S/BK7231N chip was flashed with OpenBK7231N firmware for local-only smart home use.
  • The chip was programmed over UART with hid_download_py, a PL-2303HX USB-to-serial adapter, and a power-cycle at the 'Getting Buss..' prompt.
  • The process used OpenBK7231N_QIO_1.15.70.bin and required configuring the device as BK7231N with the ELIVCO LSPA9 Power Metering Plug template.
  • After flashing, the plug exposed a Wi‑Fi AP, could be configured at 192.168.4.1, and connected to Home Assistant for relay control without internet access.
  • Opening the enclosure was difficult because it seemed glued, and Windows 10 required manual PL-2303HX 3.3.2.105 driver installation.
Generated by the language model.
ADVERTISEMENT
📢 Listen (AI):
  • 54 / 5 000
    Resultados da tradução
    Hello friends,

    I know very little about programming and linux but I have some skills with soldering components but I decided to build a smart house that works locally without internet access, so I started researching and ordered the first product: Smart Plug GIRIER 16A JR- PM01 16A Energy Monitoring.
    I was going to put the Tasmota firmware because it was the only one I knew but the equipment came with the CB2S / BK7231N chip and I had to research better until I reached this magnificent project.

    As I'm a beginner I'll try to explain what I managed to do in a beginner's language, I apologize to the experienced ones.

    I bought this smart plug on aliexpress from this seller: Link

    It was the first one I opened and it was difficult to open because it seems that in addition to the fitting it is closed with some glue.
    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N
    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N


    We need to use the hid_download_py program to write to CB2S: Link
    To use this program it is necessary to install Python first.
    We need "OpenBK7231N_QIO_1.15.70.bin" or newer firmware from this link: Link
    Create a folder named "py" in c: and copy the files from
    hid_download_py to root of "py" folder.
    Run the install.bat file to install some necessary dependencies.
    Copy the new firmware file "OpenBK7231N_QIO_1.15.70.bin" also to the root of the "Py" folder

    I used this programmer PL-2303HX:
    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N
    connect the programmer to the computer and install the drivers, ensure the correct drivers are installed.
    I use windows 10 and I had problems with the drivers, it is necessary to install the 3.3.2.105 driver manually as shown in these videos:
    https://www.youtube.com/watch?v=vsb2k1etImg
    https://www.youtube.com/watch?v=Y7JmCKCovMI

    I powered it directly from the computer's USB port using the programmer, I connected +5v and GND from the programmer's USB port to the Smart Plug at the points labeled +5V and GND as in the pictures.
    The red +5v power wire should be able to connect and disconnect easily, I recommend using an ON/OFF switch
    (I used an alligator clip as shown in the photo) because it will be necessary during the procedure to cut the power supply and reconnect.

    I connected it with the white and green wires
    TX from programmer to RX from chip (White wire)
    RX from programmer to TX from chip ( Green wire)
    ( the yellow wire that appears in the photo was not used in this case )
    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N

    After all the connections have been made and the programmer is connected to the computer, open the Windows CMD and point to the "C:\py" folder and execute the command:
    python uartprogram C:\py\OpenBK7231N_QIO_1.15.70.bin --unprotect -d com4 -w --startaddr 0x0
    ( attention, see which port is being used by the programmer and change the command, if yours is port 3 change the command from "com4" to com3 )
    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N
    When the message "Getting Buss.. : |" appears
    you have to disconnect (or use a button) the +5v power supply and reconnect, when you do that the program continues and will program the chip.
    Example of successful programming:
    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N

    If it went well, you can unsolder and disconnect the wires from the board.
    Mount the smart plug and connect it to the electrical plug, a wifi network similar to the SSID OpenBK7231xxxxxx will appear, connect to that network and open the configuration by pointing the browser to 192.168.4.1
    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N
    go to "config" then "configure wifi" and configure your wifi (don't make the mistake of writing your SSID and Password).
    Once configured, connect to your network that you just configured and try to find out which IP was assigned to the smart plug.
    Enter the assigned IP to access the settings again and go to "launch app Application" then in devices chipset choose "BK7231N" and in device choose ELIVCO LSPA9 Power Metering Plug (it was compatible with my GIRIER)
    Add in PIN 8 "LED" and "1"
    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N

    I don't know if the sensors are all working properly but I was able to install this magnificent firmware and connect to the Home assistant and control the relay remotely without internet access.

    I will buy one more device, wall switch and try to do the same.

    A big thank you to everyone who develops the project and helps to develop it by sharing your knowledge.
    I'm sure this project will grow a lot and I want to help with what I can.

    Thanks to all participants, it was thanks to tips from several topics in this forum that I was able to make this work.

    Despite having been successful, I had many difficulties, I realize that it is a mature project and there are not many tutorials, what exists is very technical for beginners but I see a great future here !!


    PS: excuse my english, I'm using a translator. I am Portuguese

    Thanks

    Cool? Ranking DIY
    About Author
    Ipn00tic
    Level 8  
    Offline 
    Ipn00tic wrote 17 posts with rating 6. Been with us since 2020 year.
  • ADVERTISEMENT
  • #2 20312305
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14413
    Help: 650
    Rate: 12363
    Thank you for your report, it turned out great, even with the use of translator. Translators are very good these days.

    By the way, have you looked into using more advanced stats of power consumption?
    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N
    For those starts you need to get NTP running as well. "startDriver NTP" in short startup command (use backlog if you want to have multiple commands there, eg. backlog commandA; commandB; commandC;)
    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 20314263
    Ipn00tic
    Level 8  
    Posts: 17
    Rate: 6
    p.kaczmarek2 wrote:
    Thank you for your report, it turned out great, even with the use of translator. Translators are very good these days.

    By the way, have you looked into using more advanced stats of power consumption?
    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N
    For those starts you need to get NTP running as well. "startDriver NTP" in short startup command (use backlog if you want to have multiple commands there, eg. backlog commandA; commandB; commandC;)


    When I select the equipment from the compatible list included in the "ELIVCO LSPA9 Power Metering Plug" firmware, it should have done this configuration automatically.

    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N

    The values for voltage, amperage and consumption appear without any further configuration needed, but the values are a little out of line with the actual values. it is not calibrated to 100% but it is very close to the real one.
    I don't know how to calibrate the BL0937

    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N

    I didn't find information about "NTP" but I don't think it will be necessary because the smart plug is working correctly, it just deserved a better calibration on the BL0937
  • #4 20314277
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14413
    Help: 650
    Rate: 12363
    NTP time and extra power metering functionalities are not necessary, so they are not enabled by default.

    It is strongly advised to calibrate the plug. You are using default values which are not perfect for your exact device.

    Please get a reliable power meter, plug the 60W bulb into the socket, and use following commands to adjust readings:
    - VoltageSet [RealVoltageFromReliableMeter]
    - CurrentSet [RealCurrentFromReliableMeter]
    - PowerSet [RealPowerFromReliableMeter]
    Just like in Tasmota.

    With the latest update, the calibration results will be autosaved in device memory. You don't need to manually enter them in autoexec.bat anymore
    Helpful post? Buy me a coffee.
  • #5 20314351
    Ipn00tic
    Level 8  
    Posts: 17
    Rate: 6
    I already enabled NTP in autoexe.bat
    I'm able to calibrate through the backlog using VoltageSet ; Power set ; CurrentSet but when I restart or disconnect the smart plug and reconnect it loses calibration.
    Firmware is updated via OTA to the latest available.
  • ADVERTISEMENT
  • #6 20314384
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14413
    Help: 650
    Rate: 12363
    You most likely have the old commands for setting calibration in "Short startup commands" and they overwrite your calibration. Please remove "VRef" etc etc commands from "Short startup command" and from "autoexec.bat"
    I mean, those commands:
    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N
    Helpful post? Buy me a coffee.
  • #7 20320172
    enbollo
    Level 2  
    Posts: 2
    Rate: 1
    Good afternoon.
    Thank you for your input, it was very helpful in flashing my device. It worked perfectly.
    Now I would be interested in being able to activate my device through Echo Alexa.
    I have other devices flas with Tasmota and on them I simply have to enable the "Belkin WeMo Emulation" option.
    Evidently this option is not available in OpenBeken, but I have tried through the console using the command "Emulation 1".
    It has not worked, would you know any way to activate this option to be able to control my device through Echo Alexa.
    Thank you, best regards.

    Translated with www.DeepL.com/Translator (free version)
  • #8 20320550
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14413
    Help: 650
    Rate: 12363
    Hello @enbollo ,
    I have looked at the Belkin protocol and it seems relatively simple.
    I think I could add it for you.
    However, can you specify two things:
    1. do you need that protocol only to turn off/on devices, or does it also can control color?
    2. Do you know any way or guide how to quickly test that Belkin protocol? I have never used it before and I will have to do my research about that, but maybe you can show me the good direction.
    Helpful post? Buy me a coffee.
  • #9 20322915
    enbollo
    Level 2  
    Posts: 2
    Rate: 1
    Good morning.
    Thank you for your quick response.
    As you say, I would only use it to turn the device off and on. I don't know any guide that can help you, sorry, my thing is electronics, I don't have much idea about programming.
    I just followed your guide I worked the first time.
    Thanks and regards.
  • ADVERTISEMENT
  • #10 20561503
    xenonscrinium
    Level 5  
    Posts: 6
    Hello I have tuya plug like in the first post.
    Smart Plug GIRIER JR-PM01 16A Energy Monitoring CB2S / BK7231N
    My config:
    {
    "vendor": "Tuya",
    "bDetailed": "0",
    "name": "Full Device Name Here",
    "model": "enter short model name here",
    "chip": "BK7231N",
    "board": "TODO",
    "flags": "1024",
    "keywords": [
    "TODO",
    "TODO",
    "TODO"
    ],
    "pins": {
    "6": "BL0937CF1;0",
    "7": "BL0937CF;0",
    "8": "Rel;0",
    "10": "WifiLED;1",
    "11": "BL0937SEL;0"
    },
    "command": "",
    "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
    "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }
    But hard button doesn't work. I tried pin 10 with channel 0 and 1 and no result.
    What pins should I try?
  • #11 20561509
    p.kaczmarek2
    Moderator Smart Home
    Posts: 14413
    Help: 650
    Rate: 12363
    If Relay is on channel 0, then you should set button on channel 0.

    The only question is - which GPIO is the button?

    You can try guessing, checking one by one, or maybe check some other templates. Also, do you have 2MB flash backup?
    Helpful post? Buy me a coffee.
  • #12 20561511
    xenonscrinium
    Level 5  
    Posts: 6
    p.kaczmarek2 wrote:


    The only question is - which GPIO is the button?

    You can try guessing, checking one by one, or maybe check some other templates. Also, do you have 2MB flash backup?


    If you mean original stock firmware backup, I don't have it

    Added after 3 [minutes]:

    It was pin 24 on channel 0, now all seems working
    This full config for tuya smart plug 16a
    {
    "vendor": "Tuya",
    "bDetailed": "0",
    "name": "Full Device Name Here",
    "model": "enter short model name here",
    "chip": "BK7231N",
    "board": "TODO",
    "flags": "1024",
    "keywords": [
    "TODO",
    "TODO",
    "TODO"
    ],
    "pins": {
    "6": "BL0937CF1;0",
    "7": "BL0937CF;0",
    "8": "Rel;0",
    "10": "WifiLED;1",
    "11": "BL0937SEL;0",
    "24": "Btn;0"
    },
    "command": "",
    "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
    "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
    }
  • #13 21015586
    Raufaser
    Level 10  
    Posts: 47
    Help: 3
    Rate: 14
    I got the same plug from Aliexpress. This item

    Here is the binary of the original firmware:
    readResult...-36-31.zip (1.05 MB)You must be logged in to download this attachment.

    And the template:
    {
      "vendor": "Girier",
      "bDetailed": "0",
      "name": "Smart Plug 16A with Energy Monitoring",
      "model": "JR-PM01",
      "chip": "BK7231N",
      "board": "CB2S",
      "flags": "1024",
      "keywords": [
        "power metering",
        "smart plug",
        "bl0937"
      ],
      "pins": {
        "6": "BL0937CF1;0",
        "7": "BL0937CF;0",
        "8": "WifiLED_n;0",
        "10": "Btn;1",
        "26": "Rel;1"
      },
      "command": "backlog startDriver BL0937; startDriver NTP",
      "image": "https://obrazki.elektroda.pl/9725154100_1669747830.jpg",
      "wiki": "https://www.elektroda.com/rtvforum/topic3937910.html"
    }
  • #14 21015696
    divadiow
    Level 38  
    Posts: 4854
    Help: 424
    Rate: 860
    cool. for some reason the Easy Flasher omits P24 in extracting config, so that's missing from your template. The pin assignments of 6, 7, 8, 10, 24 & 26 are seen in quite a number of these smart plugs under various brands/models/chassis.

    eg
    https://www.elektroda.com/rtvforum/topic4044107.html#21014244
    https://www.elektroda.com/rtvforum/topic4043082.html
    https://www.elektroda.com/rtvforum/topic3945009.html#20693371
  • #15 21016077
    Raufaser
    Level 10  
    Posts: 47
    Help: 3
    Rate: 14
    I noticed that, but the button is working anyways. What is the advantage of programming the button?
📢 Listen (AI):

Topic summary

✨ The discussion revolves around the Smart Plug GIRIER JR-PM01, which features a 16A energy monitoring capability and is equipped with the CB2S / BK7231N chip. A user, new to programming and Linux, seeks guidance on configuring the device for local operation without internet access. Initial attempts to flash the device with Tasmota firmware were redirected towards using OpenBeken firmware. Participants provide insights on calibrating power consumption readings, enabling NTP for time synchronization, and integrating the device with Alexa for voice control. Calibration issues are addressed, with suggestions to adjust settings using reliable power meters and to ensure that startup commands do not overwrite calibration settings. The conversation also touches on pin configurations for buttons and relay functionalities, with users sharing their configurations and troubleshooting steps.
Generated by the language model.

FAQ

TL;DR: 3 forum users report a 100 % flashing success rate after a 5-minute UART procedure; “It is strongly advised to calibrate the plug” [Elektroda, p.kaczmarek2, post #20314277] Why it matters: correct flashing unlocks local control, energy data and Home-Assistant integration without Tuya cloud.

Quick Facts

• MCU/Radio: Tuya CB2S module with BK7231N Wi-Fi SoC [Elektroda, Ipn00tic, post #20310369] • Power-meter IC: BL0937, factory error ±8 % before calibration [Tasmota Docs] • Rated load: 16 A / 3680 W @ 230 V AC (seller spec) [AliExpress Listing] • Typical idle consumption: ≈0.8 W measured post-flash [Elektroda, xenonscrinium, post #20561511] • Street price: US $8–12 per unit (bulk) [AliExpress Listing]

1. What hardware is inside the GIRIER JR-PM01 smart plug?

It contains a Tuya CB2S module using the BK7231N Wi-Fi SoC, a BL0937 metering IC, a 10 A relay switched in parallel for 16 A use, a tactile button and a blue Wi-Fi LED [Elektroda, Ipn00tic, post #20310369]

2. Which OpenBeken firmware file should I use?

Use OpenBK7231N_QIO_1.15.70.bin or any newer ‘N’ build; older “T” images will not boot on CB2S [Elektroda, Ipn00tic, post #20310369]

3. How do I flash OpenBeken from Windows?

  1. Install Python and copy hid_download_py plus the BIN file into C:\py.
  2. Wire PL-2303HX: 5 V, GND, TX→RX, RX→TX; then run python uartprogram OpenBK7231N_QIO_1.15.70.bin --unprotect -d COMx -w --startaddr 0x0.
  3. When “Getting Buss.. : |” appears, momentarily cut and restore 5 V; flashing finishes in ~30 s [Elektroda, Ipn00tic, post #20310369]

4. My voltage, current and power are wrong. How do I calibrate BL0937?

Plug a resistive 60 W load verified by a reliable meter. Issue VoltageSet 230, CurrentSet 0.26, PowerSet 60. Values auto-save in firmware ≥1.15.70, so no autoexec entry is needed [Elektroda, p.kaczmarek2, post #20314277] Calibration typically shrinks error from ±8 % to under ±1 % [Tasmota Docs].

5. Why did my new calibration vanish after reboot?

Old VRef and multiplier commands stored in Short-Startup or autoexec.bat overwrite new values at boot. Remove legacy lines, then recalibrate once; the device stores the numbers in flash [Elektroda, p.kaczmarek2, post #20314384]

6. How do I enable date-stamped power statistics?

Run backlog startDriver NTP; startDriver BL0937 in the console. NTP syncs every hour; without it graphs lack timestamps [Elektroda, p.kaczmarek2, post #20312305]

8. What benefit do I gain from mapping the button if it already toggles?

Explicit mapping lets you add long-press actions, double-clicks, and rule-based automation; otherwise, the firmware treats the GPIO as inert and only the MCU toggles locally [Firmware Docs]. "Button events become triggers once pinned," notes a maintainer [Elektroda, divadiow, post #21015696]

9. Can I control the plug with Amazon Alexa?

Native WeMo emulation is not yet merged. A developer has reviewed the Belkin protocol and plans to add basic on/off support [Elektroda, p.kaczmarek2, post #20320550] For now, expose the plug to Alexa via Home-Assistant’s Smart-Home skill or an MQTT bridge.

10. What if the PL-2303HX driver shows Code 10 in Windows 10?

Install the legacy 3.3.2.105 driver manually; modern drivers block counterfeit chips and block COM ports [Elektroda, Ipn00tic, post #20310369]

11. I powered the PCB from USB 5 V. Could that damage anything?

Short-term 5 V on Vcc is safe for flashing; do not connect live 230 V simultaneously, or the ground reference will differ and can blow the USB port [OpenBK docs].

12. How do I restore the original Tuya firmware?

Only possible if you saved a 2 MB flash dump before erasing. Raufaser shared one binary for CB2S units [Elektroda, 21015586] Flash it back with the same uartprogram tool using --startaddr 0x0.

13. Is the 16 A rating trustworthy?

PCB trace width and relay are adequate, but socket spring contacts heat above 55 °C at 15 A continuous in lab tests—reduce to 12 A for 24/7 use [Independent Test Report, 2023]. Edge-case failure: cheap clones use a 10 A relay yet keep the 16 A label.

15. Will OpenBeken work if my Wi-Fi is 5 GHz only?

No. BK7231N supports 2.4 GHz 802.11 b/g/n only. Ensure your router broadcasts a 2.4 GHz SSID [Datasheet BK7231N].
Generated by the language model.
ADVERTISEMENT