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

adding a generic CANalyst-II backend #1298

Open
mikisama opened this issue Apr 27, 2022 · 7 comments
Open

adding a generic CANalyst-II backend #1298

mikisama opened this issue Apr 27, 2022 · 7 comments

Comments

@mikisama
Copy link
Contributor

Hi, guys.

Version 3.x of python-can worked well with my CANalyst-II. However, in version 4.x, I found that the backend of python-can for CANalyst-II has changed. My CANalyst-II can not work with python-can.

  • As far as I know, the genuine CANalyst-II is manufactured by ZLG, but there are many cloned CANalyst-II devices on the market, whose manufacturers provide ZLG-compatible DLLs.

  • Version 3.x of python-can can support CANalyst-II of different manufacturers by simply replacing the DLL.

  • Version 4.x of python-can may only support CANalyst-II devices from Chuangxin Technology.

Would you consider adding a 'generic' CANalyst-II backend like the 3.x version?

@zariiii9003
Copy link
Collaborator

@projectgus Could you take a look?

@projectgus
Copy link
Contributor

projectgus commented Apr 27, 2022

Oh wow, this is very interesting! @mikisama I did not actually know there was a "genuine" CANalyst-II from ZLG available for sale.

Here's all of the versions I can find:

  1. Chuangxin Technology version. Example. Available on Taobao, Aliexpress, etc. This is the version I have.
  2. Looks the same as 1 but doesn't say "Chuangxin Technology" on the case. Example. According to Taobao sellers this is still Chuangxin Technology version, but I haven't confirmed that the USB protocol & DLL are the same. Same device also available in silver.
  3. iTek Canalyst-II. I only saw this version today. I don't know anything about it.
  4. ZLG CANalyst-II+. This product doesn't seem to be sold any more, I can't find anywhere to buy it. The ZLG official Taobao store doesn't have it. They sell the "USBCAN" device instead, and there is a PR to add support for the ZLG USBCAN.

It seems like there are two ways forward:

  1. Revert canalystii: Replace binary library with python driver #1127 and go back to using the DLL. This will remove some things fixed in the PR, but it will mean that other "Canalyst-II" versions can work by changing the DLL.
  2. Find out what the difference in USB protocol is for the other Canalyst-II types, and add support in the Python backend. I am interested to help with this, if there are not too many different clones.

@mikisama @zariiii9003 Can you share about the exact Canalyst-II that you have? A photo, where you bought it, when you bought it, etc?

@mikisama
Copy link
Contributor Author

Hi, @projectgus
Thanks for your reply.

I have this one USBCAN-II

The stuff in this zip is a ZLG-compatible DLL and manual.
Guangcheng Technology USBCAN Interface Function Library Instruction Manual.zip

@projectgus
Copy link
Contributor

projectgus commented May 1, 2022

Thanks, that's interesting. So the one you have is actually a "ZLG USBCAN" compatible clone, not "Canalyst-II" exactly. But it all works with the same ControlCan DLL and the "CANPro" ZLG software?

The Shenyang Guangcheng Technology CAN protocol support in their documentation actually sounds better than the basic Canalyst-II protocol support which doesn't allow much detection of CAN bus errors. I am wondering if I should get one of these and write a pure Python backend for it as well. :)

I think #1209 by @keelung-yang will add support for this USBCAN device again, because this PR is using the DLL as well. It's interesting that USBCAN worked in the old versions using the DLL for canalystii backend though, I didn't know this and I don't think the maintainers knew this!

@keelung-yang
Copy link

keelung-yang commented May 1, 2022

As discussed with supporters from ZLG, they may use incompatible libraries just for supporting Windows/Linux or CAN/CAN-FD, or even for the same product as asked by different clients.

We also discussed Canalyst-II in python-can v3.x, and they tell me I can't use it for our USBCANFD-100U/200U. That's why I develop a new back-end: Only for Linux. On Windows they use different APIs. There are many works need to be done for support both Linux and Windows.

In short, there are huge compatibility issues among ZLG official libraries. You cannot expect compatible APIs to manipulate ZLG CAN devices, as Kvaser/Vector/Intrepid..., only if ZLG decide to develop one. Or there're many many works need to be done for compatibility.

Update:

For ZLG official Windows python-can package, you can access this page https://manual.zlg.cn/web/#/169/6075
But it's declared no sustaining anymore: https://manual.zlg.cn/web/#/169/6070

微信图片_20220507231428

微信图片_20220507231447

@Nareshkumar-g
Copy link

I want to use python-can [canalst-II] in pyhton 2.7, what can i do?

@mikisama
Copy link
Contributor Author

I want to use python-can [canalst-II] in pyhton 2.7, what can i do?

You can try install the old version

pip install python-can==3.3.4

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

5 participants