ttyUSB writing the received data back
I have CP2108 device connected to my hardware, it has 4 interfaces: /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2, /dev/ttyUSB3
I connected /dev/ttyUSB0 to /dev/ttyUSB1
We have also set the baud rate properly to 9600 using stty command
I am transmitting hello from echo "hello" > /dev/ttyUSB0
I receive "hello" back in /dev/ttyUSB1 and /dev/ttyUSB0
cat /dev/ttyUSB0
cat /dev/ttyUSB1
Looking at the driver logs, after read_callback on USB1 it also calls write_callback , why is this happening, as the expected behavior is to only receive on USB1
Thanks for your patience and time
Update:
stty -a -F /dev/ttyUSB1
speed 600 baud;stty: /dev/ttyUSB1
line = 216;
intr = f; quit = ^B; erase = M-'; kill = 8; eof = <undef>; eol = <undef>; eol2 = <undef>; swtch = ^?; start = s;
stop = @; susp = <undef>; rprnt = <undef>; werase = <undef>; lnext = ^C; flush = <undef>; min = 0; time = 0;
-parenb parodd cs5 -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 nl1 cr3 tab3 bs1 vt1 ff0
-isig icanon -iexten echo echoe echok echonl noflsh xcase tostop echoprt echoctl echoke
c serial-port linux-device-driver tty
add a comment |
I have CP2108 device connected to my hardware, it has 4 interfaces: /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2, /dev/ttyUSB3
I connected /dev/ttyUSB0 to /dev/ttyUSB1
We have also set the baud rate properly to 9600 using stty command
I am transmitting hello from echo "hello" > /dev/ttyUSB0
I receive "hello" back in /dev/ttyUSB1 and /dev/ttyUSB0
cat /dev/ttyUSB0
cat /dev/ttyUSB1
Looking at the driver logs, after read_callback on USB1 it also calls write_callback , why is this happening, as the expected behavior is to only receive on USB1
Thanks for your patience and time
Update:
stty -a -F /dev/ttyUSB1
speed 600 baud;stty: /dev/ttyUSB1
line = 216;
intr = f; quit = ^B; erase = M-'; kill = 8; eof = <undef>; eol = <undef>; eol2 = <undef>; swtch = ^?; start = s;
stop = @; susp = <undef>; rprnt = <undef>; werase = <undef>; lnext = ^C; flush = <undef>; min = 0; time = 0;
-parenb parodd cs5 -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 nl1 cr3 tab3 bs1 vt1 ff0
-isig icanon -iexten echo echoe echok echonl noflsh xcase tostop echoprt echoctl echoke
c serial-port linux-device-driver tty
1
You need to analyze the termios settings of the receiving serial terminal, i.e.stty -a -F /dev/ttyUSB1, to see if echoing is enabled. It probably is, since it's commonly employed for normal canonical terminal communications.
– sawdust
Nov 13 '18 at 8:14
Vote to close: this isn't a programming question.
– sawdust
Nov 13 '18 at 8:16
I added stty command output. Can you please look
– md.jamal
Nov 13 '18 at 8:24
3
its because you have echo enable. trystty -echo /dev/ttyUSB1this will solve echo issue. credit goes to sawdust who asked for these stty logs. hope this solves the issue.
– Devidas
Nov 13 '18 at 9:20
After disabling all the -echo it solved the problem. Thanks sawdust, Devidas
– md.jamal
Nov 14 '18 at 6:52
add a comment |
I have CP2108 device connected to my hardware, it has 4 interfaces: /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2, /dev/ttyUSB3
I connected /dev/ttyUSB0 to /dev/ttyUSB1
We have also set the baud rate properly to 9600 using stty command
I am transmitting hello from echo "hello" > /dev/ttyUSB0
I receive "hello" back in /dev/ttyUSB1 and /dev/ttyUSB0
cat /dev/ttyUSB0
cat /dev/ttyUSB1
Looking at the driver logs, after read_callback on USB1 it also calls write_callback , why is this happening, as the expected behavior is to only receive on USB1
Thanks for your patience and time
Update:
stty -a -F /dev/ttyUSB1
speed 600 baud;stty: /dev/ttyUSB1
line = 216;
intr = f; quit = ^B; erase = M-'; kill = 8; eof = <undef>; eol = <undef>; eol2 = <undef>; swtch = ^?; start = s;
stop = @; susp = <undef>; rprnt = <undef>; werase = <undef>; lnext = ^C; flush = <undef>; min = 0; time = 0;
-parenb parodd cs5 -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 nl1 cr3 tab3 bs1 vt1 ff0
-isig icanon -iexten echo echoe echok echonl noflsh xcase tostop echoprt echoctl echoke
c serial-port linux-device-driver tty
I have CP2108 device connected to my hardware, it has 4 interfaces: /dev/ttyUSB0, /dev/ttyUSB1, /dev/ttyUSB2, /dev/ttyUSB3
I connected /dev/ttyUSB0 to /dev/ttyUSB1
We have also set the baud rate properly to 9600 using stty command
I am transmitting hello from echo "hello" > /dev/ttyUSB0
I receive "hello" back in /dev/ttyUSB1 and /dev/ttyUSB0
cat /dev/ttyUSB0
cat /dev/ttyUSB1
Looking at the driver logs, after read_callback on USB1 it also calls write_callback , why is this happening, as the expected behavior is to only receive on USB1
Thanks for your patience and time
Update:
stty -a -F /dev/ttyUSB1
speed 600 baud;stty: /dev/ttyUSB1
line = 216;
intr = f; quit = ^B; erase = M-'; kill = 8; eof = <undef>; eol = <undef>; eol2 = <undef>; swtch = ^?; start = s;
stop = @; susp = <undef>; rprnt = <undef>; werase = <undef>; lnext = ^C; flush = <undef>; min = 0; time = 0;
-parenb parodd cs5 -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 nl1 cr3 tab3 bs1 vt1 ff0
-isig icanon -iexten echo echoe echok echonl noflsh xcase tostop echoprt echoctl echoke
c serial-port linux-device-driver tty
c serial-port linux-device-driver tty
edited Nov 13 '18 at 8:24
md.jamal
asked Nov 13 '18 at 6:34
md.jamalmd.jamal
424519
424519
1
You need to analyze the termios settings of the receiving serial terminal, i.e.stty -a -F /dev/ttyUSB1, to see if echoing is enabled. It probably is, since it's commonly employed for normal canonical terminal communications.
– sawdust
Nov 13 '18 at 8:14
Vote to close: this isn't a programming question.
– sawdust
Nov 13 '18 at 8:16
I added stty command output. Can you please look
– md.jamal
Nov 13 '18 at 8:24
3
its because you have echo enable. trystty -echo /dev/ttyUSB1this will solve echo issue. credit goes to sawdust who asked for these stty logs. hope this solves the issue.
– Devidas
Nov 13 '18 at 9:20
After disabling all the -echo it solved the problem. Thanks sawdust, Devidas
– md.jamal
Nov 14 '18 at 6:52
add a comment |
1
You need to analyze the termios settings of the receiving serial terminal, i.e.stty -a -F /dev/ttyUSB1, to see if echoing is enabled. It probably is, since it's commonly employed for normal canonical terminal communications.
– sawdust
Nov 13 '18 at 8:14
Vote to close: this isn't a programming question.
– sawdust
Nov 13 '18 at 8:16
I added stty command output. Can you please look
– md.jamal
Nov 13 '18 at 8:24
3
its because you have echo enable. trystty -echo /dev/ttyUSB1this will solve echo issue. credit goes to sawdust who asked for these stty logs. hope this solves the issue.
– Devidas
Nov 13 '18 at 9:20
After disabling all the -echo it solved the problem. Thanks sawdust, Devidas
– md.jamal
Nov 14 '18 at 6:52
1
1
You need to analyze the termios settings of the receiving serial terminal, i.e.
stty -a -F /dev/ttyUSB1, to see if echoing is enabled. It probably is, since it's commonly employed for normal canonical terminal communications.– sawdust
Nov 13 '18 at 8:14
You need to analyze the termios settings of the receiving serial terminal, i.e.
stty -a -F /dev/ttyUSB1, to see if echoing is enabled. It probably is, since it's commonly employed for normal canonical terminal communications.– sawdust
Nov 13 '18 at 8:14
Vote to close: this isn't a programming question.
– sawdust
Nov 13 '18 at 8:16
Vote to close: this isn't a programming question.
– sawdust
Nov 13 '18 at 8:16
I added stty command output. Can you please look
– md.jamal
Nov 13 '18 at 8:24
I added stty command output. Can you please look
– md.jamal
Nov 13 '18 at 8:24
3
3
its because you have echo enable. try
stty -echo /dev/ttyUSB1 this will solve echo issue. credit goes to sawdust who asked for these stty logs. hope this solves the issue.– Devidas
Nov 13 '18 at 9:20
its because you have echo enable. try
stty -echo /dev/ttyUSB1 this will solve echo issue. credit goes to sawdust who asked for these stty logs. hope this solves the issue.– Devidas
Nov 13 '18 at 9:20
After disabling all the -echo it solved the problem. Thanks sawdust, Devidas
– md.jamal
Nov 14 '18 at 6:52
After disabling all the -echo it solved the problem. Thanks sawdust, Devidas
– md.jamal
Nov 14 '18 at 6:52
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53275108%2fttyusb-writing-the-received-data-back%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53275108%2fttyusb-writing-the-received-data-back%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
You need to analyze the termios settings of the receiving serial terminal, i.e.
stty -a -F /dev/ttyUSB1, to see if echoing is enabled. It probably is, since it's commonly employed for normal canonical terminal communications.– sawdust
Nov 13 '18 at 8:14
Vote to close: this isn't a programming question.
– sawdust
Nov 13 '18 at 8:16
I added stty command output. Can you please look
– md.jamal
Nov 13 '18 at 8:24
3
its because you have echo enable. try
stty -echo /dev/ttyUSB1this will solve echo issue. credit goes to sawdust who asked for these stty logs. hope this solves the issue.– Devidas
Nov 13 '18 at 9:20
After disabling all the -echo it solved the problem. Thanks sawdust, Devidas
– md.jamal
Nov 14 '18 at 6:52