Created
April 12, 2015 16:10
-
-
Save hdznrrd/505cca085491b7d22d9a to your computer and use it in GitHub Desktop.
use buspirate v2.go to figure out at which baud rate a UART device talking AT commands communicates
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/sh | |
# use buspirate v2.go to figure out at which baud rate a UART device talking AT commands communicates | |
# 2015 [email protected] | |
# device is powercycled for each try | |
DEV=/dev/ttyUSB0 | |
echo "#" >$DEV #reset | |
sleep 1 | |
for baud in 1 2 3 4 5 6 7 8 9; do | |
echo "m 3 $baud 1 1 1 2" >$DEV; sleep 0.1 | |
for newline in "0x0d 0x0a" "0x0a"; do | |
echo "W" >$DEV; sleep 0.1 | |
echo "{" >$DEV; sleep 2 # enter live read; wait for powerup | |
echo "\"AT\" $newline" >$DEV; sleep 2 | |
echo "}" >$DEV; sleep 0.1 | |
echo "w" >$DEV; sleep 0.5 | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment