Hello everyone!
I have the same problem as the thread starter.
I have an arduino Uno communicating over usb2serial with the arduino IDE (and its serial monitor) which is running on ubuntu 12.04 64bit. I can interface the arduino over serial using CuteCom and screen.
However, i'm not able to open the port on the cli and echo my commands to the /dev/ttyACM0. I can only do it when I open the device using CuteCom, but then the answer from the arduino gets caught by CuteCom and does not show on the shell.
So there is no problem with permissions or anything, it's simply a matter of properly initializing the port.
I know that I have to use stty, I followed the instructions on the playground but without success.
What I've done so far:
Initialize the port using the serial monitor from arduino IDE and then read the parameters with stty like so:
stty -a < /dev/ttyACM0
which tells me:
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; flush = ^O; min = 0; time = 0;
-parenb -parodd 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
Ok fine so i put it together to use these parameters to open the port (i tried with and without raw option):
stty -F /dev/ttyACM0 cs8 9600 raw -parenb -parodd 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
... but no luck!
When I do
echo "led 1" > /dev/ttyACM0
nothing happens except restarting the arduino! The pin 13 led blinks 3 times and then once again.
I've read something about the DTR pin and if this pin is set high, the arduino reboots (to upload sketches and what not). But thats why im using the -hupcl option right?
This is driving me nuts, it shoudn't be that complicated to open the serial port to the arduino and talk to it on the command line...
I would really appreaciate your help.
PS: using a different progam or python to open the port is not an option. I need a pure shell solution.