Comments (13)
Hi Aasai.
How familiar are you with UDS? From the code sample you sent you are trying to communicate with an ECU with the IDs the same as an Embed E400 bootloader.
What specific exception are you getting? If you print out the exception message in your catch it will give more of an idea as to the problem. It's likely either a timeout if you have the wrong IDs or a problem setting up the interface.
A few things to check:
- Have you set up an application in the vector hardware setup? If not then the sample code will likely fail.
- What are the request and response IDs of the device you are trying to communicate with? For example almost vehicle power train modules have IDs 0x7E0 for request and 0x7E8 for response.
from python-uds.
Hi Aasai.
Sorry, I sent that email when i got the first email but you've added more info since then.
it should be "CAN" instead of "can" in "transportProtocol=can"
ECU_Serial_no = Uds(transportProtocol="CAN", reqId=0x537, resId=0x53F)
Would be the correct format
It might be more sensible for me to do a toUpper or toLower on the string when creating the instance from the tpFactory class.
Try that and let me know if it works.
Rich.
from python-uds.
Hi Aasai
I tested it on a 1630 and cancasexl.
Try changing the channel to 1 in the constructor. I think it might be zero indexed and you've assigned the interface to CAN 2. I'm not sure if it references the hardware channel or the logical channel.
Unfortunately I don't have access to a Vector Interface at the moment so I can't check it.
Rich
from python-uds.
Hello Rich,
The exception I'm getting when I run this code
from uds import Uds
ECU_Serial_no = Uds(transportProtocol="can", reqId=0x537, resId=0x53F)
a = ECU_Serial_no.send([0x22, 0xF1, 0x8C])
I am working in a Headlamp ECU, trying to develop a compact diagnostic tool using pyqt5.
This is my hardware application setup in CANoe
In CANoe, there is no problem to send and receive msg.
I also changed the request and response Id but still, it shows the same exception.
Exception: Unknown transport type selected
Thanks,
Aasai.
from python-uds.
Hello Rich,
your solution works
ECU_Serial_no = Uds(transportProtocol="CAN", reqId=0x537, resId=0x53F)
The problem solved after changed to CAN, this is the correct format.
Now, the Response timeout exception raised.
ID might be the issue here, i think.
Give me some solution to find the correct ID.
-Aasai.
from python-uds.
Hi Aasai.
Glad to hear the first is solved.
Looking at your constructor it would be using the config defaults for the interface, so you're not going to be using the vector interface. Try this.
Uds(transportProtocol="CAN", reqId=0x537, resId=0x53F, interface="vector", appName="pythonUds", channel=0)
I would doubt that changing the timeout time would help, but if you want to try add "P2_CAN_Client"
to the Uds constructor, but the timing is currently at 1s which is more than enough for most ECUs
Uds(transportProtocol="CAN", reqId=0x537, resId=0x53F, P2_CAN_Client=3)
Would change the recv timeout to 3 seconds.
Let me know what happens.
Rich.
from python-uds.
Hello Rich,
Uds(transportProtocol="CAN", reqId=0x537, resId=0x53F, interface="vector", appName="pythonUds", channel='0')
Now, it shows no hardware present.
The steps I followed to read the ECU serial no:
- Created an application pythonUds in Vector Hardware Config
- Added that application under VN1630 channel assignment
3.Run below code
ECU_Serial_no = Uds(transportProtocol="CAN", reqId=0x5F3, resId=0x5FB, interface="vector", appName="pythonUds", channel='2')
a = ECU_Serial_no.send([0x22, 0xF1, 0xA1])
print(a)
It shows XL error ( See above Image)
Is this code suitable for VN1630 CAN Interface?
How to identify the connection established with CANoe/Hardware?
Thanks,
aasai
from python-uds.
Hello rich,
The ECU module is connected on hardware channel 3. Can I change the channel to 3 in the constructor?
For your Information
There are two ECU one is LH & other one is RH. Right now I'm working with RH connected on 1630 channel 3.
I'll change the channel to 3 and let you know or else connect the ECU on hardware channel 2 and test.
Thanks for your supportππ€
Aasai.
from python-uds.
Hi Aasai.
No problems, always happy to help :) if it doesn't work try iterating over the different options. I remember it not being 100% straight forward on the Vector interfaces.
Let me know if you have any other problems. I will try and improve the documentation to make it clearer.
Thanks.
Rich
from python-uds.
Hello Rich,
Happy to say that, Finally I'm getting a response.
Some things are changed in order to get the response.
- Assigned pythonUds channel to 3, previously it was 2. Because ECU connected on VN1630 channel 3.
- In the program, the channel should be assigned to the logical channel(i.e channel 2)
In my case,
LH Network channel: 1
RH Network channel: 2
In document example, the channel is an integer type but it should be a string.
DID = Uds(transportProtocol="CAN", reqId=0x5F3, resId=0x5FB, interface="vector", appName="pythonUds", channel=2)
Correct format
DID = Uds(transportProtocol="CAN", reqId=0x5F3, resId=0x5FB, interface="vector", appName="pythonUds", channel='2')
Without your help, this might be quite difficult. Sometimes the simplest things mean the most.
I will be very grateful to you.
Thanks,
Aasai,
from python-uds.
Hi Aasai.
That is a bug, the intention is that for any parameter which is numeric should be a numeric value rather than a string. I'll have a look into this.
If i create a branch for you could you test this for me? I don't have access to a vector interface at the moment.
Just a side questions;
- what is your network architecture? You should be able to communicate with both modules on a single channel if necessary.
- Do you have CDD or ODX files for your modules? You can use them to help communicate with the ECUs.
from python-uds.
Hello Rich,
I am happy to test for you.
Could you please tell me briefly what you want me to do?
I can't communicate with both modules through single channel. Rh Network one channel & Lh should be in another channel. Yes, we have CDD files.
Thanks,
Aasai.
from python-uds.
hello rich & Aasai ,
I am facing a issue while parsing cdd file is their a way to parse the cdd file and work with it using this library
from python-uds.
Related Issues (20)
- exception in threading HOT 9
- Response handling problems
- Plugin for autocompletion
- React to session timing parameters from the server
- P2_CAN_Client implementation is not correct HOT 3
- suggest to add support for extended frame (CAN 2.0b) HOT 1
- DoIP Transport Layer HOT 7
- Refactor to proper PEP standards HOT 1
- can.Message() argument 'extended_id' is 'is_extended_id'? HOT 1
- UDS connection via CAN ,self.tp.recv time out waiting for message HOT 12
- CANFD support HOT 1
- Callback for 0x78 Pending response HOT 2
- calculateKeyFromSeed formula incorrect HOT 2
- canTp recv "Timeout in waiting for message"
- IPV6 Support
- TypeError: Can't instantiate abstract class Listener with abstract method on_message_received HOT 4
- Prusa i3 printer not set up
- [Question] How to _retrieve_ ODX file from ECU?
- Could not import vxlapi: Could not find module 'vxlapi64' (or one of its dependencies). Try using the full path with constructor syntax. HOT 1
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-uds.