Unable to open port '/dev/ttyUSB0': gnu.io.NoSuchPortException

We have a Java/Spring application that’s trying to access the 'ttyUSBx" ports on the current build of Linux linaro-alip 4.2.4-linaro-lt-qcom (46) on the Dragonboard 410c. One of the devices we’re trying to connect to is the “Digi XStick Adapter” using either of the “USB 2.0 (host mode only)” ports on the Dragonboard 410c. We can see the USBx devices in ‘dmesg’ as well as ‘lsusb -v’ at the OS level (Below), but are getting the following error when trying to access the USBx ports via the Java Driver:

2016-02-17T17:20:54,197 pool-3-thread-2 INFO [:] : Create device handler for Smart Plug DS 1
2016-02-17T17:20:54,216 pool-3-thread-2 WARN [:] : unable to get connection to network for device: Device{schema_version=1, last_mod_date=1455729286393, fields=com.wirelessglue.db.TypeRestrictedMap: {_dev_addr_zigbee_conn=usb:/dev/ttyUSB0, _dev_addr_zigbee_ieee=F152}, id=ab3c536e-b867-49dd-950f-9af33429c050, name=Smart Plug DS 1, parent_id=311f81b0-3ddd-48d1-8b20-8f1f7e9cf8dc, description=Smart Plug DS 1, enabled=true, last_read_date=0, plugin_name=com.wirelessglue.driver.handler.zigbee.ZigbeeDigiSmartPlugHandlerPlugin, datasets=[DataSet{schema_version=1, last_mod_date=1455728900748, fields=com.wirelessglue.db.TypeRestrictedMap: {}, id=bc124263-8979-4de2-8b67-450575b57ab6, name=Smart Plug DS 1, description=Smart Plug DS 1, seq_description=timestamp, device_id=ab3c536e-b867-49dd-950f-9af33429c050, val_descriptions={demand=Power, on_off_state=State}}]}
com.wirelessglue.exception.driver.ConnectionFailedException: Unable to open port ‘/dev/ttyUSB0’: gnu.io.NoSuchPortException
at com.wirelessglue.driver.wgn.Spi2Connection.<init>(Spi2Connection.java:313)
at com.wirelessglue.driver.wgn.Spi2ConnectionFactory.parse(Spi2ConnectionFactory.java:71)
at com.wirelessglue.driver.wgn.Spi2ConnectionFactory.parse(Spi2ConnectionFactory.java:33)
at com.wirelessglue.device.DeviceManager.getConnection(DeviceManager.java:108)
at com.wirelessglue.driver.ConnectionManager.getConnection(ConnectionManager.java:67)
at com.wirelessglue.driver.handler.zigbee.ZigbeeConnectionManager.getConnection(ZigbeeConnectionManager.java:48)
at com.wirelessglue.driver.handler.zigbee.AbstractZigbeeHandlerPlugin.getConnection(AbstractZigbeeHandlerPlugin.java:71)
at com.wirelessglue.driver.handler.zigbee.ZigbeeDigiSmartPlugHandlerPlugin.createHandler(ZigbeeDigiSmartPlugHandlerPlugin.java:88)
at com.wirelessglue.fulcrum.manager.DeviceHandlerManager$1.call(DeviceHandlerManager.java:185)
at com.wirelessglue.fulcrum.manager.DeviceHandlerManager$1.call(DeviceHandlerManager.java:181)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: gnu.io.NoSuchPortException
at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:273)
at com.wirelessglue.driver.wgn.Spi2Connection.<init>(Spi2Connection.java:257)
… 13 more

Output from dmesg and lsusb -v:

root@linaro-alip:/opt/se/fulcrum# dmesg

[98162.660593] usb 1-1.2: new high-speed USB device number 9 using msm_hsusb_host
[98162.772622] usb 1-1.2: New USB device found, idVendor=1a40, idProduct=0101
[98162.772707] usb 1-1.2: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[98162.778481] usb 1-1.2: Product: USB 2.0 Hub
[98162.794129] hub 1-1.2:1.0: USB hub found
[98162.794609] hub 1-1.2:1.0: 4 ports detected
[98163.100266] usb 1-1.2.2: new full-speed USB device number 10 using msm_hsusb_host
[98163.236995] usb 1-1.2.2: New USB device found, idVendor=0403, idProduct=6001
[98163.237083] usb 1-1.2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[98163.244633] usb 1-1.2.2: Product: XStick
[98163.251804] usb 1-1.2.2: Manufacturer: Digi
[98163.263235] ftdi_sio 1-1.2.2:1.0: FTDI USB Serial Device converter detected
[98163.265562] usb 1-1.2.2: Detected FT232RL
[98163.282253] usb 1-1.2.2: FTDI USB Serial Device converter now attached to ttyUSB0

root@linaro-alip:/opt/se/fulcrum# lsusb -v

Bus 001 Device 010: 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 Digi
iProduct 2 XStick
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 32
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
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 XStick
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)

