LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 09-24-2015, 11:14 AM   #1
Uqbar
LQ Newbie
 
Registered: Aug 2007
Location: Regnum Utriusque Siciliæ
Distribution: Kubuntu 14.04
Posts: 24

Rep: Reputation: 0
Question USB device has 2 endpoints, only one is created by udev


I have a USB GPS receiver that works perfectly under Windows by creating two "virtual serial ports" (COM15 and COM16).
When I plug the unit to my Linux box I get instead a single serial port ttyACM0. Useless to say I need both.

Now, lsusb -vvv says this:
Code:
Bus 002 Device 003: ID 152a:8230 Thesycon Systemsoftware & Consulting GmbH 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            2 Communications
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0         8
  idVendor           0x152a Thesycon Systemsoftware & Consulting GmbH
  idProduct          0x8230 
  bcdDevice            1.10
  iManufacturer           1 Septentrio  
  iProduct                2 Septentrio USB Device
  iSerial                 0 
  bNumConfigurations      2
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           91
    bNumInterfaces          4
    bConfigurationValue     2
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol    255 Vendor Specific (MSFT RNDIS?)
      iInterface              0 
      CDC Header:
        bcdCDC               1.01
      CDC ACM:
        bmCapabilities       0x0e
          connection notifications
          sends break
          line coding and serial state
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol    255 Vendor specific
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           0
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol    255 Vendor Specific (MSFT RNDIS?)
      iInterface              0 
      CDC Header:
        bcdCDC               1.01
      CDC ACM:
        bmCapabilities       0x0e
          connection notifications
          sends break
          line coding and serial state
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol    255 Vendor specific
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x04  EP 4 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           62
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xc0
      Self Powered
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      1 AT-commands (v.25ter)
      iInterface              0 
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1 
      CDC Header:
        bcdCDC               1.01
      CDC ACM:
        bmCapabilities       0x0e
          connection notifications
          sends break
          line coding and serial state
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x01  EP 1 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
Device Status:     0x0001
  Self Powered
