libiso15118: Add response msg interval control#1784
libiso15118: Add response msg interval control#1784FaHaGit wants to merge 1 commit intoEVerest:mainfrom
Conversation
3d894d5 to
a010967
Compare
SebaLukas
left a comment
There was a problem hiding this comment.
In general I like the PR. Wait for some time before sending the response is a good idea.
My problem with this implementation is that it blocks the whole process for 100ms.
That could be really a problem in some cases.
I need to think how to fix this problem not blocking the whole process.
|
@SebaLukas what is your opinion on how the delay should be implemented? Would you prefer it to be implemented as it currently is, with a fixed response interval (i.e., keeping the time between two res messages constant), or to wait a fixed amount of time after receiving a request message? The first approach has been implemented here. I think that's quite good because we don't necessarily delay, but only when the EV generates request messages quickly. Or do you think a delay after a response would always be useful in order to have the chance to react to the content of the request message? I can also imagine a hybrid form: max 100ms interval + constant delay (e.g. 50ms) after a request. |
I already worked on a solution for this issue |
|
I would prefer the second option, as a delay here does not block the entire process. I would start a separate timer after sending the response and check this timer after receiving the request to see whether the timer is over 100 ms or not. |
|
Thx for the quick response. I think I've already implemented this as you described it in my local branch (not pushed yet). The problem is that if the EV itself needs 100 ms to send the request message, for example, then the delay timer expires immediately and we generate the response directly without first communicating the request content internally. Hence the proposal for a hybrid solution consisting of a maximum wait time for a request plus a fixed delay. If the EV responds very quickly (e.g. ~0ms), maximum (100+50 ms) = 150 ms is waited for the response to be generated. If the vehicle takes a long time, e.g., 100 ms, then only 50 ms is delayed. |
I think this is actually okay. Do you have an example of what could be problematic if the state machine responds directly to the req message? |
|
I don't have a specific example. I just thought that if there is certain V2G content in a request that causes an internal abort on EVSE side, for example, then the response to this request would only occur in the next response, for example, through a failed response code. I don't have a big problem with that. We can implement it that way for now. As far as I can remember, EvseV2g currently only works with a static delay after a request and does not take into account the time between two response messages. But I think it's smarter to take the request time into account in the delay. |
|
Okay 👍 Lets see if we will have some problems in the future then we can add this extra 50ms. But for now I think we dont need them. |
There are EV implementations that can configure request messages within a few milliseconds, which can currently trigger a flood of internal communication. To avoid performance issues, we should therefore wait a certain amount of time after receiving a request message before sending the next response message. The delay of maximum 100 ms should not cause any problems, as the most critical time of the ISO 15118-20 (V2G_SECC_Msg_Performance_Time of the charging loop) is 250 ms. Changes: - introduce MIN_RESPONSE_INTERVAL_MS to manage time between responses - add last_response_tx_time to track last response timestamp - implement delay to ensure minimum interval between response messages - implement send_response function to streamline response logic - introduce `has_response()` to check for response availability - add `peek_response_meta()` for response metadata inspection Signed-off-by: Fabian Hartung <fabian.hartung@chargebyte.com>
a010967 to
1191a71
Compare
|
The thread should no longer be blocked. Since the processing of requests is currently linked to the configuration of responses, it is unfortunately not possible to easy implement whereby the response is only configured when it is sent. |
Describe your changes
There are EV implementations that can configure request messages within a few milliseconds, which can currently trigger a flood of internal communication. To avoid performance issues, we should therefore wait a certain amount of time after receiving a request message before sending the next response message. The delay of maximum 100 ms should not cause any problems, as the most critical time of the ISO 15118-20 (V2G_SECC_Msg_Performance_Time of the charging loop) is 250 ms.
Already successfully tested in the SIL environment (with a higher delay, because the josev lib based implementation needs ~500ms to configure a request message).
Changes:
Issue ticket number and link
Checklist before requesting a review