I am a scuba diver and proud owner of 2 diving computers. These two can be connected to a USB port and with Linus' SubSurface divinglog program I can import dive-logs from them. One is an Atomic Aquatics Cobalt and the other is a Suunto D4i. Now I want to create dev-files with udev for each of them so I can connect them to any USB-port and still use the same dev-file in the logging software. (E.g. /dev/my_cobalt and /dev/my_d4i)
The same (kind of) configuration is used for both.
For the D4i the usage of the dev-file gets blocked by an automatically created /dev/ttyUSB0.
For both divingcomputers the dev-file gets created and for the Cobalt all works as wanted but not for the D4i.
I can use /dev/ttyUSB0 but not /dev/my_d4i.
Somehow it seems (I'm not sure) to be caused by a difference in the way they present themselves to the USB-bus. See the output of lsusb below.
If anyone can tell me what causes this difference and/or how to solve this I'd really appreciate it. (Why is when connecting the d4i also a ttyUSB dev-file created?)
Below is some information about findings/settings.
/etc/udev/rules.d/dive-computers.rules
# My Cobalt2 DiveComputer
SUBSYSTEM=="usb", ATTR{idVendor}=="0471", ATTR{idProduct}=="0888", SYMLINK+="my_cobalt", GROUP="dialout", MODE="0660"
# My Suunto D4i DiveComputer
SUBSYSTEM=="usb", ATTR{idVendor}=="0403", ATTR{idProduct}=="6001", SYMLINK+="my_d4i", GROUP="dialout", MODE="0660"
dev-files after connecting Cobalt
lrwxrwxrwx 1 root root 15 mei 16 23:13 my_cobalt -> bus/usb/003/007
# no ttyUSB0 created
dev-files after connecting d4i
lrwxrwxrwx 1 root root 15 mei 16 23:15 my_d4i -> bus/usb/003/009
crw-rw---- 1 root dialout 188, 0 mei 16 23:15 ttyUSB0
lsusb -v -D /dev/bus/usb/003/007 (Cobalt)
Device: ID 0471:0888 Philips (or NXP) Hantek DDS-3005 Arbitrary Waveform Generator Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 220 Diagnostic bDeviceSubClass 1 Reprogrammable Diagnostics bDeviceProtocol 1 USB2 Compliance bMaxPacketSize0 16 idVendor 0x0471 Philips (or NXP) idProduct 0x0888 Hantek DDS-3005 Arbitrary Waveform Generator bcdDevice 0.02 iManufacturer 1 ATOMIC AQUATICS iProduct 2 COBALT iSerial 3 123456789ABCDEF bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 39 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 4 Console bmAttributes 0xe0 Self Powered Remote Wakeup MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 3 bInterfaceClass 220 Diagnostic bInterfaceSubClass 160 bInterfaceProtocol 176 iInterface 0 Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN 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 0x02 EP 2 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 Device Status: 0x0101 Self Powered
lsusb -v -D /dev/bus/usb/003/009 (D4i)
Device: ID 0403:6001 Future Technology Devices International, Ltd FT232 USB-Serial (UART) IC Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 2.00 bDeviceClass 0 (Defined at Interface level) bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x0403 Future Technology Devices International, Ltd idProduct 0x6001 FT232 USB-Serial (UART) IC bcdDevice 6.00 iManufacturer 1 Smartinterface iProduct 2 USB Serial Cable iSerial 3 DiYISDGK bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 32 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0xa0 (Bus Powered) Remote Wakeup MaxPower 500mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 2 bInterfaceClass 255 Vendor Specific Class bInterfaceSubClass 255 Vendor Specific Subclass bInterfaceProtocol 255 Vendor Specific Protocol iInterface 2 USB Serial Cable Endpoint Descriptor: bLength 7 bDescriptorType 5 bEndpointAddress 0x81 EP 1 IN 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 0x02 EP 2 OUT bmAttributes 2 Transfer Type Bulk Synch Type None Usage Type Data wMaxPacketSize 0x0040 1x 64 bytes bInterval 0 Device Status: 0x0000 (Bus Powered)
logging of the software (for what its worth)
Starting download from /dev/my_d4i Starting the thread 0 [0.000126] ERROR: Inappropriate ioctl for device (25) [in ../../src/serial_posix.c:308 (dc_serial_open)] [0.000156] ERROR: Failed to open the serial port. [in ../../src/suunto_d9.c:155 (suunto_d9_device_open)] INFO: dc_deveice_open error value of -6 Finishing the thread Unable to open %s %s (%s) dives downloaded 0 Starting download from /dev/ttyUSB0 Starting the thread 0 INFO: dc_deveice_open error value of 0 Finishing the thread dives downloaded 0