Skip to content

Commit

Permalink
Update uart_log.sh
Browse files Browse the repository at this point in the history
Pick the serial device by ID, allowing us to safely predict the paths to find the left and right bud at
Also improve the script so it asks which bud we'd like to debug
Specify necessary minicom options, so it opens even if the default configuration is invalid
  • Loading branch information
nicka101 authored May 9, 2024
1 parent 124f054 commit 3e95c41
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions uart_log.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/usr/bin/env sh

num=$(find /dev -name 'ttyUSB*' | rev | cut -c 1)
echo "$num"
sudo minicom "port$num"
rightbud=/dev/serial/by-id/usb-wch.cn_USB_Dual_Serial_0123456789-if00
leftbud=/dev/serial/by-id/usb-wch.cn_USB_Dual_Serial_0123456789-if02

read -p "Which bud do you want to connect to UART for? L/R (default L): " -n 1 -r
ttydev=$leftbud
if [[ $REPLY =~ ^[Rr]$ ]]; then
ttydev=$rightbud
fi
sudo minicom -D $ttydev -b 2000000

0 comments on commit 3e95c41

Please sign in to comment.