LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 04-23-2013, 05:18 AM   #1
nymar
LQ Newbie
 
Registered: Apr 2013
Posts: 7

Rep: Reputation: Disabled
installing an USB peripheral


Hi,

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
 
Old 04-23-2013, 11:35 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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?

--- rod.
 
Old 04-24-2013, 04:20 AM   #3
nymar
LQ Newbie
 
Registered: Apr 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
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

Last edited by nymar; 04-24-2013 at 04:29 AM.
 
Old 04-24-2013, 10:57 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
1 members found this post helpful.
Old 04-25-2013, 03:58 AM   #5
nymar
LQ Newbie
 
Registered: Apr 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by theNbomr View Post
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
 
Old 04-25-2013, 08:01 AM   #6
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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?

--- rod.
 
1 members found this post helpful.
Old 04-25-2013, 08:21 AM   #7
nymar
LQ Newbie
 
Registered: Apr 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
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.

Last edited by nymar; 04-25-2013 at 08:48 AM.
 
Old 04-25-2013, 09:08 AM   #8
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.

--- rod.
 
Old 04-25-2013, 10:40 AM   #9
samiaeg
LQ Newbie
 
Registered: Apr 2013
Posts: 2

Rep: Reputation: 0
Quote:
Originally Posted by theNbomr View Post
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?

--- rod.
nice explanation
 
Old 04-25-2013, 10:47 AM   #10
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by samiaeg View Post
nice explanation
Not sure if you're being facetious here or not. If so, please elaborate.
--- rod.
 
Old 04-26-2013, 08:21 AM   #11
nymar
LQ Newbie
 
Registered: Apr 2013
Posts: 7

Original Poster
Rep: Reputation: Disabled
what about this dmesg --->
Code:
usbcanII: disagrees about version of symbol module_layout
??
 
Old 04-26-2013, 10:50 AM   #12
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.

--- rod.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Introduction to P.I.C peripheral buses theKbStockpiler Linux - Embedded & Single-board computer 5 11-27-2012 05:31 PM
USB peripheral device not found on USB OTG port with Linux 3.0.0 kernel lmorda Linux - Embedded & Single-board computer 1 04-28-2012 11:56 AM
Bypassing the setup procedure for a peripheral. stf92 General 3 02-27-2010 07:06 PM
About Net2280 PCI to USB 2.0 peripheral device controller anitemp Linux - Hardware 2 10-30-2008 07:07 PM
HP PhotoSmart 2710 peripheral issues... avory Linux - Hardware 11 12-23-2005 06:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 10:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration