Repository navigation
Description
What happened?
Settings → Chargers → OCPP connection settings stays on "Checking the OCPP server…" the first time the tab is opened. It never shows the Set up OCPP button, the server form, the URL to give the charger, or connected charge points. Switching to another Settings tab and back shows the real content.
This happens whether OCPP is off or on, and with a charger online. A user who wants to connect an OCPP charger sees nothing to act on. A go-e owner on Discord (26 November) reported "FTW does not generate any connection settings", which may be this bug.
Steps to reproduce
- Start FTW with no config and finish the setup wizard without adding devices.
- Open ⚙ → Chargers → expand OCPP connection settings. It shows "Checking the OCPP server…" and stays there.
GET /api/ocpp/chargersanswers at once:{"enabled":false,"chargers":[]}.- Switch to Cars, then back to Chargers. Set up OCPP appears.
- Turn OCPP on, set a password, save, restart and reload the page. Connect an OCPP charger (
sim-ocpp -model go-e-gemini-flex -plug). On the first open of the tab, the panel is stuck again even though the API lists the charger as pending.
Expected behavior
When /api/ocpp/chargers answers, the panel shows the result.
Version
master at 2b9db2a (v0.171).
Deployment
Local build: Linux binary in WSL2 (CGO_ENABLED=0), Chrome 158.
Hardware / drivers in use
None; go/cmd/sim-ocpp with model go-e-gemini-flex (OCPP 1.6J).
Anything else?
Likely cause
In web/settings/tabs/loadpoints.js, the /api/ocpp/chargers response stores the status in S.ocppStatus and calls refreshTab() to redraw. refreshTab() returns at once when #new-lp-driver (the Add charger dropdown) is not on the page:
function refreshTab() {
var idInput = document.getElementById('new-lp-id');
var driverInput = document.getElementById('new-lp-driver');
if (!driverInput) return;On the first render that dropdown is missing, so the tab is not redrawn. S._ocppStatusRaw is already set, so later fetches with the same answer also skip the redraw. Leaving the tab and coming back renders from the stored S.ocppStatus, which is why switching tabs fixes it. The catalog fetch calls refreshTab() too, so it is probably dropped the same way.
Possible fix: when the dropdown is missing, still call ctx.captureCurrentTab() and ctx.renderTab('loadpoints'), and only skip restoring the typed values.
Small related observation
After a charger is adopted, the Add charger dropdown still offers the same OCPP id, so it can be added a second time.
Activity