Reading from serial port - initial string is what I write to it.
All,
I have a modem hooked up on a serial port through a usb->serial interface. I've been able to open a port, send a command (using the "write" on /dev/ttyUSB0) and read the response (using "read" port). However, I notice that the first read response that is captured on the port using the "read" is actually the original command I send using the "write". Can someone help explain why I see this behavior? Also, how do I fix it so I don't read the command that I'm sending out? Thx... |
Send "ATE0" to the modem to turn off command echoing.
|
Thanks for the suggestion. I'll try it. However, there's one thing I don't understand. I did hook up to this modem using minicom and sent the same commands. I don't see any command echo'ing there. Do you see a reason why we should expect a difference in behavior when sending these commands through a "c" program?
|
What initialization string is minicom sending or are you disabling it with -o?
|
I don't believe minicom is sending any init string - nor I am explicitly trying to disable any. That's why I'm kind of perplexed.
|
When I run minicom -s it says the init string is:
Quote:
|
I'm unable to see the minicom settings the way you are printing it out. However, browsing through the "screen and keyboard" options, it looks like echoing is turned off in there. I'm guessing that's equivalent to "ATE0" that you are suggesting.
|
Sorry about the delay in my reply. I managed to find the init string in minicom and it _does_ show that command echoing was enabled. Disabling it in my c-code (using ATE0) helped resolve the issue. Thanks for the help!
|
All times are GMT -5. The time now is 05:26 AM. |