> /bin/stty -F /dev/ttyUSB0 9600 sane evenp crtscts cs7 igncr

            ^^ --- no a standard stty option
> The first problem I'm having is that the stty setting doesn't seem to
> stick:
>
> $ stty -f /dev/ttyU0
> ispeed 0 baud; ospeed 9600 baud;
> lflags: echoe echoke echoctl
> cflags: cs8 -parenb
> 
> $ stty -f /dev/ttyU0 9600 sane parenb -parodd crtscts cs7 igncr

-f is not -F

When the tty is closed, it reverts to the default configuration.
There is no support for this -F method.

What you need to instead is wrap all this in a way which keeps the
tty open

    (
        stty 9600 sane parenb -parodd crtscts cs7 igncr
        do your IO loop
    ) </dev/ttyU0 0>&1 0>&2

Something like that.

Reply via email to