Jetson TX2 DJI SDK ROS acitviation issue

I’m using Jetson TX2 running ROS with Ubuntu 16.04 LTS 64-bit using a USB to UART cable. I conencted a Matrice 100 and Jetson TX2’s serial port “/dev/ttyS0” with a baud rate at 230400. When I run sdk_manifold.launch I receive the error:
Succeed to create thread for readPoll
ERROR activate, line 449: Please calll getDroneVersion first.
Broadcast call back received
This is the second TX2 that I’ve worked with. Back in April I worked with one and received the same issue. The problem was that the port on the TX2 was somehow closed or disabled. After googling I was able to establish communication between the TX2 and Matrice 100 but I have since forgotten what commands I entered in the terminal to allow communication. This person was having the same exact issue however they are using the Manifold (a DJI product) instead of a TX2. I’ve contacted DJI however they weren’t able to assist much since the TX2 is not their product. Has anyone ran into this same issue. Any help would be greatly appreciated.
Thank you

I can’t be of much help, I know nothing about ROS or your Matrice 100. I would suggest first verifying the port settings are correct for the wiring. On the serial port side you may need to know if CTS/RTS is connected…if not, flow control would be software…if it is, flow control would be CTS/RTS (hardware). At that speed it is likely hardware flow control is becoming important.

One thing you can do is disconnect the hardware from the serial port, wire TX to RX, and CTS to DTS, which is loopback for the port. Then use a serial console program (such as gtkterm or minicom) to talk to the tty…see if typing in echoes back. If it doesn’t echo, or if the echo is garbage, then settings are wrong.

FYI, serial console is on “/dev/ttyS0”. Unless you’ve done something to disable serial console the port will be at 115200 8N1 and have its own stream of characters in conflict. J17 is ttyTHS2 and the camera module can be disconnected to make use of the port.

hello Agnal,

FYI, we also tested and confirmed J21 serial port with baud rate 115200 works on R28.1

Thanks linuxdev and JerryChang for your replies. I’m new to Linux and Ubuntu and not too familiar with some terms.

linuxdev, is it necessary to have both Tx,Rx and CTS,RTS connected? I have Tx and Rx connected between my TX2 and Matrice but not the other two.

JerryChang, are you testing with a DJI Matrice? To access J21 would you call “/dev/ttyJ21”? What is R28.1?

r28.1 is the BSP (Board Support Package version) comes with JetPack 3.1,

This is the latest Jetson software release that works for both Jetson TX1 and TX2. Since you are using ROS, so this won’t apply to your board.

But one thing you could check is if your issue is baud rate related so helpful to check if 115200 exposes the same issue for you or not.

Thanks for your input chijen. I just tried 115200 and it gives me the exact same error.
I’m curious about this output that I get:

$ setserial -g /dev/ttyS[0]
/dev/ttyS0, UART: undefined, Port: 0x0000, IRQ: 36

I’m using /dev/ttyS0 to communicate between the Matrice and TX2. Should I be concerned about it being “undefined”?

setserial only talks to a driver, it doesn’t talk to the hardware. The driver was not programmed to know what chip type of UART is there. I suspect this is because the UART can be programmed by register to become a 16450 or a 16550. If you need, pretend it is a 16550A for any initialized port, or 16450 for any uninitialized port.

Thank you everyone for all of your assistance. This has been very tricky. I think I’ve resolved half of my problem. The TX2 is now recognizing the connection with the Matrice. I switched over to /dev/ttyUSB0 and now my FTDI connection is recognized. I wasn’t seeing this before with /dev/ttyS0.

$ dmesg | grep tty
[    0.000000] Kernel command line: fbcon=map:0 net.ifnames=0 console=tty0 OS=l4t console=ttyS0,115200n8 memtype=0 video=tegrafb no_console_suspend=1 earlycon=uart8250,mmio32,0x03100000 gpt tegraid= tegra_keep_boot_clocks maxcpus=6 android.kerneltype=normal androidboot.serialno=0335115020673 vpr_resize root=/dev/mmcblk0p1 rw rootwait
[    0.022450] console [tty0] enabled
[    1.937690] console [ttyS0] disabled
[    2.349019] 3100000.serial: ttyS0 at MMIO 0x3100000 (irq = 36, base_baud = 25500000) is a Tegra
[    2.408610] console [ttyS0] enabled
[    2.459693] 3110000.serial: ttyTHS1 at MMIO 0x3110000 (irq = 37, base_baud = 0) is a TEGRA_UART
[    2.460601] 3130000.serial: ttyTHS3 at MMIO 0x3130000 (irq = 38, base_baud = 0) is a TEGRA_UART
[    5.838772] usb 1-2.3: FTDI USB Serial Device converter now attached to ttyUSB0
[   13.068384] systemd[1]: Created slice system-serial\x2dgetty.slice.

Now the other problem is I don’t seem to have access to the port. I receive this error:

$ sudo lsusb -D /dev/ttyUSB0
Cannot open /dev/ttyUSB0

I’ve googled around and can’t seem to find a solution. Everything I find on forums is followed by additional information such as: No such file or directory, No such device or address, etc. Most of these can be resolved by adding yourself to the ‘dialout’ group but I’m already part of ‘dialout’. Does anyone have any suggestions for solving this issue?

It may be you simply need to add the user to the right group. Most likely this is “dialout”, but use “ls -l /dev/ttyUSB0” to see if this is correct. Example:

sudo usermod -a -G dialout <whoeveritis>

Can you please share how you connected Matrice 100 with TX2? Is it possible for TX2 to use power from the Matrice? Which cable or adapter is necessary?