Jetson Nano Unable to Communicate with Serial Device

I’m trying to communicate with a device (an IMU) via serial, but I’m not able to open the port. I’m getting the following error returned from the PySerial Python Module:

Error: Could not configure port: (25, 'Inappropriate ioctl for device')

My IMU is plugged directly into a Jetson Nano USB 3.0 port. Here’s the output from dmesg:

[11562.545478] usb 1-2.1: new full-speed USB device number 12 using tegra-xusb
[11562.567294] usb 1-2.1: New USB device found, idVendor=2639, idProduct=0002
[11562.567302] usb 1-2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[11562.567307] usb 1-2.1: Product: MTi-20 VRU
[11562.567312] usb 1-2.1: Manufacturer: Xsens
[11562.567317] usb 1-2.1: SerialNumber: 026001B1

So the device is being found, but it’s not being assigned to a ttyUSB* port. Here’s the output from ls -l /dev:

lrwxrwxrwx 1 root root 15 Sep 18 17:26 IMU -> bus/usb/001/012

On computer with the device working properly the following is returned from dmesg:

[25131.692211] usb 1-2: new full-speed USB device number 15 using xhci_hcd
[25131.841470] usb 1-2: New USB device found, idVendor=2639, idProduct=0002
[25131.841475] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[25131.841478] usb 1-2: Product: MTi-20 VRU
[25131.841481] usb 1-2: Manufacturer: Xsens
[25131.841484] usb 1-2: SerialNumber: 026001B1
[25131.842719] xsens_mt 1-2:1.1: xsens_mt converter detected
[25131.843138] usb 1-2: xsens_mt converter now attached to ttyUSB0

and ls -l /dev (I didn’t bother to set up udev rules on this computer)

crw-rw----  1 root dialout 188,     0 Sep 18 17:29 ttyUSB0

Could anyone point me to a driver or something that I may be missing?

Edit: I did some more digging and I’m pretty sure I’m missing a driver for this cable that I’m using to connect to the device. From the MFG website this is stated:

If you are using the MTi with the standard USB cable (CA-USB-MTi) (i.e. without a USB to serial converter) the correct drivers have to be installed.

For Windows: 
Make sure to have WinUSB installed.

For Linux:
libusb is included in the latest Linux kernel (Ubuntu).
In case the MTi is not recognized, visit https://github.com/xsens/xsens_mt to install the driver manually (e.g. on some versions of embedded Linux).

Does anyone know if libusb is included with the Jetson Nano or how to install it if it is not?

hello samxpi,

it seems the device already recognize by Nano platform, you might check how to access the Xsens device.
you may also check the serial port configuration as below,
for example,

$ sudo stty -F /dev/ttyUSB0 -a

then you should simply by reading sysnode to check the returning values,
for example,

$ sudo cat /dev/ttyUSB0

Hi JerryChang,

In my original post I outline two different cases: one where the device works (on my laptop running Ubuntu 16.04) and one where it does not work (on the Jetson Nano).

The device is only recognized as /dev/ttyUSB0 on my laptop. On the Jetson Nano it is listed as /dev/bus/usb/001/012 .

I think I’m missing a key driver for this device. Do you know if libusb is installed with the Jetson Nano? Apparently this is required to communicate with this device.

On my computer where the device works, this is the output of sudo stty -F /dev/ttyUSB0:

speed 9600 baud; line = 0;
-brkint -imaxbel

If I try to do this for /dev/bus/usb/001/012 on my Jetson Nano I get:

stty: /dev/bus/usb/001/006: Operation not permitted

For both platforms, my Jetson Nano and my laptop, executing sudo cat /dev/* prints garbage.

hello samxpi,

please refer to Topic 1058341 for the steps of USB power control.
thanks

Jerry,

I’m not sure exactly what this has to do with my problem. I saw that there was a step in this post to install libusb. I tried that just to find that I already have it installed.

I’m not really sure what else to do.

Alright I finally got this to work. It was a matter of correctly install the USB drivers associated with my IMU.