Change PIN, changing WiFi and a forgotten PIN
Applies to the JK BMS Web Gateway from version R1-V1.03n and the DEYE Web Gateway
from version R1-V1.01k. Both gateways work the same way; only the name of the
setup WiFi differs: JK-BMS-Setup for JK BMS, DEYE-Setup
for DEYE.
What the PIN protects
Every change on the gateway needs the PIN: BMS or inverter settings, web server settings, changing WiFi, entering or removing the licence. Reading data does not, so the dashboard and Home Assistant show values without it.
- The factory PIN is
666666. - You can change it to any 4 to 8 digits.
- It cannot be switched off.
- After 5 wrong PINs in a row the gateway refuses every change for 60 seconds.
666666
is in use, the dashboard reminds you every time it loads.
How to change the PIN
- Open the gateway's dashboard in a browser.
- In the menu (☰) choose Web server settings.
- Under PIN for changes enter the current PIN, the new PIN and the new PIN again.
- Press Change PIN.
The browser remembers the PIN. On another device the dashboard asks for it at the first change.
Moving the gateway to another WiFi network
If you know the PIN and can reach the gateway:
- In the dashboard press Change WiFi network and enter the PIN.
- The gateway forgets the network, restarts and opens the WiFi
JK-BMS-SetuporDEYE-Setup. - Connect to it with your phone. A page opens where you pick your network and enter its password.
- The gateway joins the new network. The PIN stays as it was.
Forgotten PIN, or the gateway cannot reach its old WiFi
Use the BOOT button on the ESP32 board (next to the USB connector, sometimes labelled IO0). You need physical access to it, so nobody can get around the PIN this way from the network.
- Hold BOOT for 5 seconds. It works while running and right after power-up.
- The gateway forgets the saved WiFi network and puts the PIN back to
666666. - It restarts and opens the WiFi
JK-BMS-SetuporDEYE-Setup. - Set up WiFi as on the first start.
- Open the dashboard and change the PIN straight away, as described above.
The licence and the BMS, CAN, inverter and web server settings are kept. Only the WiFi network and your own PIN are lost.
For developers and scripts
Reading through the REST API (GET) works without the PIN. Every
POST must send the X-PIN header with the PIN and
Content-Type: application/json. Without the PIN or with a wrong one
the gateway answers 401, after 5 mistakes 429. The PIN
is changed with POST /api/pin and the body
{"newPin": "1234"}. Details are in the
REST API documentation.
curl -X POST http://jkbms.local/api/server-config \
-H "Content-Type: application/json" \
-H "X-PIN: 666666" \
-d '{"pollIntervalMs": 5000}'
The Home Assistant integration only reads, so it needs no PIN.