Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,7 @@ dist

# Claude Code
CLAUDE.md

# Virtual Charge Point Persistence
vcp.db
test-persistence.ts
41 changes: 23 additions & 18 deletions index_16.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,28 @@ const vcp = new VCP({
ocppVersion: OcppVersion.OCPP_1_6,
basicAuthPassword: process.env.PASSWORD ?? undefined,
adminPort: Number.parseInt(process.env.ADMIN_PORT ?? "9999"),
bootSequence: async (vcpConfig) => {
vcpConfig.send(
bootNotificationOcppMessage.request({
chargePointVendor: "Solidstudio",
chargePointModel: "VirtualChargePoint",
chargePointSerialNumber: "S001",
firmwareVersion: "1.0.0",
}),
);
vcpConfig.send(
statusNotificationOcppMessage.request({
connectorId: 1,
errorCode: "NoError",
status: "Available",
}),
);
}
});

(async () => {
await vcp.connect();
vcp.send(
bootNotificationOcppMessage.request({
chargePointVendor: "Solidstudio",
chargePointModel: "VirtualChargePoint",
chargePointSerialNumber: "S001",
firmwareVersion: "1.0.0",
}),
);
vcp.send(
statusNotificationOcppMessage.request({
connectorId: 1,
errorCode: "NoError",
status: "Available",
}),
);
})();
// The VCP starts its Admin Web Server on instantiation.
// We no longer automatically call vcp.connect() here.
// Connections are driven via the web dashboard.
console.log(`[VCP] Node initialized. Waiting for connection trigger from Web Dashboard (Port ${process.env.ADMIN_PORT ?? 9999})`);


Loading