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

CANtact support #238

Open
romain145 opened this issue Aug 11, 2020 · 23 comments
Open

CANtact support #238

romain145 opened this issue Aug 11, 2020 · 23 comments

Comments

@romain145
Copy link

Is there a plan to support the CANtact / CANable / CANable Pro interfaces running the stock slcan firmware (serial) or the candleLight firmware?

@collin80
Copy link
Owner

collin80 commented Aug 11, 2020 via email

@romain145
Copy link
Author

Using the candleLight firmware (flashed here https://canable.io/updater/) the port list is empty.
I tried passthrucan, peakcan, systeccan, tinycan (shows a can0.0 anyway) and vectorcan.

Testing on Windows 10 btw.

@collin80
Copy link
Owner

Oh sorry, I should have been more clear. SocketCAN interfaces only work on LINUX. I don't think the candlelight firmware will do much for you on Windows. For supporting cantact devices on Windows I will have to more directly target the CANtact communications protocol. I do think that would be worthwhile for me to do. Otherwise your options on Windows for that hardware pretty much boil down to Busmaster. That program is very feature rich but not the features people tend to actually need. It's more for large automotive companies that are doing internal testing of their hardware. So, I do think that CANtact/CANable users could use some more options.

@mitchdetailed
Copy link

mitchdetailed commented Aug 12, 2020 via email

@Alia5
Copy link

Alia5 commented Aug 26, 2021

Using a VM sucks, though.
It's also not just windows, but also MacOS

I give my +1 to this feature request.

I guess an implementation of the candleInterface can be found here

Edit: fix typos

@collin80
Copy link
Owner

Hmmm, interesting, yes that does appear to be a Windows driver for the candlelight API. I will look into supporting that.

@BennyEvans
Copy link
Contributor

I realise this is an old issue, but has there been any further investigation on supporting these devices in SavvyCAN under Windows?

@collin80
Copy link
Owner

collin80 commented Aug 3, 2022

I never did look into it. I just went to that link and bookmarked it. I'll see what I can do.

@ElektronikCZ
Copy link

Windows has candlelight support out of the box with no driver install needed. I also give +1 to this request, and im hoping you atleast looked into it. Its annoying to flash a different firmware in my can tool just for savvycan

@Alia5
Copy link

Alia5 commented Nov 17, 2022

Meanwhile:

WSL2 + Custom kernel (to include can-bus stuff) + usbipd-win.

And then just use savvycan on the wsl

@gromgsxr
Copy link

is support likely to get added for this?

@collin80
Copy link
Owner

Someday, probably. But, as covered above, CANTact support works fine through the socketcan interface on Linux so using WSL could work. It's certainly not ideal. I really should implement actual support in Windows one of these days.

@mitchdetailed
Copy link

mitchdetailed commented Jan 15, 2023 via email

@gadjex
Copy link

gadjex commented Jan 20, 2023

Came here from Google search looking for the same thing, support for CANable in Windows. Would be nice if this was done.

@gromgsxr
Copy link

Someday, probably. But, as covered above, CANTact support works fine through the socketcan interface on Linux so using WSL could work. It's certainly not ideal. I really should implement actual support in Windows one of these days.

Direct windows support would be just awesome

@Careless
Copy link

Someday, probably. But, as covered above, CANTact support works fine through the socketcan interface on Linux so using WSL could work. It's certainly not ideal. I really should implement actual support in Windows one of these days.

this doesn't help macOS users, though.

@ElektronikCZ
Copy link

Someday, probably. But, as covered above, CANTact support works fine through the socketcan interface on Linux so using WSL could work. It's certainly not ideal. I really should implement actual support in Windows one of these days.

You need to compile your own WSL kernel for that to work, and i never got that running. The SLCAN serial FW doesnt allow you to set different can bus speeds, like 95kbps as far as im aware. So the only option for me seems to be to install a full linux VM.
There is a cangaroo software which you could use as the basis for porting candlelight support to windows
https://github.com/HubertD/cangaroo

@BennyEvans
Copy link
Contributor

I've got some spare time now so will look at implementing this. I'll create a PR once complete and link back here.

@ElektronikCZ
Copy link

This is one of the most epic comebacks of 2024

@BennyEvans
Copy link
Contributor

I've had a chance to get some initial code working. If anybody in this thread has a chance, it'd be great if you could also test. I would like to do some more testing before I create the PR but will hopefully have a PR up in the next month. This work was also ontop of another modification that adds support for opening Wireshark socketCAN files. I'll create a PR for that first.

There are currently some restrictions with the code:

  • Only supports devices with base clocks of 48Mhz or 80Mhz - these are the clocks of the two devices I have (CANable and the device I'm currently developing, CAN Bus Debugger). If someone can send me the capability of the CANtact, that can be added pretty easily too if it's not one of the above.
  • Does not yet support one shot mode etc. but does support listen only.
  • Currently only compiled in when using MinGW to compile on Windows - I'm not sure it'll work so well if compiling under msvc but if someone has a chance, please feel free to modify the .pro file and include support when compiling with msvc. Let me know how you go.

I still need to test:

  • Multiple devices connected at once
  • More TX testing
  • Test compilation on linux/mac

Also please note that candle_dll is licensed under the LGPL. This is fine, as it's compiled separately and dynamically linked. But if you're wondering why the driver isn't just compiled into SavvyCAN, that's the reason. Any final Windows release containing the dll will need to contain a note regarding the dll license and where the code can be found - but this is trivial.

Also for transparency, please note that I'm the developer of a new product (not yet released) called CAN Bus Debugger.

Code is available here; https://github.com/BennyEvans/SavvyCAN/tree/gs_usb_support
The code to compile the dll is here: https://github.com/BennyEvans/candle_dll

@BennyEvans
Copy link
Contributor

Update on this: I've been away but plan to get back to testing soon. I've just creted PR #790 to add support for SocketCAN PCAP files and once that PR has been merged and I've finished testing I'll create the PR for gs_usb (candle) support.

@BennyEvans
Copy link
Contributor

PR #790 has just been merged, so I'll work towards creating the next PR to add support for gs_usb (candle). I have something working, but would like to tweak a couple things and as I now have two devices, would like to ensure it can operate with multiple devices attached.

@BennyEvans
Copy link
Contributor

I've just created the next PR #835 that adds support for these devices on Windows. Hopefully we can soon mark this issue as complete 🎉

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

No branches or pull requests

9 participants