Code Monkey home page Code Monkey logo

Comments (13)

richClubb avatar richClubb commented on May 22, 2024 1

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:

  1. Have you set up an application in the vector hardware setup? If not then the sample code will likely fail.
  2. 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.

richClubb avatar richClubb commented on May 22, 2024 1

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.

richClubb avatar richClubb commented on May 22, 2024 1

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.

AasaiAlangaram avatar AasaiAlangaram commented on May 22, 2024

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])

image

I am working in a Headlamp ECU, trying to develop a compact diagnostic tool using pyqt5.

This is my hardware application setup in CANoe

image

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.

AasaiAlangaram avatar AasaiAlangaram commented on May 22, 2024

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.

image

ID might be the issue here, i think.

Give me some solution to find the correct ID.

-Aasai.

from python-uds.

richClubb avatar richClubb commented on May 22, 2024

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.

AasaiAlangaram avatar AasaiAlangaram commented on May 22, 2024

Hello Rich,

Uds(transportProtocol="CAN", reqId=0x537, resId=0x53F, interface="vector", appName="pythonUds", channel='0')

image

Now, it shows no hardware present.

The steps I followed to read the ECU serial no:

  1. Created an application pythonUds in Vector Hardware Config
  2. Added that application under VN1630 channel assignment
    image
    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.

AasaiAlangaram avatar AasaiAlangaram commented on May 22, 2024

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.

richClubb avatar richClubb commented on May 22, 2024

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.

AasaiAlangaram avatar AasaiAlangaram commented on May 22, 2024

Hello Rich,

Happy to say that, Finally I'm getting a response.

Some things are changed in order to get the response.

  1. Assigned pythonUds channel to 3, previously it was 2. Because ECU connected on VN1630 channel 3.
  2. 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.

richClubb avatar richClubb commented on May 22, 2024

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.

AasaiAlangaram avatar AasaiAlangaram commented on May 22, 2024

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.

karamveerpratap avatar karamveerpratap commented on May 22, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.