- Notifications
You must be signed in to change notification settings - Fork 665
Adds canal interface#245
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
Adds canal interface #245
Uh oh!
There was an error while loading. Please reload this page.
Conversation
* almost just a copy of the usb2can module which is badly named * the usb2can module is for now left unchanged but should be changed to use the new CANAL interface * TODO serial_selector update...
* autodetect device ID failed * CanalOpen failed
felixdivo commented Feb 12, 2018
The failing test is the problematic |
hardbyte left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unlikely to merge this without a page added to the documentation.
It wouldn't need to cover much - links to the hardware vendor, mention and link to the required libraries. Any comments on compatibility, limitations etc.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
felixdivo commented Feb 17, 2018
All requested changes are valid. ;) I will address them as soon as I can, but that will have to wait for one or too weeks probably, since I am very busy right now. |
felixdivo commented Feb 22, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I would like someone else to do that since I do not really get Sphinx and do not know the hardware behind the interface at all. Can someone else pick that up? |
felixdivo commented Feb 23, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Does it need to be registered in |
felixdivo commented Mar 15, 2018
@krixkrix Could you write some docs? That would be really nice. |
felixdivo commented Mar 19, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
This still needs to be done:
Can anyone help to close this ancient issue? |
felixdivo commented Sep 13, 2018
@krixkrix Just mentioning you because I'm not sure if you else get notified by new comments. See above for my comment on docs & tests. |
felixdivo commented Oct 8, 2018
@krixkrix Have you already found time to look at this? As version 3.0 is now released, I want to get this working early in this "iteration" so we can finally release this into 3.1. |
acolomb commented Feb 11, 2019
What is the difference between this backend and the USB2CAN one? I do have hardware for the latter and it also uses an abstraction layer DLL named CANAL. If it's in any way related, I could do some testing. Would be good to have at least some kind of documentation, to answer questions like this ;-) |
felixdivo commented Feb 11, 2019
This might be the case, yeah. I actually have no idea of the required DLLs, I only copied PR #161 and applied some general patches. Also, I found this through the issue #465: https://github.com/krumboeck/usb2can_canal. If this is redundant, we can close this PR, sure. Apparently, no one had interest to solve this, so that might explain it. |
acolomb commented Feb 12, 2019
So the real question is why did @krixkrix make a copy of the usb2can backend? I don't get it from the comment, but didn't check the source code either. @felixdivo Would you mind diffing the two backends against each other, to figure out the main differences? |
felixdivo commented Feb 12, 2019
Yeah, I could do that in a few days/weeks. I'm quite busy right now. |
acolomb commented Feb 13, 2019
According to the VSCP documentation:
Apparently the CANAL API is implemented by a bunch of drivers there, not only USB2CAN. But I wouldn't bet on more people using this interface backend if it were named CANAL, especially since probably no one ever tested with other CANAL implementation DLLs. |
felixdivo commented Feb 13, 2019
I wouldn't either. |
acolomb commented Feb 19, 2019
@felixdivo I've started a comparison of the backends, see this Gist. Besides renaming the files and classes, there are some differences in error handling (exceptions) and fewer comments about the backend being targeted to Windows mainly. In some places, I get the impression that some general python-can changes, like My knowledge of python-can internals is very limited though, so I won't try to judge which backend is "better". Some obvious documentation and cosmetic changes could be ported to usb2can easily, though. |
felixdivo commented Feb 19, 2019 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
I didn't know Github can display .diff files that nicely. ^^ Yeah, there are some changes that should be ported to I can do it this weekend, but I have a question about |
acolomb commented Feb 19, 2019
The USB2CAN adapters from 8devices apparently always have a serial number starting with 'ED' prefix. I don't know what the resulting strings from the Windows API query will look like, but it seems to slice out the last 8 bytes trying to get the serial number. On the other hand, the USB product ID PID_6001 probably matches an FTDI UART interface chip on the adapter, which will result in pretty much any USB developer gadget without an own vendor id, plus the ones in the linked query. Since the method only returns the first match, the latter might cause problems. It's a rather fragile approach either way. Looking for 'ED' will probably only work for adapters sold by Eight Devices, not @rusoku's TouCAN, for example. Since I'd probably go with the more flexible approach from |
rusoku commented Feb 20, 2019
"ED" prefix comes from my old company edevices.lt ;-) |
felixdivo commented Feb 20, 2019
Thanks for all the input. ;) Maybe the Win32 API can even reveal the serial numbers directly? Does anyone know the API well enough for that? I couldn't find it via the first search results ...
Then we could simply look for the last regex group with
Do we need to strip the device type number from the serial ID or is it okay to leave it in there? Because how can we detect when to strip it and when not?
Sounds good, combined with variable length IDs. |
rusoku commented Feb 20, 2019
For TouCAN devices init string always consists of 3 blocks: device_id ; serial number ; speed. |
This adds the changes that were requested in #161. That older PR can now be closed.