while /sys/kernel/debug/usb/device contains this:
Code:
T:  Bus=02 Lev=02 Prnt=02 Port=02 Cnt=01 Dev#=  3 Spd=12   MxCh= 0
D:  Ver= 1.10 Cls=02(comm.) Sub=00 Prot=00 MxPS= 8 #Cfgs=  2
P:  Vendor=152a ProdID=8230 Rev= 1.10
S:  Manufacturer=Septentrio  
S:  Product=Septentrio USB Device
C:  #Ifs= 4 Cfg#= 2 Atr=c0 MxPwr=  2mA
I:  If#= 0 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=02 Prot=ff Driver=
I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=ff Driver=
E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:  If#= 2 Alt= 0 #EPs= 0 Cls=02(comm.) Sub=02 Prot=ff Driver=
I:  If#= 3 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=ff Driver=
E:  Ad=04(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=85(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
C:* #Ifs= 2 Cfg#= 1 Atr=c0 MxPwr=  2mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=01 Driver=cdc_acm
E:  Ad=83(I) Atr=03(Int.) MxPS=  64 Ivl=1ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_acm
E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
Once plugged in, the kernel reports this in the logs:
Code:
[ 2738.788150] usb 2-1.2: new full-speed USB device number 3 using ehci-pci
[ 2738.876575] usb 2-1.2: New USB device found, idVendor=152a, idProduct=8230
[ 2738.876584] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2738.876590] usb 2-1.2: Product: Septentrio USB Device
[ 2738.876594] usb 2-1.2: Manufacturer: Septentrio
[ 2738.941229] cdc_acm 2-1.2:1.0: ttyACM0: USB ACM device
[ 2738.942171] usbcore: registered new interface driver cdc_acm
[ 2738.942174] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN
As far as i understood that could be an issue with udev not being configured to do so for this specific device.
Can anyone provide me with some hint or pointer to documentation (other than the generic udev one)?
Many thanks in advance.

Last edited by Uqbar; 09-29-2015 at 02:00 AM. Reason: Solved
 
Old 09-24-2015, 07:26 PM   #2
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,817

Rep: Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144
I'm not familiar with this device, but it might be that additional driver support is required to handle this. I did find this old thread asking the same question for same device

http://comments.gmane.org/gmane.linux.usb.general/87231

The user was communicating with a couple of kernel developers. There I did read this advice
Code:
> The cdc-acm driver cannot handle those ports, but a more forgiving
> generic driver can.  I don't recommend it for normal use because it
> abuses the option driver, but Ben could do a simple test like this:
>
>    echo 2 >/sys/bus/usb/devices/usbportname>/bConfigurationValue
>    modprobe option
>    echo 152a 8230 > /sys/bus/usb-serial/drivers/option1/new_id
>
> Unless I missed something, this should result in two /dev/ttyUSBx serial
> devices.
Some experimentation would be needed, but I'm hoping that using the option driver might help with exposing the additional serial interfaces. Ideally, this device would be best supported by a dedicated driver, but the above may be sufficient to gaining access to the required control and communication interfaces.
 
1 members found this post helpful.
Old 09-28-2015, 04:54 AM   #3
Uqbar
LQ Newbie
 
Registered: Aug 2007
Location: Regnum Utriusque Siciliæ
Distribution: Kubuntu 14.04
Posts: 24

Original Poster
Rep: Reputation: 0
Thanks @ferrari for the useful link.
It actually works manually but I need a way to have it working at boot.
I can load the option kernel module in /etc/rc.local, but where should I put those two echos?
I was thinking about /etc/udev/rules.d/ but am not sure on how to do it.
Any hint?
 
Old 09-28-2015, 12:32 PM   #4
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,817

Rep: Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144
You could try rolling those commands up into a script (eg /usr/bin/custom.sh) like this

Code:
#!/bin/bash
echo '2' >/sys/bus/usb/devices/usbportname>/bConfigurationValue
modprobe option
echo '152a 8230' > /sys/bus/usb-serial/drivers/option1/new_id
Make it executable with 'chmod +x custom.sh' command

The udev rule like this
Code:
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="152a", ATTR{idProduct}=="8230", RUN+="/usr/bin/custom.sh"
See how that goes.
 
Old 09-29-2015, 01:52 AM   #5
Uqbar
LQ Newbie
 
Registered: Aug 2007
Location: Regnum Utriusque Siciliæ
Distribution: Kubuntu 14.04
Posts: 24

Original Poster
Rep: Reputation: 0
Lightbulb Solved!

I followed a slightly different path by merging all the details I've gathered so far.
Basically

1. I made option.ko loaded at system boot
2. I put the remaining stuff into an udev rule like this:
Code:
SUBSYSTEMS=="usb", ATTRS{product}=="Septentrio USB Device", ATTR{bConfigurationValue}="2", PROGRAM+="/bin/bash -c \"/bin/echo $VENDOR $PRODUCT > /sys/bus/usb-serial/drivers/option1/new_id\""
where I identify the device with the fist two predicates, switch to the second configuration and enable the serial interface (ttyUSB1, ttyUSB3) for that device.

Very likely it's possible to refine the solution (I personally don't like that shell spawning) but as of now I am in rush with a deployable solution and will keep it as it's now. Thanks to all.

I hope this will help others.

Sources:
 
Old 09-29-2015, 03:15 AM   #6
ferrari
LQ Guru
 
Registered: Sep 2003
Location: Auckland, NZ
Distribution: openSUSE Leap
Posts: 5,817

Rep: Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144Reputation: 1144
I'm glad to have been of help.
 
  


Reply

Tags
udev, usb, usb serial



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
USB gadgetfs: how to use interrupt endpoints BernardOfCA Linux - Software 0 12-01-2010 09:45 PM
Can't bind my device to a driver, or get a /dev/<devname> created by udev will_berry70 Linux - General 1 12-07-2009 09:32 AM
Using udev to tell Ubuntu to use the proper device on a multiple USB device Jeff91 Linux - Hardware 20 08-20-2009 12:10 PM
Created new partition. No device node for it. udev Slack10.2 myslfkeepslippin Linux - General 5 02-01-2006 02:16 PM
removable usb device (no icons created) retiem Ubuntu 3 10-18-2005 04:46 PM

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

All times are GMT -5. The time now is 06:25 PM.

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