Kvaser leaf light
Hi there,
I'm trying hard to setup the Kvaser Leaf Light HS v2 with SocketCan on a Ubuntu 14.04.2 workstation. Unfortunately I failed so far and therefor wanted to ask you, if you can give me some help.
My goal is to use the leaf together with wireshark to spy a can bus in one of our automated test systems.
How I'm trying to set it up:
- loading kernel modules:
# modprobe can # modprobe can_raw # modprobe can_bcm # modprobe kvaser_usb # modprobe vcan
- plug the leaf
- check if the leaf is there:
# lsusb Bus 001 Device 002: ID 0bfd:0120 Kvaser AB
-trying to set up the ip link:
# ip link set up can0
Cannot find device "can0"
# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 00:22:68:3a:5f:03 brd ff:ff:ff:ff:ff:ffThis is where I fail, I cannot get a device can0 to set up. It works perfectly fine with the vcan virtual device, but not with the leaf.
Do you have any idea what I'm missing or doing wrong. Your help would be highly appreciated.
Btw: The leaf firmware is up to date.
Many thanks and best regards,
Ralph
end
--- Disclaimer: ---
This email and contents is for use only by the intended recipient. If you are not the individual or entity to whom it is addressed, you are hereby formally notified that any use, copying or distribution of this email and attachments, in whole or in part, is strictly prohibited. If you have received this email in error, please notify the sender and delete the message and attachment(s) from your system. Any views, opinions or information, expressed or contained in this email, are those of the sender and not necessarily reflect those of ESPROS Photonics AG. To help protect our environment, please avoid printing out this information unnecessarily.
Hi Ralph,
Quoted 15 lines · Ralph Potztal
Hi there,
I'm trying hard to setup the Kvaser Leaf Light HS v2 with SocketCan on a Ubuntu 14.04.2 workstation. Unfortunately I failed so far and therefor wanted to ask you, if you can give me some help.
My goal is to use the leaf together with wireshark to spy a can bus in one of our automated test systems.
How I'm trying to set it up:
- loading kernel modules:# modprobe can # modprobe can_raw # modprobe can_bcm # modprobe kvaser_usb # modprobe vcan
Quoted 6 lines
- plug the leaf
- check if the leaf is there:
# lsusb Bus 001 Device 002: ID 0bfd:0120 Kvaser AB
Great, this USB device ID (288/0x120) is indeed supported by the kvaser_usb module. It was added only in linux-3.16 though:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b4f20130a
So, what is version of your kernel? A `uname -a' would be quite helpful.
Thanks,
Darwish
Hi Ahmed,
thanks for this. I think that could be the problem, because:
# uname -a Linux cli-48 3.13.0-46-generic #79-Ubuntu SMP Tue Mar 10 20:06:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Best regards,
Ralph
----- Ursprüngliche Mail -----
Von: "Ahmed S. Darwish" <[email protected]>
An: "Ralph Potztal" <[email protected]>
CC: [email protected]
Gesendet: Donnerstag, 19. März 2015 16:31:52
Betreff: Re: Kvaser leaf light
Hi Ralph,
Quoted 15 lines · Ralph Potztal
Hi there,
I'm trying hard to setup the Kvaser Leaf Light HS v2 with SocketCan on a Ubuntu 14.04.2 workstation. Unfortunately I failed so far and therefor wanted to ask you, if you can give me some help.
My goal is to use the leaf together with wireshark to spy a can bus in one of our automated test systems.
How I'm trying to set it up:
- loading kernel modules:# modprobe can # modprobe can_raw # modprobe can_bcm # modprobe kvaser_usb # modprobe vcan
Quoted 6 lines
- plug the leaf
- check if the leaf is there:
# lsusb Bus 001 Device 002: ID 0bfd:0120 Kvaser AB
Great, this USB device ID (288/0x120) is indeed supported by the kvaser_usb module. It was added only in linux-3.16 though:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b4f20130a
So, what is version of your kernel? A `uname -a' would be quite helpful.
Thanks,
Darwish
--- Disclaimer: ---
This email and contents is for use only by the intended recipient. If you are not the individual or entity to whom it is addressed, you are hereby formally notified that any use, copying or distribution of this email and attachments, in whole or in part, is strictly prohibited. If you have received this email in error, please notify the sender and delete the message and attachment(s) from your system. Any views, opinions or information, expressed or contained in this email, are those of the sender and not necessarily reflect those of ESPROS Photonics AG. To help protect our environment, please avoid printing out this information unnecessarily.
Hi Ralph,
[ Please do not top-post; it heavily breaks our ability to follow
the logical sequence of a discussion thread. More details here:
http://catb.org/jargon/html/T/top-post.html
https://lkml.org/lkml/2005/1/11/111 ]
Quoted 8 lines · Ralph Potztal
Hi Ahmed,
thanks for this. I think that could be the problem, because:
# uname -a Linux cli-48 3.13.0-46-generic #79-Ubuntu SMP Tue Mar 10 20:06:50 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Great we've found the culprit. Now you have multiple possible solutions:
1) Latest Ubuntu 14.04 LTS seems to offer a 3.16 kernel in a nicely packaged "sudo apt-get install" format:
http://askubuntu.com/questions/506956/how-can-i-install-3-16-kernel-on-ubuntu-14-04
2) Manually install the latest 3.19.2 stable kernel, which includes support for your Kvaser model.
Keep in mind though that the kvaser_usb module has recently received a large amount of fixes that's not yet included in the latest stable kernels. So if you will use the device for continuous hours or plan to have a heavy tx/rx traffic, you will definitely have to do one of the following instead:
1) Temporarily use the 3.19.2 kernel, and quickly switch to v4.0 once it is released. Better yet, directly use kernel v4.0-rc4 where most of the necessary fixes are included:
https://lkml.org/lkml/2015/3/15/180
2) I have a version of the driver at work, __with all the fixes__, ported for old Ubuntu and CentOS kernels.
I can upload this version on a public website and send you the link on Sunday. But kindly note that this will be providied "AS IS", without any kind of support (you can *not* bother this mailing list about it), or any warranty of merchantability, implied or express.
3) At least port this single patche to your 3.19.2 kernel:
[a] can: kvaser_usb: Read all messages in a bulk-in URB buffer
http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=2fec5104f9c
Regards,
Darwish
Quoted 41 lines
----- Ursprüngliche Mail -----
Von: "Ahmed S. Darwish" <[email protected]>
An: "Ralph Potztal" <[email protected]>Hi Ralph,
Quoted 15 lines · Ralph Potztal
Hi there,
I'm trying hard to setup the Kvaser Leaf Light HS v2 with SocketCan on a Ubuntu 14.04.2 workstation. Unfortunately I failed so far and therefor wanted to ask you, if you can give me some help.
My goal is to use the leaf together with wireshark to spy a can bus in one of our automated test systems.
How I'm trying to set it up:
- loading kernel modules:# modprobe can # modprobe can_raw # modprobe can_bcm # modprobe kvaser_usb # modprobe vcanQuoted 6 lines
- plug the leaf
- check if the leaf is there:
# lsusb Bus 001 Device 002: ID 0bfd:0120 Kvaser ABGreat, this USB device ID (288/0x120) is indeed supported by the
kvaser_usbmodule. It was added only in linux-3.16 though:https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=b4f20130aSo, what is version of your kernel? A `uname -a' would be quite helpful.
Thanks,
Darwish
Hi Ralph,
Quoted 4 lines · Ahmed S. Darwish
On Fri, Mar 20, 2015 at 12:18 PM, Ralph Potztal <[email protected]>
Quoted 3 lines
$ uname -a
Quoted 9 lines
Quoted 5 lines
Linux cli-46 3.19.0-031900-generic #201502091451 SMP Mon Feb 9 14:52:52 UTC 2015
x86_64x86_64x86_64GNU/LinuxIt's working excellent now.
Great. Switch to upcoming v4.0 if you notice any disruptions in your CAN traffic. I shall send backported fixes soon.
Backported fixes for v3.19, and other -stable kernels, are now ready:
http://article.gmane.org/gmane.linux.can/7857 http://article.gmane.org/gmane.linux.can/7860 http://article.gmane.org/gmane.linux.can/7859
Append /raw to the URLs above to get the patches in a form that can be applied with "patch" or "git am".
Regards,
Darwish