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 ZLG interface #1209

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open

Add ZLG interface #1209

wants to merge 27 commits into from

Conversation

keelung-yang
Copy link

No description provided.

@felixdivo felixdivo added this to the 4.1.0 milestone Feb 9, 2022
@felixdivo
Copy link
Collaborator

Hey @keelung-yang, I did see your proposal (🥳!) but I currently do not have time to review it. Sorry for that 😒.

@keelung-yang
Copy link
Author

@felixdivo Thanks. It's OK for waiting and improving my code in actual usage before merging.
And please note that I've one line code (-> list[int] in timing module) using Python 3.9 and several lines using Python 3.8. I want to wait for requiring Python 3.8 as minimal version, before someone wants to use this ZLG interface.

@zhuyu4839
Copy link

Hey @keelung-yang, I did see your proposal (🥳!) but I currently do not have time to review it. Sorry for that 😒.

ZLG can interface has added by #1351

@hardbyte
Copy link
Owner

@keelung-yang would you mind reviewing #1351 and comparing?

@hardbyte hardbyte removed this from the 4.1.0 Release milestone Nov 14, 2022
@hardbyte hardbyte added this to the Next Release milestone Nov 14, 2022
@keelung-yang
Copy link
Author

@keelung-yang would you mind reviewing #1351 and comparing?

Hi @hardbyte & @zhuyu4839
Seems zhuyu's implement is depended on his zlgcan-driver project: https://github.com/zhuyu4839/zlgcan-driver, which trying to wrap different APIs and platforms(Linux/Windows) for ZLG CAN libraries.

ZLG should take response for universal APIs to access their various CAN devices, like others, such as kvaser and so on. But they don't want, according to the communications with their technical assistants and developer. Even for the same device, such as USBCAN(FD), there are 3 different bundles of API just for CAN or CANFD, Linux or Windows. That's why zhuyu's API wrapping is very long, almost 1500 lines: https://github.com/zhuyu4839/zlgcan-driver/blob/main/zlgcan/zlgcan.py

ZLG tried to add their offical python-can interface implement before releasing python-can v4.0. But they gave up: https://manual.zlg.cn/web/#/169/6070

For my implement, I don't want to be disarray by ZLG's native libraries. And on the other hand, on Windows, ZLG has official GUI app and development libraries which reqiring VC runtime 2005、2008、2010、2012、2013(https://manual.zlg.cn/web/#/152/5332). So, let's goto Linux since I have to use them in my daily work, and share if others want too.

In short, ZLG APIs are in chaos, users should take care of oneself.

For python-can, it's hard to implement universal APIs to support almost all ZLG CAN devices, both in CAN and CANFD, Linux and Windows. Only when ZLG want to do that.


P.S. for zlgcan-driver project, containing .so/.dll from ZLG is not a good idea since they should be published by the vendor ZLG.

@zhuyu4839
Copy link

I have separated the code for different platforms.

@FroyoRab
Copy link

what's up with checks? I can't see details.
it say "The logs for this run have expired and are no longer available."
can do it again? hope to help merge.

@zariiii9003
Copy link
Collaborator

what's up with checks? I can't see details. it say "The logs for this run have expired and are no longer available." can do it again? hope to help merge.

I reran the tests. I'd prefer if this was implemented using the plugin interface

@keelung-yang
Copy link
Author

I see this log in some checks:

FAILED test/test_interface_zlg.py::ZlgTestCase::testRecv - can.exceptions.CanInterfaceNotImplementedError: 
Cannot import module can.interfaces.zlg for CAN interface 'zlg': libusbcanfd.so: cannot open shared object file: No such file or directory

That's because I do have no any .so file uploaded into repository.
Because it will be out of date if ZLG update libusbcanfd.so officially.
And on the other hand, this may cause some security issue I guess, since I don't know how the libusbcanfd.so is generated.
So I want users to copied it from ZLG official site instead of using the one uploaded by me.
And I've make this clear in the doc/interfaces/zlg.rst

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

Successfully merging this pull request may close these issues.

6 participants