python-can icon indicating copy to clipboard operation
python-can copied to clipboard

How connect USB-CAN Adapter

Open sasha1396 opened this issue 3 years ago • 9 comments

Hello there! Very nice code, but I still haven't been able to try it. Can you please tell me how can I use canopen with USBCAN adapter? My adapter is defined as a single USB device:

image

It looks like this: photo_2022-09-19_19-57-43 photo_2022-09-19_19-58-02 photo_2022-09-19_19-58-04

And I still have not figured out which interface to use for it and how. I would appreciate any help and directions to the right place.

sasha1396 avatar Sep 19 '22 17:09 sasha1396

What is canopen? Have you read the README and docs? Have you installed a driver for your device? I have seen issues in recent discussing a function that can find_all_interfaces. You may want to see if that issue is completed and see if python-can autodetects your bus (device and interface).

Note: This issue is improperly marked as an enhancement.

j-c-cook avatar Sep 25 '22 13:09 j-c-cook

I read all the information I could find. As I understand it, none of the interfaces is suitable. The only thing I decided to try is Cananalyst-II, since it is most suitable for my device, but I could not go further than connecting to the device, I get an error: canopen.nmt.NmtError: Timeout waiting for boot-up message. I did not see the find_all_interfaces function in any of the repositories. So I don't know what to do next.

sasha1396 avatar Sep 26 '22 08:09 sasha1396

can.detect_available_configs() might help.

zariiii9003 avatar Sep 26 '22 10:09 zariiii9003

can.detect_available_configs() might help.

I used this: can.detect_available_configs() What should I do about it? Kvaser canlib is unavailable. fcntl not available on this platform socket.CMSG_SPACE not available on this platform failed to fetch opened can devices: [WinError 2] Cannot find the specified file You won't be able to use the serial can backend without the serial module installed! Cannot load IXXAT vcinpl library: Could not find module 'vcinpl.dll' (or one of its dependencies). Try using the full path with constructor syntax. Cannot load IXXAT vcinpl library: Could not find module 'vcinpl2.dll' (or one of its dependencies). Try using the full path with constructor syntax. Failed to load NI-CAN driver: Could not find module 'nican' (or one of its dependencies). Try using the full path with constructor syntax. Failed to load IS-CAN driver: Could not find module 'iscandrv' (or one of its dependencies). Try using the full path with constructor syntax. You won't be able to use the ICS neoVI can backend without the python-ics module installed!: No module named 'ics' Using ICS neoVI can backend without the filelock module installed may cause some issues!: No module named 'filelock' Could not import vxlapi: Could not find module 'vxlapi64' (or one of its dependencies). Try using the full path with constructor syntax. You won't be able to use the slcan can backend without the serial module installed! You won't be able to use the Robotell can backend without the serial module installed! Cannot load SYSTEC ucan library: Could not find module 'usbcan64.dll' (or one of its dependencies). Try using the full path with constructor syntax.. The SYSTEC ucan library has not been initialized. You won't be able to use the serial can backend without the serial module installed! The CANtact module is not installed. Install it using python -m pip install cantact

sasha1396 avatar Sep 26 '22 11:09 sasha1396

Seems like your interface is not supported.

zariiii9003 avatar Sep 28 '22 08:09 zariiii9003

Seems like your interface is not supported.

What else can I try?

sasha1396 avatar Sep 28 '22 08:09 sasha1396

From my perspective, I would say you have one of two options:

  1. Buy a CAN adapter that is already supported by the library (e.g. PCAN-USB)
  2. Write an interface for the device you have

j-c-cook avatar Sep 29 '22 13:09 j-c-cook

From my perspective, I would say you have one of two options:

  1. Buy a CAN adapter that is already supported by the library (e.g. PCAN-USB)
  2. Write an interface for the device you have

Yes, I'm already thinking, as an option, to buy an adapter that already supports CanOpen. If I write my own interface for my device, where should I start?

sasha1396 avatar Sep 29 '22 13:09 sasha1396

A "low cost open-source USB to CAN adapter" is CANable 2.0. However, they are out of stock.

You might want to look into can/interfaces. I have never written an interface, so that's all I know.

Please note that this package is called python-can. It is not clear what you mean by "CanOpen".

If you are going to write an interface, this issue should either be renamed to "Create new interface for xxx device" or should be closed and a new issue described.

j-c-cook avatar Sep 29 '22 15:09 j-c-cook