If you have lost the Bluetooth password of a JK inverter BMS, you can read it back over the RS485 port with a Windows PC, a USB-to-RS485 dongle and a small Python script. You can then log in with the JK BMS mobile app and set a new password.
The method has been tested on a JK_PB2A16S20P with hardware version 15A and firmware 15.38. It should work on other JK PB-series inverter BMSs, which use Modbus RTU over RS485. Older JK-B series BMSs use a different serial protocol and are not covered.
RS485 needs no password, and the script only reads data. It does not change any settings in the BMS.
PC: Windows 10 or 11.
USB-to-RS485 dongle: any common type (CH340, FTDI, CP210x). Install the chip's driver if Windows does not recognise it.
Cable: connect A to A and B to B on the BMS's RS485 port (RJ45). If there is no answer, swap A and B.
Python: 3.10 or later from python.org. Tick "Add Python to PATH" during install.
Script:jk_read_password.py.
BMS address: the DIP switches set the RS485 address. Address 0 makes the BMS a master and it will not answer the PC, so use 1 or higher.
Close other software: close JK BMS Monitor before running the script. Only one program can use a COM port at a time.
Install pyserial: python -m pip install pyserial
Plug the dongle directly into the PC, not through a dock or hub.
Find the COM port: python -m serial.tools.list_ports -v
Run the script with your COM port and BMS address: python jk_read_password.py COM7 --addr 2
Read the field Device passcode. That is the Bluetooth password for the JK BMS app.
The password and serial number below are placeholders.
Info frame found (300 bytes):
Vendor ID : JK_PB2A16S20P
HW version : 15A
SW version : 15.38
Device name : 12345678901
Device passcode : 1234
Manufacturing date : 250221
Serial number : 12345678901
Passcode :
User data : JK-BMS
Setup passcode :
Device passcode: the Bluetooth password the app asks for.
Setup passcode: the password for changing settings. If empty, try the factory default 123456.
Manufacturing date: production date as YYMMDD.
Open the JK BMS app and select your battery in the Bluetooth list.
Log in with the Device passcode the script printed.
Go to Settings and then Device Info (on some app versions: Basic Info).
Change the Device Passcode field to the new password and save.
If the app asks for a settings password, use the Setup passcode, or try 123456.
Disconnect and reconnect. The app should now ask for the new password.
Factory defaults are usually 1234 for Bluetooth and 123456 for settings. Try these before wiring up RS485.
You can also change the Bluetooth password directly from the app's device list. You need the current password, for example the one the script read out.
Start the JK BMS mobile app.
Tap the Bluetooth symbol in the top-left corner.

3. Select the battery you want to use in the device list.

4. When the battery is connected, tap the Bluetooth symbol again.

5. Tap the pen symbol next to the connected battery.

6. Enter the old password and then the new password, and confirm.
No module named 'serial': run python -m pip install pyserial.
could not open port ... FileNotFoundError: wrong COM port. List the ports and use the dongle's.
no ports found: dongle not connected or driver missing (often CH340/CH341).
Access denied: another program, such as JK BMS Monitor, is using the port.
No answer: check the DIP address (not 0) and swap A and B.
Bytes received but no info frame: try --baud 9600 and check that the BMS is a PB-series model.
