How can I use ‘pyserial’ to communicate between my Ubuntu PC and my Jetson AGX Orin?
The configuration of Jetson AGX Orin is as follows.
- Jetson AGX Orin Dev Kit.
- Jetpack 5.0.2.
- Headless mode.
The USB port uses the type-C port next to the GPIO pins.
I’m guessing that /dev/ttyACM0
should be used for dmesg on the Ubuntu PC side below.
[19971.006930] usb 2-1: new SuperSpeed Gen 1 USB device number 4 using xhci_hcd
[19971.027486] usb 2-1: New USB device found, idVendor=0955, idProduct=7020, bcdDevice= 0.02
[19971.027490] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[19971.027492] usb 2-1: Product: Linux for Tegra
[19971.027495] usb 2-1: Manufacturer: NVIDIA
[19971.027496] usb 2-1: SerialNumber: 1421922016941
[19971.033425] rndis_host 2-1:1.0 usb0: register 'rndis_host' at usb-0000:00:14.0-1, RNDIS device, 0a:66:59:96:aa:d5
[19971.034296] cdc_acm 2-1:1.2: ttyACM0: USB ACM device
[19971.035037] usb-storage 2-1:1.4: USB Mass Storage device detected
[19971.035595] scsi host9: usb-storage 2-1:1.4
[19971.055598] cdc_ncm 2-1:1.5: MAC-Address: 4e:aa:f3:18:4f:5a
[19971.055817] cdc_ncm 2-1:1.5 usb1: register 'cdc_ncm' at usb-0000:00:14.0-1, CDC NCM, 4e:aa:f3:18:4f:5a
[19971.072185] rndis_host 2-1:1.0 enp0s20f0u1: renamed from usb0
[19971.103378] cdc_ncm 2-1:1.5 enp0s20f0u1i5: renamed from usb1
[19971.173542] cdc_ncm 2-1:1.5 enp0s20f0u1i5: 3750 mbit/s downlink 3750 mbit/s uplink
[19971.237609] IPv6: ADDRCONF(NETDEV_CHANGE): enp0s20f0u1i5: link becomes ready
[19972.059297] scsi 9:0:0:0: Direct-Access Linux File-Stor Gadget 0510 PQ: 0 ANSI: 2
[19972.059798] sd 9:0:0:0: Attached scsi generic sg3 type 0
[19972.060002] sd 9:0:0:0: Power-on or device reset occurred
[19972.060275] sd 9:0:0:0: [sdc] 32768 512-byte logical blocks: (16.8 MB/16.0 MiB)
[19972.060408] sd 9:0:0:0: [sdc] Write Protect is on
[19972.060411] sd 9:0:0:0: [sdc] Mode Sense: 0f 00 80 00
[19972.060537] sd 9:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[19972.083823] sdc:
[19972.104166] sd 9:0:0:0: [sdc] Attached SCSI removable disk
[20083.042616] perf: interrupt took too long (2505 > 2500), lowering kernel.perf_event_max_sample_rate to 79750
On the other hand, the Jetson side searched for the serial port using the following python script, but could not find it.
from serial.tools import list_ports
import pprint
pprint.pprint(list(list_ports.comports()))
# []
Here is the result of dmesg | grep tty
on the Jetson side.
[ 0.000000] Kernel command line: root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 console=ttyAMA0,115200 console=tty0 firmware_class.path=/etc/firmware fbcon=map:0 net.ifnames=0 nv-auto-config
[ 0.000930] printk: console [tty0] enabled
[ 0.404105] 31d0000.serial: ttyAMA0 at MMIO 0x31d0000 (irq = 66, base_baud = 0) is a SBSA
[ 1.705860] printk: console [ttyAMA0] enabled
[ 2.484256] printk: console [ttyTCU0] enabled
[ 9.753970] 3100000.serial: ttyTHS0 at MMIO 0x3100000 (irq = 13, base_baud = 0) is a TEGRA_UART
[ 9.770213] 3130000.serial: ttyTHS3 at MMIO 0x3130000 (irq = 65, base_baud = 0) is a TEGRA_UART
[ 14.432416] systemd[1]: Created slice system-serial\x2dgetty.slice.