Skip to content

Instantly share code, notes, and snippets.

@bgulla
Last active September 6, 2024 17:50
Show Gist options
  • Save bgulla/1590d7c62a9cd67d051f4349d43ff351 to your computer and use it in GitHub Desktop.
Save bgulla/1590d7c62a9cd67d051f4349d43ff351 to your computer and use it in GitHub Desktop.
Turing PI UART Helper Script
#!/bin/bash
# Check if an argument was provided
if [[ -z "$1" ]]; then
echo "Usage: $0 <node number (1-4)>"
exit 1
fi
# Map node number to serial device
case "$1" in
1)
device="/dev/ttyS2"
;;
2)
device="/dev/ttyS1"
;;
3)
device="/dev/ttyS4"
;;
4)
device="/dev/ttyS5"
;;
*)
echo "Invalid node number. Please provide a number between 1 and 4."
exit 1
;;
esac
# Execute picocom with the appropriate device and baud rate
echo "[Exiting Picocom: Ctrl + A, then immediately press Ctrl + X]"
echo "Connecting to node $1 on $device..."
picocom "$device" -b 115200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment