Open saimirg opened 3 months ago
Hi @mikuso, we found out the problem is with Pong response. For some reasons Pong response from the charger is considered malformed and servers throws and error which drops the connection. If we disable ping requests from the server everything works fine but this has an effect on other chargers. We tried asking manufacturer to check the pong response but didnt succeed.
Anything else we can do to fix it ?
Hi @saimirg
Were you able to recreate this issue using the WS library? What happens when the WS library receives a malformed pong?
One possible solution might be to set the pingIntervalMs
option to Infinity
when constructing the RPCServer, like so:
const server = new RPCServer({
protocols: ['ocpp1.6'], // server accepts ocpp1.6 subprotocol
strictMode: true, // enable strict validation of requests & responses
pingIntervalMs: Infinity, // disable pings
});
This should stop the server from sending pings, but disables the keepAlive functionality - so you may end up with lingering connections which get "stuck" if they don't cleanly disconnect.
Yes, the same behavior happens with WS library when initiating Ping from server side. An error will be thrown and connection would drop when pong is received.
Setting pingIntervalMs: Infinity (we tried null) will work on this particular charger but has an effect on other chargers. It would be great if we could set it on charger level rather then on server.
Understood. Have you tried using client.reconfigure()
to do this on an individual basis?
Something like...
server.on('client', client => {
if (client.identity === 'badclient') {
client.reconfigure({ pingIntervalMs: Infinity });
}
});
Hi @mikuso, i need some help. I have a specific charger that is dropping connection after one minute. One the following simple code, the charger disconnects after one minute. However, if I connect the charger using the WS library the charger stays connected and i can communicate two ways.
This is the code used where the charger disconnects.
Charger does not disconnect when using this code: