Re: Serial ports for Septentrio USB GNSS receiver

2013-06-11 Thread Ben Adler

On 10.06.2013 20:19, Bjørn Mork wrote:

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.


Before plugging in the receiver, there's ttyUSB0 and ttyUSB1 from 
another usb/serial converter device that I can't remove. After plugging 
in, dmesg says:


 usb 3-2: new full-speed USB device number 2 using uhci_hcd
 usb 3-2: New USB device found, idVendor=152a, idProduct=8230
 usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
 usb 3-2: Product: Septentrio USB Device
 usb 3-2: Manufacturer: Septentrio
 cdc_acm 3-2:1.0: ttyACM0: USB ACM device
 usbcore: registered new interface driver cdc_acm
 cdc_acm: USB Abstract Control Model driver for USB modems and ISDN 
adapters


and ttyACM0 appears.

# echo 2 /sys/bus/usb/devices/usbportname/bConfigurationValue

 usbcore: registered new interface driver cdc_ether
 usb 3-2: bad CDC descriptors
 usb 3-2: bad CDC descriptors
 usbcore: registered new interface driver rndis_host
 usb 3-2: bad CDC descriptors
 usb 3-2: bad CDC descriptors
 usbcore: registered new interface driver rndis_wlan

ttyACM0 is gone and no new ttyUSB* appear.

# modprobe option

 usbcore: registered new interface driver option
 usbserial: USB Serial support registered for GSM modem (1-port)

# echo 152a 8230  /sys/bus/usb-serial/drivers/option1/new_id

 option 3-2:2.0: GSM modem (1-port) converter detected
 usb 3-2: GSM modem (1-port) converter now attached to ttyUSB2
 option 3-2:2.1: GSM modem (1-port) converter detected
 usb 3-2: GSM modem (1-port) converter now attached to ttyUSB3
 option 3-2:2.2: GSM modem (1-port) converter detected
 usb 3-2: GSM modem (1-port) converter now attached to ttyUSB4
 option 3-2:2.3: GSM modem (1-port) converter detected
 usb 3-2: GSM modem (1-port) converter now attached to ttyUSB5

ttyUSB2 is dead
ttyUSB3 works and is connected to a port named USB1 on the receiver
ttyUSB4 is dead
ttyUSB5 works and is connected to a port named USB2 on the receiver

usb-devices now shows:

T:  Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=02(commc) Sub=00 Prot=00 MxPS= 8 #Cfgs=  2
P:  Vendor=152a ProdID=8230 Rev=01.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(commc) Sub=02 Prot=ff Driver=option
I:  If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=ff Driver=option
I:  If#= 2 Alt= 0 #EPs= 0 Cls=02(commc) Sub=02 Prot=ff Driver=option
I:  If#= 3 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=ff Driver=option


I guess this device is worth a new serial driver of its own in case that
works?  Or should we create a generic driver for 02/02/ff serial devices
(using the inverse of the logic in drivers/net/usb/cdc_ether.c:
usbnet_generic_cdc_bind to avoid RNDIS devices)?  A few modems with such
ports have been added to option, but a generic solution might be better.


I obviously don't know, but would be very happy to supply further 
information!


thanks,
ben

--
Ben Adler
Universität Hamburg
MIN-Fakultät
FB Informatik, AB TAMS
Vogt-Kölln-Strasse 30
22527 Hamburg
Tel +49 40 42883 2504
Fax +49 40 42883 2397
Mob +49 160 858 0660
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Serial ports for Septentrio USB GNSS receiver

2013-05-30 Thread Ben Adler
   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   1
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x85  EP 5 IN
bmAttributes2
  Transfer TypeBulk
  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
MaxPower2mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass 2 Communications
  bInterfaceSubClass  2 Abstract (modem)
  bInterfaceProtocol  1 AT-commands (v.25ter)
  iInterface  0
  CDC Union:
bMasterInterface0
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
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   1
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber1
  bAlternateSetting   0
  bNumEndpoints   2
  bInterfaceClass10 CDC Data
  bInterfaceSubClass  0 Unused
  bInterfaceProtocol  0
  iInterface  0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01  EP 1 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   1
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82  EP 2 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   1
Device Status: 0x0001
  Self Powered

Even though I don't really understand the interfaces and endpoints, I 
get the impression there's multiple CDC-Data interfaces.


How can I use them?

Also, is there a way to influence the latency? As I'm using the 
receiver's data for flight control, I'd prefer to achieve low latency in 
data transfer from receiver-host on at least one port. I see the 
Transfer Type for most endpoints is bulk, not interrupt, but maybe 
there's a few tricks to make bulk-transfers faster? Right now I'm seeing 
latencies between 5 and 70ms.


thanks!
ben

--
Ben Adler
Universität Hamburg
MIN-Fakultät
FB Informatik, AB TAMS
Vogt-Kölln-Strasse 30
22527 Hamburg
Tel +49 40 42883 2504
Fax +49 40 42883 2397
Mob +49 160 858 0660
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html