I'm creating an OCPP server, using the node-ts-ocpp library.
This is the code:
import{ OcppServer, OcppClientConnection, BootNotificationRequest, BootNotificationResponse } from '@extrawest/node-ts-ocpp'
const simpleCentralSystem = new OcppServer()
simpleCentralSystem.listen(9220)
console.log("Corriendo en 9220 :)")
simpleCentralSystem.on('connection', (client: OcppClientConnection) =>{
console.log(`Cliente ${client.getCpId()} conectado`)
client.on('close', (code: number, reason: Buffer) =>{
console.log(`El cliente ${client.getCpId()} se desconectó`, code, reason.toString())
})
client.on('BootNotification', (request: BootNotificationRequest, cb: (response: BootNotificationResponse) => void) => {
const response: BootNotificationResponse = {
status: 'Accepted',
currentTime: new Date().toISOString(),
interval: 60,
};
cb(response);
});
})
Now my problem is that I can only connect to this server the simulator that comes in the examples of the library, but cannot connect a physical charger or this simulator.