Skip to content

Instantly share code, notes, and snippets.

@devilmonastery
Created February 3, 2024 09:47
Show Gist options
  • Save devilmonastery/cf13236819cf7b12940a91b8639ca9e4 to your computer and use it in GitHub Desktop.
Save devilmonastery/cf13236819cf7b12940a91b8639ca9e4 to your computer and use it in GitHub Desktop.
turing pi 2 console connect script
#!/bin/bash
# A simple script to help access the serial consoles on
# turing pi 2 nodes.
#
# Usage: ./console.sh <node number>
node=${1}
# The consoles are on nonsensical TTYs, so map them.
declare -A ttys
ttys[1]="/dev/ttyS2"
ttys[2]="/dev/ttyS1"
ttys[3]="/dev/ttyS4"
ttys[4]="/dev/ttyS5"
# Pick the tty corresponding to the node.
tty=${ttys[$node]}
# If an invalid node number was given, exit.
if [[ ${tty} = "" ]]; then
echo "Connect to the serial console on a node."
echo "$0 [1..4]"
exit 1
fi
echo "Use ctrl-x to exit. Connecting to node${node} on ${tty}"
echo
# connect
microcom -s 115200 ${tty}
echo
echo "disconnected"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment