Find the answer to your Linux question:
Results 1 to 6 of 6
I have a USB serial device which presents itself as: Code: Bus 002 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port This is a MSR505C magnetic stripe card ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Jul 2007
    Posts
    111

    USB serial driver


    I have a USB serial device which presents itself as:

    Code:
    Bus 002 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
    This is a MSR505C magnetic stripe card reader.

    I know this device is supposed to work as a character device in GNU/Linux because there is a library called "libmsr" to use it with.

    However, the device will not map to any device on my /dev filesystem.

    I have compiled the usbserial module, loaded it, created the special character files with mknod, then connected the physical USB device, which then presents the kernel system messages (by dmesg):

    Code:
    usb 2-2: new full speed USB device using uhci_hcd and address 4
    usb 2-2: default language 0x0409
    usb 2-2: New USB device found, idVendor=067b, idProduct=2303
    usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    usb 2-2: Product: USB-Serial Controller D
    usb 2-2: Manufacturer: Prolific Technology Inc. 
    usb 2-2: uevent
    usb 2-2: usb_probe_device
    usb 2-2: configuration #1 chosen from 1 choice
    usb 2-2: adding 2-2:1.0 (config #1, interface 0)
    usb 2-2:1.0: uevent
    usbserial_generic 2-2:1.0: usb_probe_interface
    usbserial_generic 2-2:1.0: usb_probe_interface - got id
    drivers/usb/core/inode.c: creating file '004'
    hub 2-0:1.0: state 7 ports 2 chg 0000 evt 0004
    Even though the device is obviously detected, I cannot open any of the /dev/ttyUSB* devices to access it.

    I even tried accessing it using the libmsr utility on ALL 256 ttyUSB* devices as such:

    Code:
    for i in $(seq 0 255); do ./msr /dev/ttyUSB${i}; done
    However, all of them give the error:

    Code:
    msr: Serial open of /dev/ttyUSB253 failed: No such device
    With the two last giving me:
    Code:
    msr: Serial open of /dev/ttyUSB254 failed: No such device or address
    msr: Serial open of /dev/ttyUSB255 failed: No such device or address

  2. #2
    Just Joined!
    Join Date
    Feb 2010
    Location
    Brazil
    Posts
    7
    Which kernel version are you using? Maybe an upgrade would help.

    Maybe the driver created a different entry in /dev. I use the command:

    ls -l /dev | wc -l

    before and after plugging the device to see any changes in /dev.

  3. #3
    Linux Newbie
    Join Date
    Jul 2007
    Posts
    111
    Quote Originally Posted by gustavo-serra View Post
    Which kernel version are you using? Maybe an upgrade would help.

    Maybe the driver created a different entry in /dev. I use the command:

    ls -l /dev | wc -l

    before and after plugging the device to see any changes in /dev.
    Great tip, thanks!

    I found four new devices that show up upon connecting the device; although, I still get:

    Code:
    x86_1# ./msr /dev/usbdev2.3_ep00 
    msr: Serial open of /dev/usbdev2.3_ep00 failed: No such device or address
    x86_1# ./msr /dev/usbdev2.3_ep02 
    msr: Serial open of /dev/usbdev2.3_ep02 failed: No such device or address
    x86_1# ./msr /dev/usbdev2.3_ep81
    msr: Serial open of /dev/usbdev2.3_ep81 failed: No such device or address
    x86_1# ./msr /dev/usbdev2.3_ep83
    msr: Serial open of /dev/usbdev2.3_ep83 failed: No such device or address
    My kernel version is 2.6.30, custom compiled by myself, USB works perfectly fine and I do have the USB serial module loaded which apparently detects something as per the dmesg output I posted at the start.

  4. #4
    Just Joined!
    Join Date
    Feb 2010
    Location
    Brazil
    Posts
    7
    Well, since you configured and compiled your own kernel, did you remember to enable the option USB_SERIAL_PL2303? It seems that there is a specific kernel module for Prolific. The module name is pl2303. The module usbserial_generic should only be loaded when no specific module is found.

  5. #5
    Linux Newbie
    Join Date
    Jul 2007
    Posts
    111
    Quote Originally Posted by gustavo-serra View Post
    Well, since you configured and compiled your own kernel, did you remember to enable the option USB_SERIAL_PL2303? It seems that there is a specific kernel module for Prolific. The module name is pl2303. The module usbserial_generic should only be loaded when no specific module is found.
    Oh wow, I didn't know that; thank you very much!

    That really explains a lot, I thought the support for my device was through the generic serial module!

    And yes, it does indeed work now.

  6. #6
    Just Joined!
    Join Date
    Feb 2010
    Location
    Brazil
    Posts
    7
    Glad I could help.

    One way to discover which module the kernel muse use is to use a default kernel from a large distribution (Slackware, Ubuntu) or to include almost everything in your custom kernel as a module (in the category Device Drivers). Let the kernel load the module and use lsmod to verify which one was loaded.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •