UDS-Scanner - Add packet delay
Hi all,
currently, I'm investigating an ECU, which has some issues when too many packets are being sent. Maybe some buffers are running full. The ECU stops responding, a restart is required.
This also happens when using UDS_Scanner.
I solved this by adding a small sleep in /scapy/contrib/automotive/scanner/enumerator.py
def execute(self, socket, state, **kwargs):
[...]
for req in it:
time.sleep(0.05)
res = self.sr1_with_retry_on_error(req, socket, state, timeout)
[...]
I don't know if this is a widespread issue, but maybe it's useful adding a configurable packet delay to UDS_Scanner
Thanks for the feedback. Could you please submit a PR? I think a proper name for such an argument would be inter to follow the naming of Scapys sr1 function. Also, the sleep should be after the sr1 function inside the execute.
However, I'm wondering why your ECU is not slowing down the communication with the FlowControl options on ISOTP. Are your sure, the bug in your ECU is related to UDS and not to ISOTP?
Another question,
have you tried to use the argument
:param frame_txtime: Separation time between two CAN frames during send
on your ISOTPSocket?
Closed because of inactivity
Actually, I will provide a pr soon