r/ocpp • u/dragoshade • Aug 03 '26
Thoughts on OCPP message timeouts?
I have previously gone under the assumption that 10s for a round trip of an OCPP (1.6J) message [CALL -> RESULT] would be more than enough for both IP and Cellular based. Though I recently encountered a CSMS where the RESULT was coming in 10-80s after the CALL for some messages.
It made me wonder what are peoples thoughts on timing out an OCPP message and moving on to the next one in the queue? There is a tradeoff of course, the standard doesn't have an upper or lower limit, just a suggestion for your given implementation.
Not worried too much about if I have chosen the "correct" time, it has worked for 5 years. Just about peoples thoughts and experiences of timeouts. Keeping in mind that some CSMS's don't actually respond to messages they don't know about (such as SecurityEventNotification). Delays to Authorization and StartTransaction that can negativly impact the UX with a charger, etc.
EDIT: I am the EVSE in this instance, waiting the duration for the CSMS to respond
2
u/dark_bits Aug 03 '26
I'd frame timeout questions based on the request context. For OCPP, a 10 seconds timeout sounds better to me. At least far better than 80 seconds.
Also, OCPP defines a
NotImplementederror code, I'm new to this field but I'm guessing key players do support it?2
u/mememeier Aug 03 '26
CSMS vendor here. You mentioned Authorize as one you would timeout after 10s, I would suggest that is too quick.
If roaming is involved, it can in some cases take more than 10s to get response on an IdTag for all eMSPs. So you could leave the user not being able to authorize via roaming with their slow eMSP if you timeout after 10s.
3
u/Draynios Aug 03 '26
I am maintaining a CSMS, most of our EVSE initiated messages take less than a second for the full round trip. Almost all of our CSMS initiated messages are fire-and-forget, I dont really care how long the EVSE takes to i.e. send its GetConfiguration.conf, aslong as the OCPP connection is still active we will accept it.
But for the cases where we need a timeout its somewhere between 10 and 30 seconds, depending on the action.
From a enduser UX standpoint I would expect my EVSE to take AT MOST 10 seconds between scanning my RFID and starting or failing the transaction.
2
u/sevketgokay Aug 06 '26
Disclosure: CSMS person here. I am the maintainer of SteVe, and co-founder of Powerfill.
We should keep in mind that network quality varies significantly across regions. Unreliable mobile connectivity, temporary congestion, and similar conditions can all increase latency.
It is also important to align the behavior and expectations of the station and the CSMS. Many OCPP operations are effectively stateless, so timeouts and retries are relatively harmless. Others, however, are stateful: the receiver changes its state while processing the request. For example, if CSMS responded to StartTransaction in 13 seconds (for whatever reason) whereas the station timeout was 10 seconds, the station may discard or ignore the late response. From the CSMS’s perspective, however, the transaction has already started and CSMS triggered necessary bookkeeping. This leaves a dangling or "ghost" transaction on the CSMS side, requiring additional care and reconciliation, such as compensating or rollback actions to straighten out the state. Unpleasant.
We encountered the reverse situation with one client: their stations usually took longer to respond than our configured timeout, so their responses were discarded when they eventually arrived. Yet the caller is the party that benefits from receiving the result. If the caller never sees it, the user experience suffers. Imagine sending a GetConfiguration request to a station but never being able to view the returned configuration.
My current position, therefore, is to keep timeouts as generous as reasonably possible... but just under where it starts to hurt :)
1
u/Sheo42 Aug 04 '26
Charging station vendor here: we have set it to 10s as a default timeout. We have dozens of thousands of charging stations on the field. It can be changed but people don't, AFAIK