logo elektroda
logo elektroda
X
logo elektroda

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

Ipn00tic  14 8292 Cool? (+5)
📢 Listen (AI):

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.
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.



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:

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 )


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 )

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:


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

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"


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

About Author
Ipn00tic wrote 17 posts with rating 6 . Been with us since 2020 year.

Comments

p.kaczmarek2 01 Dec 2022 08:08

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? ... [Read more]

Ipn00tic 02 Dec 2022 11:24

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. https://obrazki.elektroda.pl/4457466000_1669976299_bigthumb.jpg... [Read more]

p.kaczmarek2 02 Dec 2022 11:41

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... [Read more]

Ipn00tic 02 Dec 2022 12:30

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... [Read more]

p.kaczmarek2 02 Dec 2022 12:57

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... [Read more]

enbollo 05 Dec 2022 19:53

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... [Read more]

p.kaczmarek2 05 Dec 2022 23:10

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... [Read more]

enbollo 07 Dec 2022 12:11

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... [Read more]

xenonscrinium 30 Apr 2023 18:50

Hello I have tuya plug like in the first post. https://obrazki.elektroda.pl/5183113500_1682873336_thumb.jpg My config: { "vendor": "Tuya", "bDetailed": "0", "name": "Full Device Name... [Read more]

p.kaczmarek2 30 Apr 2023 18:54

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.... [Read more]

xenonscrinium 30 Apr 2023 18:59

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":... [Read more]

Raufaser 23 Mar 2024 00:36

I got the same plug from Aliexpress. This item Here is the binary of the original firmware: And the template: { "vendor": "Girier", "bDetailed":... [Read more]

divadiow 23 Mar 2024 08:26

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... [Read more]

Raufaser 23 Mar 2024 14:33

I noticed that, but the button is working anyways. What is the advantage of programming the button? [Read more]

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.
%}