🧪 New tutorials are being published — build from robot arms to sensors step by step
Skip to content

Jetson: Serial Port Communication ​

Install Dependencies ​

Plain
sudo apt-get update
Plain
sudo apt-get install -y python3-smbus python3-serial

Check User Groups ​

Plain
sudo usermod -aG i2c $USER
Plain
sudo usermod -aG dialout $USER

Log out and log back in for it to take effect.

File Location ​

UART_Voice/uart_voice.py

When the module is connected to the Jetson through the UART pins, comment out SERIAL_PORT = '/dev/ttyUSB0' and uncomment SERIAL_PORT = '/dev/ttyTHS1'

Image 1

Wiring Instructions ​

Image 2

Check the Serial Port ​

Plain
ls /dev/ttyTHS*

Run ​

Plain
cd UART_Voice
Plain
python3 uart_voice.py

Output Format ​

Plain
Speech Serial Opened! Baudrate=115200
ID:4
ID:1
ID:10

When the module is connected to the Jetson through a Type data cable, uncomment SERIAL_PORT = '/dev/ttyUSB0' and comment out SERIAL_PORT = '/dev/ttyTHS1'

Image 3

Check the Serial Port ​

Plain
ls /dev/ttyUSB*

Run ​

Plain
cd UART_Voice
Plain
python3 uart_voice.py

Output Format ​

Plain
Speech Serial Opened! Baudrate=115200
ID:4
ID:1
ID:10

Troubleshooting ​

Serial Port Is Occupied ​

If the serial port cannot be opened, check whether it is occupied by another service:

Plain
sudo systemctl stop nvgetty
Plain
sudo systemctl disable nvgetty