linklayer / cantact

Drivers and Command Line Interface for CANtact tools
http://cantact.io
MIT License
46 stars 11 forks source link

Not finding CANable device on Windows, Python 3.7 #2

Closed RossSmyth closed 4 years ago

RossSmyth commented 4 years ago

Hello. I am attempting to use this library to automate some of my hardware testing with the CANable device I have using Python. At first I tried using python-can and the SLCAN interface but I was not able to get that interface to work.

I then downloaded the https://github.com/ericevenchick/python-can/tree/cantact fork of python-can to attempt to use the native cantact interface. This didn't work either as Python would tell me that Relative module names not supported Which happened even if I just went into the Python REPL and ran

import can
can.interface.Bus("cantact", channel="COM8", bitrate=1000000)

Which after running the second line it would then error with the relative module error. So this issue could also be on that fork. I then just tried make it work with the base cantact API, so I just ran:

import cantact
cantact.Interface()

And it errored with SystemError: DeviceNotFound. I attempted to unplug and replug the CANable device as well as restart my computer and the issue persisted. If I opened the Windows Device Manager I was able to see that it recognized the device was plugged into the COM8 port, so I am not quite sure on what is happening and my Rust skills are not good enough to debug that side of this library.

Thanks for any help you can provice.

ericevenchick commented 4 years ago

Hey,

Using this library will require the CandleLight firmware on the CANable. There's information on flashing it here: https://cantact.io/cantact/users-guide.html. Once flashed, it should show up as a USB device, not a COM device.

Let me know if that solves the DeviceNotFound error.

Thanks, Eric

RossSmyth commented 4 years ago

Ah I was not aware of that. Thank you. I am not able to flash it with that firmware as I am not the only one using it in my organization. Do you know if the SLCAN interface should theoretically work then?

ericevenchick commented 4 years ago

SLCAN should work on Windows, I believe python-can has support for it. It tends to be slow though.