Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to install an USB peripheral http://www.kvaser.com/en/products/can/usb.html.
This is what i did i download the linux driver i compiled it with my arm-linux- compiler and set the KERNEL_SOURCE_DIR to my kernel source as it asks for.
After compilation i sent the file to my raspberryPI and i installed USBCAN II driver thanks to the setup shell provided with the driver.
Code:
#!/bin/sh
DEPMOD=`which depmod`
UDEVCTRL=`which udevcontrol`
UDEVADM=`which udevadm`
install -D -m 700 usbcanII.ko /lib/modules/`uname -r`/kernel/drivers/usb/misc/usbcanII.ko
install -m 700 usbcanII.sh /usr/sbin/
if [ -d /etc/hotplug ] ; then
install -m 777 usbcanII/usbcanII /etc/hotplug/usb/ ;
install -m 644 usbcanII/usbcanII.usermap /etc/hotplug/usbcanII.usermap
fi
install -m 644 ../10-kvaser.rules /etc/udev/rules.d
if [ `udevd --version` -lt 128 ] ; then
$UDEVCTRL reload_rules ;
else
$UDEVADM control --reload-rules ;
fi
$DEPMOD -a
if [ "$?" -ne 0 ] ; then
echo Failed to execute $DEPMOD -a
fi
but when i connect it i got the following output
Code:
[root@raspberrypi ~]# dmesg | tail
usb 1-1.2.4: chopping to 0 config(s)
usb 1-1.2.4: string descriptor 0 read error: -32
usb 1-1.2.4: New USB device found, idVendor=0bfd, idProduct=0004
usb 1-1.2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-1.2.4: no configuration chosen from 0 choices
usb 1-1.2.4: No support over 500mA
Registered led device: led0
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
smsc95xx 1-1.1:1.0: eth0: link up, 100Mbps, full-duplex, lpa 0x45E1
lsusb -v gives me
Code:
Bus 001 Device 006: ID 0bfd:0004 Kvaser AB USBcan II
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.00
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x0bfd Kvaser AB
idProduct 0x0004 USBcan II
bcdDevice 0.01
iManufacturer 1
iProduct 2
iSerial 0
bNumConfigurations 0
Device Status: 0x0001
Self Powered
I'll hazard a guess that the USB-CANbus dongle is pulling the power supply down briefly when connecting. What happens if you boot the RPi with the USB-CANbus dongle already connected? Does the device work correctly after hot-plugging?
Thank you for your answer but hot-plugging does not resolve the problem. The PWR led is still flashing and i have the same message.
I forgot to mention that the install.sh didn't work pretty fine in fact when i run it i have
Code:
[root@raspberrypi usbcanII]# ./installscript.sh
which: no udevcontrol in (/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/local/bin)
./installscript.sh: line 15: udevd: command not found
./installscript.sh: line 15: [: -lt: unary operator expected
Well, it looks like your Rpi doesn't have a standard installation of udev. The CANbus dongle probably requires the USB subsytem udev rules to load a driver for the dongle when it is hot-plugged. Since the installation of the udev rules failed, no such rule gets invoked. If udev is installed, then you should either manually install the kvaser udev rules, or add the udev components to your $PATH before running the installation script. If udev isn't installed, then you should probably install it.
Well, it looks like your Rpi doesn't have a standard installation of udev. The CANbus dongle probably requires the USB subsytem udev rules to load a driver for the dongle when it is hot-plugged. Since the installation of the udev rules failed, no such rule gets invoked. If udev is installed, then you should either manually install the kvaser udev rules, or add the udev components to your $PATH before running the installation script. If udev isn't installed, then you should probably install it.
--- rod.
Thanks for your reply.
Well, if i remember well i had problems with udev when i build the rootfs, but here i added the path for udev and i executed ./installscript.sh successfully but i still can't run the device
Does the device driver load (look for evidence in /var/log/messages)? Is there a device node created ( eg /dev/can0 )? What do you mean by 'had problems with udev'? Is it installed, or not? If no, then you should install it. Are your udev rules for the device now installed according to the installation script? What exactly do you mean by 'can't run the device'? Do you have some test software that is known to be good? If the device node is present, does it have permissions suitable to the UID of the code you're trying use to test it? What rules are in the vendor supplied udev config file? Is there evidence that they are being applied?
i really appreciate your help. I'll try to answer the quetions that i understood
/for udev i had errors when i built the rootfs
/for the driver i think it's loaded for the node in /dev how can i guess that a device is for my usbcan ?
/what i mean with 'can't run it' there's a PWR led in the device that flashes instead of being steady (normal status like with my pc)
Now what's new is that a friend of mine (more qualified) made an update for the firmware and now i don't have this messages
usb 1-1.2.4: no configuration chosen from 0 choices
usb 1-1.2.4: No support over 500mA
and the led is steady now but as i understand the device is turned with a generic module (i'm not really understanding what i say) in an other way lsmod doesn't show usbcanII driver like before. But the problem that the examples provided with th driver (that we test with pc and worked) doesn't work with Raspberry Pi.
Another question if u don't mind i want to use another kernel with my old root file system what should i change only the image.ko ?
Hope that you can help me.
Okay, it looks like the driver is not loading. Monitor /var/log/messages (tail -f) as root when you plug the USB CANbus dongle into the Rpi. Do you see anything related to your device? If no, then no driver is loading, or the driver is not recognizing the presence of the device. Since the driver is no longer showing up in the output of lsmod, it sounds like the device is not being recognized. Did the firmware update complete successfully? Use lsusb to list devices attached to the USB. Does your device show up? Can you manually load the driver with insmod or modprobe? Can you roll back to the older firmware to see if the old behavior is restored?
When you built the root filesystem, and you saw errors related to udev, did you correct those errors? It is impossible to know what to expect from udev without knowing whether it is fully present.
Usually, the device node name is recognizable by its name. I would expect the device node name to suggest something about CANbus; something like /dev/can0.
For questions about kernel upgrades, you should start a new thread, or ask on a RPi forum. Do note that you will need to rebuild your CANbus driver against the sources for your new kernel.
I'll hazard a guess that the USB-CANbus dongle is pulling the power supply down briefly when connecting. What happens if you boot the RPi with the USB-CANbus dongle already connected? Does the device work correctly after hot-plugging?
Looks bad. More context needed. I've asked you a lot of questions. Diagnosis of the problem depends on the answers to those questions. Before a remedy can be effected, the cause of the problem must first be determined.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.