Bus 001 Device 009: ID 1a40:0101 Terminus Technology Inc. 4-Port HUB
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 1 Single TT
bMaxPacketSize0 64
idVendor 0x1a40 Terminus Technology Inc.
idProduct 0x0101 4-Port HUB
bcdDevice 1.11
iManufacturer 0
iProduct 1 USB 2.0 Hub
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 25
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0001 1x 1 bytes
bInterval 12
Hub Descriptor:
bLength 9
bDescriptorType 41
nNbrPorts 4
wHubCharacteristic 0x0000
Ganged power switching
Ganged overcurrent protection
TT think time 8 FS bits
bPwrOn2PwrGood 50 * 2 milli seconds
bHubContrCurrent 100 milli Ampere
DeviceRemovable 0x00
PortPwrCtrlMask 0xff
Hub Port Status:
Port 1: 0000.0100 power
Port 2: 0000.0103 power enable connect
Port 3: 0000.0100 power
Port 4: 0000.0100 power
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 0 Full speed (or root) hub
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0001
Self Powered

Bus 001 Device 002: ID 0424:2513 Standard Microsystems Corp. 2.0 Hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 2 TT per port
bMaxPacketSize0 64
idVendor 0x0424 Standard Microsystems Corp.
idProduct 0x2513 2.0 Hub
bcdDevice b.b3
iManufacturer 0
iProduct 0
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 41
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 2mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 1 Single TT
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0001 1x 1 bytes
bInterval 12
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 1
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 2 TT per port
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0001 1x 1 bytes
bInterval 12
Hub Descriptor:
bLength 9
bDescriptorType 41
nNbrPorts 3
wHubCharacteristic 0x000d
Per-port power switching
Compound device
Per-port overcurrent protection
TT think time 8 FS bits
bPwrOn2PwrGood 50 * 2 milli seconds
bHubContrCurrent 1 milli Ampere
DeviceRemovable 0x0e
PortPwrCtrlMask 0xff
Hub Port Status:
Port 1: 0000.0100 power
Port 2: 0000.0503 highspeed power enable connect
Port 3: 0000.0100 power
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 0 Full speed (or root) hub
bMaxPacketSize0 64
bNumConfigurations 1
Device Status: 0x0001
Self Powered

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 9 Hub
bDeviceSubClass 0 Unused
bDeviceProtocol 1 Single TT
bMaxPacketSize0 64
idVendor 0x1d6b Linux Foundation
idProduct 0x0002 2.0 root hub
bcdDevice 4.02
iManufacturer 3 Linux 4.2.4-linaro-lt-qcom ehci_hcd
iProduct 2 EHCI Host Controller
iSerial 1 78d9000.ehci
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 25
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 0mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 9 Hub
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0 Full speed (or root) hub
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0004 1x 4 bytes
bInterval 12
Hub Descriptor:
bLength 9
bDescriptorType 41
nNbrPorts 1
wHubCharacteristic 0x0009
Per-port power switching
Per-port overcurrent protection
TT think time 8 FS bits
bPwrOn2PwrGood 10 * 2 milli seconds
bHubContrCurrent 0 milli Ampere
DeviceRemovable 0x00
PortPwrCtrlMask 0xff
Hub Port Status:
Port 1: 0000.0503 highspeed power enable connect
Device Status: 0x0001
Self Powered
root@linaro-alip:/opt/se/fulcrum#

Possibly a permissions issue?

Thanks in advance,
Rob…

hi,

could it be that your Java application doesn’t have enough permission to access the device, it might not run as root, in which case you might need a custom udev rule.

Thanks for the reply. We’re currently running the Java Application as “root” and have also added the “root” user to the “dialout” group which is the primary group on the ‘/dev/ttyUSB0’ device (See below):

root@linaro-alip:/opt/se/fulcrum# ps -ef | grep fulcrum
root 10535 3035 0 08:12 pts/2 00:00:00 tail -1000f fulcrum.log
root 10564 1 0 08:13 ? 00:00:00 /bin/bash /opt/se/fulcrum/grun spring/fulcrum.xml
root 10590 10564 5 08:13 ? 00:05:25 java -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=9000 -Djava.rmi.server.hostname=127.0.0.1 -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -XX:+UseG1GC -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xms256M -Xmx512M -XX:MaxPermSize=256M -Djna.nosys=true -Dwgn.base.dir=/opt/se/fulcrum -cp /opt/se/fulcrum/lib/* com.wirelessglue.launch.StandAloneLauncher spring/fulcrum.xml
root@linaro-alip:/opt/se/fulcrum#

root@linaro-alip:/opt/se/fulcrum# ls -ltr /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Feb 18 13:23 /dev/ttyUSB0

root@linaro-alip:/opt/se/fulcrum# cat /etc/group

dialout:x:20:linaro,root

Thanks in advance.

hmm. how about this:

which brings to

could that be it?

or even http://stackoverflow.com/questions/10620691/rxtx-not-working-in-ubuntu

Thanks again for your reply. A little more background. We’re currently running this Java Application with the same components (JDK 7, FTDI, Linux) on a number of other devices and OS flavors (Dell IoT Gateway, Dell Edge Gateway 5000, Intel Edison IoT Gateway, Beaglebone Black, Ubuntu 12.04 LTS, Ubuntu 14.04 LTS, Ubuntu Core 15.04, Wind River Linux) and it’s working as expected. It appears to be something unique to the Dragonboard 410c.

Thanks in advance,
Rob…