Last active
June 9, 2018 21:03
-
-
Save rwoloszyn/35eb1d592da8822c9ad7e6ed743371f8 to your computer and use it in GitHub Desktop.
Bash serial (tty) looper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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