#!/bin/bash port=/dev/ttyUSB0 cmdfile=~/annunciatorServer.txt ## Setup serial port ## speed 9600 baud; rows 0; columns 0; line = 0; ## intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; swtch = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; discard = ^O; min = 0; time = 0; ## -parenb -parodd -cmspar cs8 -hupcl -cstopb cread clocal -crtscts ## -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8 ## -opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 ## -isig -icanon -iexten -echo -echoe -echok -echonl -noflsh -xcase -tostop -echoprt -echoctl -echoke -flusho -extproc stty -F $port 0:4:8bd:0:3:1c:7f:15:4:0:0:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0 ## Setup files touch $cmdfile ## Monitor file for new commands while true do incmd=$(head -c 1 $cmdfile) if [ _$incmd != _ ] then echo $incmd > $port > $cmdfile fi sleep 1 done