I have problem sending AT commands to my USB modem.At first I tried php-serial class, but when I was reading data, I got endless loop with strange data. Then I tried to debug problem and opened putty terminal, made commandcat /dev/ttyUSB0and then sent command echo AT > /dev/ttyUSB0 after that I always got never ending loop from cat /dev/ttyUSB0 like this:ATAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^JAT^and this loop never ends. On Windows all works just fine. I can connect to USB modem via virtual COM port and send command / get answer.Question is why can't I just receive OK message from console, but instead of this I got this data loop?Tried different huawei USB modems, and different stty settings and also default settings for huawei modems:Baud rate: 9600 / 115200Parity: noneData bits = 8Stop bits = 1Flow control = nonetest dev # uname -aLinux test 3.5.7-gentoo #3 SMP Sun Feb 17 04:58:22 EET 2013 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 5200+ AuthenticAMD GNU/Linuxcompiled newer kernel: 3.6.11-gentoo and now when sending command:echo AT > /dev/ttyUSB0got result like:OKATOKATOKATit never ended, I terminated cat command, then sent other ( make call command ):echo ATDT 27789388; > /dev/ttyUSB0and got answer from cat without loop.systest ~ # cat /dev/ttyUSB0ATDT 27789388;OKso why tty terminal is acting so strange? maybe I don't know something about sending/reading data on serial ports?if it can help then output of stty -a -F /dev/ttyUSB0 command is:speed 9600 baud; rows 0; columns 0; line = 0;intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0;-parenb -parodd cs8 hupcl -cstopb cread clocal -crtscts-ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl -ixon -ixoff -iuclc -ixany -imaxbel -iutf8opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke
Endless data loop from dev/ttyUSB while sending AT commands
linux;terminal;usb;tty;modem