Skip to content

Instantly share code, notes, and snippets.

@rwoloszyn
Last active Jun 9, 2018
Embed
What would you like to do?
Bash serial (tty) looper
#!/bin/bash
DEVICE=/dev/ttyUSB0
BAUDRATE=230400
echo "=======SETTINGS========="
echo "port: $DEVICE"
echo "spped: $BAUDRATE"
echo "========================"
sudo stty -F $DEVICE $BAUDRATE parity=none bits=8
echo "=====VALIDATING========"
stty -F $DEVICE
echo "==Stargin loop=="
COUNTER=20
until [ $COUNTER -lt 10 ]; do
echo "Loop !!!"
echo -e 'A' > stty -F $DEVICE $BAUDRATE parity=none bits=8
sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment