Skip to content
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

Add support for ISO TP #45

Closed
hardbyte opened this issue Dec 15, 2015 · 17 comments
Closed

Add support for ISO TP #45

hardbyte opened this issue Dec 15, 2015 · 17 comments

Comments

@hardbyte
Copy link
Owner

hardbyte commented Dec 15, 2015

Originally reported by: toonst (Bitbucket: toonst, GitHub: toonst)


Support for ISO TP is not yet built in SocketCAN by default, but there exists an implementation:
https://github.com/hartkopp/can-isotp

It would be great to be able to use this from python-can.

Since I really could use this functionality, I might take stab at implementing it. Could someone list the changes that are needed to make it work? I'm not familiar with the python-can code, so I don't know if this is feasible.


@hardbyte
Copy link
Owner Author

Original comment by Brian Thorne (Bitbucket: hardbyte, GitHub: hardbyte):


This is very feasible. Every interface has been contributed by someone different.

Take a browse through the can/interfaces folder and at the BusABC in can/bus.py. Do you think you can write a concrete implementation that is compliant with the abstract base class?

@christiansandberg
Copy link
Collaborator

As I understand it ISO TP is a small protocol layer that abstracts away the limitations of regular CAN like the 8 byte limit. Other real protocols like UDS uses this. On one hand it could make sense to have this here since it is closer to the CAN layer and not an actual protocol. On the other hand it makes sense to keep python-can clean from everything but the lowest level.

@felixdivo
Copy link
Collaborator

On the other hand it makes sense to keep python-can clean from everything but the lowest level.

I agree with this and would recommend implementing that in a new repository if someone decides to do this. We can still link from one to the other and python-iso-tp can depend on python-can.

We could also consider making something existing compatible with python-can, like https://github.com/pylessard/python-can-isotp.

I would suppose we close this ancient issue after we decided on that.

@inorick
Copy link

inorick commented Feb 17, 2018

python-can-isotp is only a wrapper around the Linux kernel‘s native ISO-TP implementation and not an implementation of the protocol itself. The only one in pure Python that I could find is part of pyvit and it only implements a subset. So I think unless there is another dedicated ISO-TP project, python-can would be a good place for a platform independent implementation of ISO-TP.

@felixdivo felixdivo added the api label Feb 20, 2018
@felixdivo
Copy link
Collaborator

felixdivo commented Feb 23, 2018

Okay, I'm fine with that as long as it resides in it's own package (like isotp), and not in can.*. Btw.: Pull Requests are always welcome. ;)

@felixdivo
Copy link
Collaborator

Also see socket.CAN_ISOTP.

@christiansandberg
Copy link
Collaborator

That would also just work for socketcan. I think we can close this issue since it is easy and cleaner to keep protocols in separate packages.

@felixdivo
Copy link
Collaborator

Well, as long as no one has the time to tackle this, I doesn't matter anyway.

@hardbyte
Copy link
Owner Author

This also lines up with what we did for the J1939 protocol which was to put it in an external library - https://github.com/milhead2/python-j1939

Agree we should link to these higher level libraries from our docs.

@polybassa
Copy link

Hi, I we created an ISOTPSoftSocket inside the Scapy project. This ISOTPSoftSocket can use any python-can interface object for the lower layer. Unfortunately, we didn't wrote the docs, yet. Usage examples can be found in the unit-test-file. Just search for ISOTPSoftSocket https://github.com/secdev/scapy/blob/26eac7e85fd89af2e71c85dcf7fea8416103fbe9/scapy/contrib/isotp.uts#L967.
Maybe this is useful for someone.

@syntroniks
Copy link

Some hardware interfaces have support for ISOTP.
The Neovi devices from ICS will both send and accept flow control frames. You can send >8 bytes and the interface/driver handle the rest. Receive calls return individual frames, however.

@christiansandberg
Copy link
Collaborator

@pylessard is implementing support for python-can in udsoncan now and I have implemented an asyncio ISO-TP library.

@pylessard
Copy link

Actually, the IsoTP layer is implemented in can-isotp module which I use in udsoncan. The IsoTP implementation is functional but not released yet.

@polybassa
Copy link

Well, the downside of the can-isotp implementation is the fact, that it runs only on linux and python3. If you have, for example a Vector interface or you are forced to use windows, you can not use Hartkopp's isotp kernel moduls.

@pylessard
Copy link

pylessard commented Dec 18, 2018

Sorry for the confusion. There is a python implementation, I just haven't updated the documentation yet, give me a week or 2. Vector on Windows works, I tested it with some hardware. I'll write an example on how to use it with Vector soon. In the mean time, you can have a look at the isotp.protocol module, you should find what you are looking for.

@polybassa
Copy link

Alright. Thanks for this information. I'm always interested in other approaches. I'll leave you one or two remarks.

@pylessard
Copy link

This is now fully supported by can isotp and can be used with python-can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants