Im trying to use bash to read from ttyS0 and need to set the following but im struggling to figure it out
databits = 7
stopbits = 2
parity = 0
flow control = 0
heres my code:
#!/bin/bash
# Port setting
stty -F /dev/ttyS0 raw speed 1200
# Loop
while [ 1 ];
do
echo 'LOADING...'
READ=`dd if=/dev/ttyS0 count=1`
echo $READ
echo '[PRESS Ctrl + C TO EXIT]'
done
The script is working but I need to set the parameters. Any suggestions? And thanks:)
man stty
is a terrible reference, things that matter buried between tons of insignificant junk that might have mattered 50 years ago, and essential entries referenced elsewhere defined in non-searchable way (there's no entry forcs8
, justcsN
). Sending people toman stty
is just as bad as sending people wanting to unpack archive toman tar
was until recently (with its tape sizes, tape-changing etc) – Bounded