Skip to content

Commit

Permalink
docs: update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirk Postma committed Jun 5, 2023
1 parent 6029803 commit 2391459
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,24 @@

POC of backoffice for charging stations using OCPP.

`yarn ts-node ./src/server.ts`
## Setup charging station

- `yarn ts-node ./src/server.ts`
- configure charging station backoffice URL to: `https://<ip of development system>:9220/`

## API

A webserver is started on port 3000. Following endpoints are available:

`GET /`
Check if this API server is up

`GET /stations`
List registered stations

`POST /reboot/<stationId>`
Reboot command to station. Note: id is the configured stations name. Not suitable as real id.

`GET /station/<stationId>/config/<configKey>`
Fetch value of some configuration key.
Example: `GET http://localhost:3000/station/DIRK-1001/config/DeviceIdentifier`
4 changes: 2 additions & 2 deletions src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ centralSystemSimple.on("connection", (client: OcppClientConnection) => {
const id = client.getCpId();

const newStation: Station = {
id,
id,
client,
meterValues: [],
};
Expand Down Expand Up @@ -138,7 +138,7 @@ app.get("/stations", (req, res) => {
res.send(strippedStations);
});

app.get("/reboot/:id", (req, res) => {
app.post("/reboot/:id", (req, res) => {
const id = req.params.id;
console.log(`webserver: incoming request: /reboot/${id}`);

Expand Down

0 comments on commit 2391459

Please sign in to comment.