I have a rather strange issue. I DCcduino Uno (Arduino Uno copy) plugged into my Xubuntu box via the USB serial interface. Using the Arduino GUI Serial Monitor, I can communicate with the board as expected. Also, when the serial monitor is open, I can ssh into the box and run commands like
echo 1700 > /dev/ttyUSB0
completely fine. However, as soon as I close the serial monitor (even if the Arduino GUI is still running) that command no longer does anything.
I have tried open the serial port with several combinations of stty
arguments including everything from
stty -F /dev/ttyUSB0 9600 cs8 cread clocal
to
stty -F /dev/ttyUSB0 cs8 9600 ignbrk -brkint -icrnl -imaxbel -opost -onlcr -isig -icanon -iexten -echo -echoe -echok -echoctl -echoke noflsh -ixon -crtscts
but it just won't write to the arduino. What am I doing wrong?
EDIT:
I just managed to get it working using
stty -F /dev/ttyUSB0 raw ispeed 9600 ospeed 9600 cs8 -ignpar -cstopb -echo
cat < /dev/ttyUSB0 > /dev/null &
echo "1700" > /dev/ttyUSB0
However, this only works with the backgrounded cat
running. Is there any way to get it working without that line?