WebSocketPingInterval configuration for JSON charge points
Source: "OCPP implementation guide SOAP - RC1 0.6" and in section "8. Configuration"
Currently ping-pong is done at fixed intervals [1] under the covers without allowing the user to change any configuration [2].
One major issue implementing this feature is, how to cleanly seperate between SOAP and JSON logic, (since this feature would only apply to JSON charge points), while keeping the frontend the same.
[1] https://github.com/RWTH-i5-IDSG/steve/blob/master/src/main/java/de/rwth/idsg/steve/config/WebSocketConfiguration.java#L45 [2] https://github.com/RWTH-i5-IDSG/steve/blob/master/src/main/java/de/rwth/idsg/steve/ocpp/ws/AbstractWebSocketEndpoint.java#L92-L96
At least it would be nice to make it possible to disable the websocket ping-pong.
@lategoodbye why do you want to disable it? I am not against the idea, but just want to understand the use case.
It is common to use OCPP over a mobile connection, which means we should avoid unnecessary traffic at all costs. According to OCPP JSON spec the WebSocket Ping isn't a replacement for the Heartbeat and so considered as not necessary.
Currently i don't plan to use SteVe in such a production environment, but i would be able to test under real condition.
The OCPP heartbeat is sent only every couple hours for the stations i know. That time is too long to prevent a connection being dropped by the CGN-NAT system. And if the connection is dropped it needs to be restablished which is costly in terms of traffic. So preventing the Websocket ping/pong would probably increase the amount of traffic and also might introduce additonal message delay.
@csamsel heartbeat interval is part of the OCPP "ChangeConfiguration" message which can be set freely by the user. the decision of what is too long or short is the responsibility of the user. by the same token, the spec allows to change or disable the WebSocketPingInterval. if the user wishes to disable it, so be it. but then he/she has to accept possible disadvantageous outcomes like connections drops. it would still be better that we as the provider let the user do whatever he/she wants.
Hm, according to the spec WebSocketPingInterval only configures the ping on the client side. But i meant the ping on the server side. Sorry for the confusion, should i open a new issue?
@lategoodbye not necessary. we can track and discuss all websocket ping related issues here.
ocpp spec does not further specify server-side pings (as is the case with steve). the only sentence i could find is: "... or the server initiates the ping and client responds with Pong."