Comments (9)
Ohhh my bad, sorry. I somehow was conviced you were parsing DIDs, but your not. I see, I see.
Well.. your server is wrong here. It seems to encode the subfunction on a 16 bits ID. It should be 8bits.
See the standard
from python-udsoncan.
I have push a correction so that the reported error is better.
Here : a4b4047
from python-udsoncan.
EDIT. The below answer is wrong. I was confused
Hi
You title talks about "interpret_response" but in your code example, you decode the response yourself. Not sure what,s going on here.
For the explanation, your can response can be dissected like this:
- 07 - isotp header. length of 7 bytes
- 50 - service ID with bit 7 set to 1 (0x40 | 0x10)
- 0200 - DID id in a 16bits field
- 3201f404 : you did payload, which is indeed 4 bytes long.
Cheers
from python-udsoncan.
Thanks you for the quick answer.
I am not sure I understand what you mean by decoding yourself.
When the UDS server device answer, I have the error "struct.error: unpack requires a buffer of 4 bytes"
it's coming from (a, b) = struct.unpack('>HH', response.data[1:])
If I print (response.data[1:])
I have 5 bytes instead of 4.
Could it be possible that my DID configuration client is 1byte instead of 2? So I have a 5bytes long payload?
from python-udsoncan.
I am sorry, I was sure the server part was reliable... that's the reason I was looking at the library.
Merci beaucoup pour le support ! ;)
from python-udsoncan.
That's the purpose of the library, finding those defects :) Glad it helped
Cheers
from python-udsoncan.
Hi Pylessard,
I have another strange behavior but I can't find if it's coming from client or server. I already used ReadDataByIdentifier on others DID, so it's surprising.
Here are the Log :
2024-02-09 09:26:53 [INFO] Connection: Connection opened
2024-02-09 09:26:53 [INFO] UdsClient: ReadDataByIdentifier<0x22> - Reading data identifier : 0xf080 (VehicleManufacturerSpecific)
2024-02-09 09:26:53 [DEBUG] Connection: Sending 3 bytes : [22f080]
2024-02-09 09:26:53 [DEBUG] Connection: Received 25 bytes : [62f080985513198000b09855131980ffffffffff01ffffffff]
2024-02-09 09:26:53 [INFO] UdsClient: Received positive response for service ReadDataByIdentifier (0x22) from server.
2024-02-09 09:26:53 [ERROR] UdsClient: [InvalidResponseException] : ReadDataByIdentifier service execution returned an invalid response. Response given by server is incomplete.
2024-02-09 09:26:53 [INFO] Connection: Connection closed
The exchange seems allright because it expect 25 bytes (0x19) and receive 25 bytes.
To better understand, I recorded the traffic, but everything seems good
ID=1711,Type=D,Length=8,Data=0322F080
ID=1679,Type=D,Length=8,Data=101962F080985513
ID=1711,Type=D,Length=8,Data=300820
ID=1679,Type=D,Length=8,Data=21198000B0985513
ID=1679,Type=D,Length=8,Data=221980FFFFFFFFFF
ID=1679,Type=D,Length=6,Data=2301FFFFFFFF
Do you want me to open another topic?
Thanks a lot
from python-udsoncan.
The problem seems to come from here :
At this moment, "len(response.data)" is 24 bytes ( 25 bytes minus 0x62 answer )
The offset+1 is 24 as well
from python-udsoncan.
Ok, nevermind. It come from the length I send
Really sorry to have disturb you. :(
from python-udsoncan.
Related Issues (20)
- cannot import name 'Literal' from 'typing' (/usr/lib/python3.7/typing.py) HOT 8
- Act as server and parse python-can messages HOT 6
- No data received: [TimeoutException] Problem HOT 12
- ReadDataByIdentifier: no codec.encode() ? HOT 6
- Security access SAPR response not correctly interpreted HOT 3
- WriteDataByIdentifier service execution returned a negative response IncorrectMessageLengthOrInvalidFormat (0x13) when data length is correct HOT 4
- Adding parameter to Communication Control Service(0x28) HOT 10
- SecurityAccess mishandes a level value of 0 HOT 3
- SocketConnection cannot be closed HOT 7
- P2 timer issue on client.transfer_data(block_number, data HOT 25
- Runtime Error: Connection is not open HOT 2
- TimeoutError: timed out HOT 3
- Problem with waiting time to response longer than 1,658 seconds HOT 2
- isotp error handler not propagated to uds connection HOT 3
- Unable to read continuous frames HOT 1
- TimeoutException and request timeout not respected? HOT 9
- Slow response on Windows for transfer data HOT 11
- udsoncan.exceptions.TimeoutException: Did not receive response in time. P2 timeout time has expired HOT 13
- Can I use multiple RX addresses ? HOT 9
- Transport layer frame capture problem HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-udsoncan.