JK BMS
SK EN DE

Hardware & setup

Prepare the board and wiring following the guide below, then flash the firmware from your browser in the Automatic Setup section.

Required hardware

The gateway needs an ESP32 board, an RS485 transceiver, and (optionally) a CAN transceiver, wired per the tables below. The exact pin numbers are defined in the firmware's src/BoardPins.h — change them there if you wire it differently.

What you need

Optional: a ready-made KiCad carrier board combining the ESP32 DevKit, both transceivers, screw terminals (CAN, RS485, power) and a WiFi status LED on one board sized for a DIN-rail housing.

Wiring: MAX485 (RS485) → ESP32

MAX485 pinESP32 pinESP32-S3 pinNotes
VCC3.3VBoth transceivers are native 3.3V parts — don't power them from 5V, it could overdrive the ESP32's RX pin.
GNDGND
DI (driver in)GPIO17 (TX2)
RO (receiver out)GPIO16 (RX2)
DE + RE (tied together)GPIO4HIGH = transmit, LOW = receive
ABMS RS485-A (RJ45 pin 2/7)
BBMS RS485-B (RJ45 pin 1/8)

Wiring: SN65HVD230 (CAN) → ESP32

SN65HVD230 pinESP32 pinESP32-S3 pinNotes
3 VCC3.3VBoth transceivers are native 3.3V parts — don't power them from 5V, it could overdrive the ESP32's RX pin.
2 GNDGND
1 D (TXD)GPIO25GPIO5CAN_TX_PIN
4 R (RXD)GPIO26GPIO6CAN_RX_PIN
8 Rs10 kΩ → GND
5 Vref—
7 CANH / 6 CANLBMS CAN-H / CAN-L

BMS combined 485/CAN port (RJ45)

The JK-PB2A16S20P has one combined "485/CAN" RJ45 port that carries both buses at once:

RJ45 pinSignal
1, 8RS485-B
2, 7RS485-A
3NC
4CAN-H
5CAN-L
6GND

The carrier board has screw terminals instead of RJ45 jacks. Wire a cut RJ45 cable (or an RJ45 breakout adapter) to them like this:

RJ45 pinBoard terminal
4 (CAN-H)J3 pin 1 (CH)
5 (CAN-L)J3 pin 2 (CL)
6 (GND)J3 pin 3 / 4 (GND), J4 pin 3 (GND)
2, 7 (RS485-A)J4 pin 4 (A)
1, 8 (RS485-B)J4 pin 5 (B)

Board power: terminal J4, pin 1 = VIN+ (7–60 V), pin 2 = GND; pin 6 is unused. Terminal pins are numbered left to right as seen from the wire side of that edge. Terminal J4 is protected against reversed polarity by the series diode D3 — wired backwards the board simply stays dark.

Important notes

Automatic Setup — JK BMS Web Gateway

For classic ESP32 boards (ESP32-WROOM-32, 4 MB flash). Have an ESP32-S3? Use the “JK BMS S3” tab.

⚠️ We are not responsible for any damage caused by improper use!

Version offered: R1-V1.03s

We recommend Google Chrome or Microsoft Edge — the Web Serial API works there with no extra setup. In Firefox you need to enable serial-port access first (an experimental feature, turned on via about:config → dom.serial.enabled), otherwise the button below won't work.

From version R1-V1.03p (JK BMS) and R1-V1.01m (DEYE) the gateway updates itself from its dashboard: press Check for newer firmware in the footer. You then need this page only for the first installation or when an update fails.

Step-by-step

  1. Connect the ESP32 board to your computer with a USB cable (on an ESP32-S3-DevKitC-1 use the USB port labelled UART).
  2. Click "Connect and flash" and allow the browser's serial-port permission prompt.
  3. Select the "JK BMS Web Gateway" install and confirm.
  4. Wait about 2 minutes for the firmware and filesystem to finish flashing.
  5. The device reboots into the "JK-BMS-Setup" WiFi portal — connect to it and enter your home WiFi details.
Connect and flash

You must be signed in to download or flash.

Manual Setup — JK BMS Web Gateway

If the automatic browser-based update doesn't work for you, you can also run the update from the command line / PowerShell — just change the PORT number your ESP32 board is listening on.

Flash the files below with:

esptool.py --chip esp32 --port PORT write_flash \
  0x1000 bootloader.bin \
  0x8000 partitions.bin \
  0xe000 boot_app0.bin \
  0x10000 firmware.bin \
  0x290000 littlefs.bin

You must be signed in to download or flash.

Automatic Setup — JK BMS Web Gateway (ESP32-S3)

For ESP32-S3-DevKitC-1 N8R2 boards (8 MB flash, more headroom for future features). Have a classic ESP32? Use the “JK BMS” tab.

⚠️ We are not responsible for any damage caused by improper use!

Version offered: R1-V1.03s

We recommend Google Chrome or Microsoft Edge — the Web Serial API works there with no extra setup. In Firefox you need to enable serial-port access first (an experimental feature, turned on via about:config → dom.serial.enabled), otherwise the button below won't work.

From version R1-V1.03p (JK BMS) and R1-V1.01m (DEYE) the gateway updates itself from its dashboard: press Check for newer firmware in the footer. You then need this page only for the first installation or when an update fails.

Step-by-step

  1. Connect the ESP32 board to your computer with a USB cable (on an ESP32-S3-DevKitC-1 use the USB port labelled UART).
  2. Click "Connect and flash" and allow the browser's serial-port permission prompt.
  3. Select the "JK BMS Web Gateway (ESP32-S3)" install and confirm.
  4. Wait about 2 minutes for the firmware and filesystem to finish flashing.
  5. The device reboots into the "JK-BMS-Setup" WiFi portal — connect to it and enter your home WiFi details.
Connect and flash

You must be signed in to download or flash.

Manual Setup — JK BMS Web Gateway (ESP32-S3)

If the automatic browser-based update doesn't work for you, you can also run the update from the command line / PowerShell — just change the PORT number your ESP32 board is listening on.

Flash the files below with:

esptool.py --chip esp32s3 --port PORT write_flash \
  0x0 bootloader.bin \
  0x8000 partitions.bin \
  0xe000 boot_app0.bin \
  0x10000 firmware.bin \
  0x670000 littlefs.bin

You must be signed in to download or flash.

Automatic Setup — DEYE Web Gateway

⚠️ We are not responsible for any damage caused by improper use!

Version offered: R1-V1.01w

We recommend Google Chrome or Microsoft Edge — the Web Serial API works there with no extra setup. In Firefox you need to enable serial-port access first (an experimental feature, turned on via about:config → dom.serial.enabled), otherwise the button below won't work.

From version R1-V1.03p (JK BMS) and R1-V1.01m (DEYE) the gateway updates itself from its dashboard: press Check for newer firmware in the footer. You then need this page only for the first installation or when an update fails.

Step-by-step

  1. Connect the ESP32 board to your computer with a USB cable (on an ESP32-S3-DevKitC-1 use the USB port labelled UART).
  2. Click "Connect and flash" and allow the browser's serial-port permission prompt.
  3. Select the "DEYE Web Gateway" install and confirm.
  4. Wait about 2 minutes for the firmware and filesystem to finish flashing.
  5. The device reboots into the "DEYE-Setup" WiFi portal — connect to it and enter your home WiFi details.
Connect and flash

You must be signed in to download or flash.

Manual Setup — DEYE Web Gateway

If the automatic browser-based update doesn't work for you, you can also run the update from the command line / PowerShell — just change the PORT number your ESP32 board is listening on.

Flash the files below with:

esptool.py --chip esp32 --port PORT write_flash \
  0x1000 bootloader.bin \
  0x8000 partitions.bin \
  0xe000 boot_app0.bin \
  0x10000 firmware.bin \
  0x290000 littlefs.bin

You must be signed in to download or flash.