-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
udsoncan.exceptions.TimeoutException: Did not receive response in time. P2 timeout time has expired #238
Comments
It means that the device did not respond and there is a timeout while waiting for the response. We can see in the can log that there is indeed no response, a message with the second byte set to 99 should appear |
but the device works fine. I can get the DTC by using cantool/busmaster and this device. |
Can show me a log that works and a log that does not? |
2 things
|
Ok, |
Also, I noticed that the bad log uses a different status mask. The device should respond anyway, but I wanted to point it out. 2F vs AF |
Thank you for the update. Indeed this parameter might be useful to you. Cheers |
Thanks for your help ! isotp_params = { |
Hi,ep081106 |
Hello pylessard:
I want to use the ETAS 582.1 to read the DTC, but i got this error:
udsoncan.exceptions.TimeoutException: Did not receive response in time. P2 timeout time has expired (timeout=1.000 sec);
this is my code:
readTheDTCBy582.txt
then I got the following error:
"D:\Software\Program Files (x86)\Python39-32\python.exe" D:\Software\Python_Scripts\PythonProject\UdsOnCan_RE300\UDSdemo_582_noUDSOnCan_V0.1_20240614.py
{'interface': 'etas', 'channel': 'ETAS://USB/ES582.1:115287/CAN:1'}
{'interface': 'etas', 'channel': 'ETAS://USB/ES582.1:115287/CAN:2'}
{'interface': 'etas', 'channel': 'ETAS://USB/VN1630:36922/CAN:2'}
{'interface': 'etas', 'channel': 'ETAS://USB/VN1630:36922/CAN:3'}
{'interface': 'etas', 'channel': 'ETAS://USB/VN1630:36922/CAN:4'}
{'interface': 'etas', 'channel': 'ETAS://VIRTUAL:VXL/CANCARD:0/CAN:1'}
{'interface': 'etas', 'channel': 'ETAS://VIRTUAL:VXL/CANCARD:0/CAN:2'}
CHANNEL_1:ETAS://USB/ES582.1:115287/CAN:1
CHANNEL_2:ETAS://USB/ES582.1:115287/CAN:2
bus:ETAS://USB/ES582.1:115287/CAN:1
Source path:... D:\Software\Python_Scripts\PythonProject\UdsOnCan_RE300\UDSdemo_582_noUDSOnCan_V0.1_20240614.py
16:34:10.038022 call 75 def read_dtcs_and_snapshots():
16:34:10.039526 line 76 with Client(conn, request_timeout=100, config=configRE300) as client: # Application layer (UDS protocol)
Source path:... D:\Software\Program Files (x86)\Python39-32\lib\site-packages\udsoncan\client.py
Starting var:.. self = <udsoncan.client.Client object at 0x04279148>
Starting var:.. conn = <udsoncan.connections.PythonIsoTpConnection object at 0x0425DAD8>
Starting var:.. config = {'exception_on_negative_response': True, 'except...server_timing': True, 'extended_data_size': None}
Starting var:.. request_timeout = 100
16:34:10.039526 call 112 def init(self, conn: BaseConnection, config: ClientConfig = default_client_config, request_timeout: Optional[float] = None):
16:34:10.040525 line 113 self.conn = conn
16:34:10.040525 line 114 self.config = cast(ClientConfig, dict(config)) # Makes a copy of given configuration
16:34:10.040525 line 117 if request_timeout is not None:
16:34:10.040525 line 118 self.config['request_timeout'] = request_timeout
16:34:10.040525 line 119 self.suppress_positive_response = Client.SuppressPositiveResponse()
16:34:10.040525 line 120 self.payload_override = Client.PayloadOverrider()
16:34:10.041525 line 121 self.last_response = None
16:34:10.041525 line 123 self.session_timing = dict(p2_server_max=None, p2_star_server_max=None)
16:34:10.041525 line 125 self.refresh_config()
16:34:10.041525 return 125 self.refresh_config()
Return value:.. None
Starting var:.. self = <udsoncan.client.Client object at 0x04279148>
16:34:10.041525 call 127 def enter(self):
16:34:10.041525 line 128 self.open()
16:34:10.044525 line 129 return self
16:34:10.045263 return 129 return self
Return value:.. <udsoncan.client.Client object at 0x04279148>
Source path:... D:\Software\Python_Scripts\PythonProject\UdsOnCan_RE300\UDSdemo_582_noUDSOnCan_V0.1_20240614.py
New var:....... client = <udsoncan.client.Client object at 0x04279148>
16:34:10.045263 line 77 response = client.get_dtc_by_status_mask(status_mask)
Source path:... D:\Software\Program Files (x86)\Python39-32\lib\site-packages\udsoncan\client.py
Starting var:.. self = <udsoncan.client.Client object at 0x04279148>
Starting var:.. status_mask = 47
16:34:10.045263 call 1243 def get_dtc_by_status_mask(self, status_mask: int) -> Optional[services.ReadDTCInformation.InterpretedResponse]:
16:34:10.045690 line 1258 return self.read_dtc_information(services.ReadDTCInformation.Subfunction.reportDTCByStatusMask, status_mask=status_mask)
2024-06-15 16:34:10 [INFO] Connection: Connection opened
2024-06-15 16:34:10 [INFO] UdsClient: ReadDTCInformation<0x19> - Sending request with subfunction "reportDTCByStatusMask" (0x02).
2024-06-15 16:34:54 [DEBUG] Connection: Sending 3 bytes : [19022f]
"it took 44s to send the message"
2024-06-15 16:34:55 [DEBUG] Connection: No data received: [TimeoutException] - Did not receive IsoTP frame from the Transport layer in time (timeout=1 sec)
2024-06-15 16:34:55 [ERROR] UdsClient: [TimeoutException] : Did not receive response in time. P2 timeout time has expired (timeout=1.000 sec)
2024-06-15 16:34:55 [INFO] Connection: Connection closed
16:34:55.656008 exception 1258 return self.read_dtc_information(services.ReadDTCInformation.Subfunction.reportDTCByStatusMask, status_mask=status_mask)
Exception:..... udsoncan.exceptions.TimeoutException: Did not re.... P2 timeout time has expired (timeout=1.000 sec)
Call ended by exception
Source path:... D:\Software\Python_Scripts\PythonProject\UdsOnCan_RE300\UDSdemo_582_noUDSOnCan_V0.1_20240614.py
16:34:55.657476 exception 77 response = client.get_dtc_by_status_mask(status_mask)
Exception:..... udsoncan.exceptions.TimeoutException: Did not re.... P2 timeout time has expired (timeout=1.000 sec)
16:34:55.657476 line 133 log_file.write('---------------------------End to read the Snapshot---------------------------' + '\n\n')
Source path:... D:\Software\Program Files (x86)\Python39-32\lib\site-packages\udsoncan\client.py
Starting var:.. self = <udsoncan.client.Client object at 0x04279148>
Starting var:.. type = <class 'udsoncan.exceptions.TimeoutException'>
Starting var:.. value = TimeoutException('Did not receive response in ti...P2 timeout time has expired (timeout=1.000 sec)')
Starting var:.. traceback = <traceback object at 0x0426B608>
16:34:55.657476 call 131 def exit(self, type, value, traceback):
16:34:55.657476 line 132 self.close()
16:34:55.669341 return 132 self.close()
Return value:.. None
Source path:... D:\Software\Python_Scripts\PythonProject\UdsOnCan_RE300\UDSdemo_582_noUDSOnCan_V0.1_20240614.py
Call ended by exception
Elapsed time: 00:00:45.631319
Traceback (most recent call last):
File "D:\Software\Python_Scripts\PythonProject\UdsOnCan_RE300\UDSdemo_582_noUDSOnCan_V0.1_20240614.py", line 136, in
read_dtcs_and_snapshots()
File "D:\Software\Program Files (x86)\Python39-32\lib\site-packages\pysnooper\tracer.py", line 305, in simple_wrapper
return function(*args, **kwargs)
File "D:\Software\Python_Scripts\PythonProject\UdsOnCan_RE300\UDSdemo_582_noUDSOnCan_V0.1_20240614.py", line 77, in read_dtcs_and_snapshots
response = client.get_dtc_by_status_mask(status_mask)
File "D:\Software\Program Files (x86)\Python39-32\lib\site-packages\udsoncan\client.py", line 1258, in get_dtc_by_status_mask
return self.read_dtc_information(services.ReadDTCInformation.Subfunction.reportDTCByStatusMask, status_mask=status_mask)
File "D:\Software\Program Files (x86)\Python39-32\lib\site-packages\udsoncan\client.py", line 176, in decorated
return func(self, *args, **kwargs)
File "D:\Software\Program Files (x86)\Python39-32\lib\site-packages\udsoncan\client.py", line 1726, in read_dtc_information
response = self.send_request(request)
File "D:\Software\Program Files (x86)\Python39-32\lib\site-packages\udsoncan\client.py", line 2187, in send_request
raise TimeoutException('Did not receive response in time. %s time has expired (timeout=%.3f sec)' %
udsoncan.exceptions.TimeoutException: Did not receive response in time. P2 timeout time has expired (timeout=1.000 sec)
could you please give me some help to fix it? thanks very much!
The text was updated successfully, but these errors were encountered: