How can minicom “permanently” translate incoming newline (n) to CR+LF?
up vote
6
down vote
favorite
I have a micro-controller device that is sending newline-terminated strings through the USB-attached serial port and (so far) I'm using minicom
version 2.6 to read from /dev/ttyACM0
. I've setup the terminal application for line wrapping but I'd like it to go to the beginning of the next line when receiving a line feed character from my serial device. Can [and how does] minicom
do that?
EDIT: I've also tried ways known by me such as stty /dev/ttyACM0 ...,inlcr
and screen /dev/ttyACM0 ...,inlcr
, which I know have options to translate incoming new-line into carriage-return+line-feed (CR+LF) and none of these work either. I've tried other options as well (such as ocrnl
, in case my logic was wrong, nl
and -nl
), none work and I don't know why.
Ah, and I'm running Manjaro 16.06-rc1.
serial-port newlines minicom
add a comment |
up vote
6
down vote
favorite
I have a micro-controller device that is sending newline-terminated strings through the USB-attached serial port and (so far) I'm using minicom
version 2.6 to read from /dev/ttyACM0
. I've setup the terminal application for line wrapping but I'd like it to go to the beginning of the next line when receiving a line feed character from my serial device. Can [and how does] minicom
do that?
EDIT: I've also tried ways known by me such as stty /dev/ttyACM0 ...,inlcr
and screen /dev/ttyACM0 ...,inlcr
, which I know have options to translate incoming new-line into carriage-return+line-feed (CR+LF) and none of these work either. I've tried other options as well (such as ocrnl
, in case my logic was wrong, nl
and -nl
), none work and I don't know why.
Ah, and I'm running Manjaro 16.06-rc1.
serial-port newlines minicom
add a comment |
up vote
6
down vote
favorite
up vote
6
down vote
favorite
I have a micro-controller device that is sending newline-terminated strings through the USB-attached serial port and (so far) I'm using minicom
version 2.6 to read from /dev/ttyACM0
. I've setup the terminal application for line wrapping but I'd like it to go to the beginning of the next line when receiving a line feed character from my serial device. Can [and how does] minicom
do that?
EDIT: I've also tried ways known by me such as stty /dev/ttyACM0 ...,inlcr
and screen /dev/ttyACM0 ...,inlcr
, which I know have options to translate incoming new-line into carriage-return+line-feed (CR+LF) and none of these work either. I've tried other options as well (such as ocrnl
, in case my logic was wrong, nl
and -nl
), none work and I don't know why.
Ah, and I'm running Manjaro 16.06-rc1.
serial-port newlines minicom
I have a micro-controller device that is sending newline-terminated strings through the USB-attached serial port and (so far) I'm using minicom
version 2.6 to read from /dev/ttyACM0
. I've setup the terminal application for line wrapping but I'd like it to go to the beginning of the next line when receiving a line feed character from my serial device. Can [and how does] minicom
do that?
EDIT: I've also tried ways known by me such as stty /dev/ttyACM0 ...,inlcr
and screen /dev/ttyACM0 ...,inlcr
, which I know have options to translate incoming new-line into carriage-return+line-feed (CR+LF) and none of these work either. I've tried other options as well (such as ocrnl
, in case my logic was wrong, nl
and -nl
), none work and I don't know why.
Ah, and I'm running Manjaro 16.06-rc1.
serial-port newlines minicom
serial-port newlines minicom
edited May 2 '17 at 16:59
asked May 18 '16 at 12:41
user86969
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
4
down vote
accepted
Took me long enough but here I am at last! I've had to download minicom source code to get an idea what to do to avoid the hassle of constantly pressing Ctrl+Z, U... Here it is.
minicom
stores its parameters in a configuration file, which defaults to $HOME/.minirc.dfl
. Put the following line, to the letter:
pu addcarreturn Yes
and now minicom
adds a carriage return to all incoming lines. I have no idea why it didn't save that option along with its configuration file in the first place but, heck, I don't care now!
Beware that every option after pu
must take exactly 16 characters, padded with spaces to the right.
add a comment |
up vote
3
down vote
ANSWER:
In minicom press Ctrl+A Z
. This will show the menu. Then press U
("Add Carriage Ret"), and minicom will add the CR
symbol to each LF
symbol automatically.
You may want to do that again in order to turn this function OFF.
WORKAROUND:
Try sending the lines terminating with "rn"
from the microcontroller.r
means the Carriage return (ASCII code 13 or 0xd)n
means the Line feed or New line (ASCII code 10 or 0xa)
So I get the answer is «No, it doesn't», right?
– user86969
Nov 14 '16 at 21:21
@Nasha I have never tried to do that. I just hit the very similar problem and solved it the way I described. So it was not be the answer to your actual question, but rather a work-around suggestion. Please see my edited answer for Minicom v.2.7.
– v_2e
Nov 15 '16 at 8:18
Ok, it seems to work now. Is there a command line argument to avoid doing it all the time interactively?
– user86969
Nov 15 '16 at 12:08
You can executeminicom -s
as root, chooseScreen and keyboard
, then pressT - Add carriage return
, andSave setup as dfl
to turn this option ON systemwide. Or you can save this configuration in a separate onfig-file, and then use asminicom -D /dev/ttyUSB0 /etc/minicom/minirc.myconfig
. Unfortunately, Minicom 2.7 release seems to include an old man page, so these new options are not described there.
– v_2e
Nov 15 '16 at 17:20
Saving theadd carriage return
option in the configuration file doesn't seem to work. I must go through the setup screens and manually tell minicom to add the carriage return (i.e.Ctrl
+Z
thenU
)... Oddly enough when I go to the menu (Ctrl
+Z
), select configure minicom (O
) and then configure the display & keyboard, the optionAdd carriage return
is set toNo
! Go figure!
– user86969
Nov 17 '16 at 10:04
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
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',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
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%2funix.stackexchange.com%2fquestions%2f283924%2fhow-can-minicom-permanently-translate-incoming-newline-n-to-crlf%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
Took me long enough but here I am at last! I've had to download minicom source code to get an idea what to do to avoid the hassle of constantly pressing Ctrl+Z, U... Here it is.
minicom
stores its parameters in a configuration file, which defaults to $HOME/.minirc.dfl
. Put the following line, to the letter:
pu addcarreturn Yes
and now minicom
adds a carriage return to all incoming lines. I have no idea why it didn't save that option along with its configuration file in the first place but, heck, I don't care now!
Beware that every option after pu
must take exactly 16 characters, padded with spaces to the right.
add a comment |
up vote
4
down vote
accepted
Took me long enough but here I am at last! I've had to download minicom source code to get an idea what to do to avoid the hassle of constantly pressing Ctrl+Z, U... Here it is.
minicom
stores its parameters in a configuration file, which defaults to $HOME/.minirc.dfl
. Put the following line, to the letter:
pu addcarreturn Yes
and now minicom
adds a carriage return to all incoming lines. I have no idea why it didn't save that option along with its configuration file in the first place but, heck, I don't care now!
Beware that every option after pu
must take exactly 16 characters, padded with spaces to the right.
add a comment |
up vote
4
down vote
accepted
up vote
4
down vote
accepted
Took me long enough but here I am at last! I've had to download minicom source code to get an idea what to do to avoid the hassle of constantly pressing Ctrl+Z, U... Here it is.
minicom
stores its parameters in a configuration file, which defaults to $HOME/.minirc.dfl
. Put the following line, to the letter:
pu addcarreturn Yes
and now minicom
adds a carriage return to all incoming lines. I have no idea why it didn't save that option along with its configuration file in the first place but, heck, I don't care now!
Beware that every option after pu
must take exactly 16 characters, padded with spaces to the right.
Took me long enough but here I am at last! I've had to download minicom source code to get an idea what to do to avoid the hassle of constantly pressing Ctrl+Z, U... Here it is.
minicom
stores its parameters in a configuration file, which defaults to $HOME/.minirc.dfl
. Put the following line, to the letter:
pu addcarreturn Yes
and now minicom
adds a carriage return to all incoming lines. I have no idea why it didn't save that option along with its configuration file in the first place but, heck, I don't care now!
Beware that every option after pu
must take exactly 16 characters, padded with spaces to the right.
answered May 2 '17 at 16:59
user86969
add a comment |
add a comment |
up vote
3
down vote
ANSWER:
In minicom press Ctrl+A Z
. This will show the menu. Then press U
("Add Carriage Ret"), and minicom will add the CR
symbol to each LF
symbol automatically.
You may want to do that again in order to turn this function OFF.
WORKAROUND:
Try sending the lines terminating with "rn"
from the microcontroller.r
means the Carriage return (ASCII code 13 or 0xd)n
means the Line feed or New line (ASCII code 10 or 0xa)
So I get the answer is «No, it doesn't», right?
– user86969
Nov 14 '16 at 21:21
@Nasha I have never tried to do that. I just hit the very similar problem and solved it the way I described. So it was not be the answer to your actual question, but rather a work-around suggestion. Please see my edited answer for Minicom v.2.7.
– v_2e
Nov 15 '16 at 8:18
Ok, it seems to work now. Is there a command line argument to avoid doing it all the time interactively?
– user86969
Nov 15 '16 at 12:08
You can executeminicom -s
as root, chooseScreen and keyboard
, then pressT - Add carriage return
, andSave setup as dfl
to turn this option ON systemwide. Or you can save this configuration in a separate onfig-file, and then use asminicom -D /dev/ttyUSB0 /etc/minicom/minirc.myconfig
. Unfortunately, Minicom 2.7 release seems to include an old man page, so these new options are not described there.
– v_2e
Nov 15 '16 at 17:20
Saving theadd carriage return
option in the configuration file doesn't seem to work. I must go through the setup screens and manually tell minicom to add the carriage return (i.e.Ctrl
+Z
thenU
)... Oddly enough when I go to the menu (Ctrl
+Z
), select configure minicom (O
) and then configure the display & keyboard, the optionAdd carriage return
is set toNo
! Go figure!
– user86969
Nov 17 '16 at 10:04
add a comment |
up vote
3
down vote
ANSWER:
In minicom press Ctrl+A Z
. This will show the menu. Then press U
("Add Carriage Ret"), and minicom will add the CR
symbol to each LF
symbol automatically.
You may want to do that again in order to turn this function OFF.
WORKAROUND:
Try sending the lines terminating with "rn"
from the microcontroller.r
means the Carriage return (ASCII code 13 or 0xd)n
means the Line feed or New line (ASCII code 10 or 0xa)
So I get the answer is «No, it doesn't», right?
– user86969
Nov 14 '16 at 21:21
@Nasha I have never tried to do that. I just hit the very similar problem and solved it the way I described. So it was not be the answer to your actual question, but rather a work-around suggestion. Please see my edited answer for Minicom v.2.7.
– v_2e
Nov 15 '16 at 8:18
Ok, it seems to work now. Is there a command line argument to avoid doing it all the time interactively?
– user86969
Nov 15 '16 at 12:08
You can executeminicom -s
as root, chooseScreen and keyboard
, then pressT - Add carriage return
, andSave setup as dfl
to turn this option ON systemwide. Or you can save this configuration in a separate onfig-file, and then use asminicom -D /dev/ttyUSB0 /etc/minicom/minirc.myconfig
. Unfortunately, Minicom 2.7 release seems to include an old man page, so these new options are not described there.
– v_2e
Nov 15 '16 at 17:20
Saving theadd carriage return
option in the configuration file doesn't seem to work. I must go through the setup screens and manually tell minicom to add the carriage return (i.e.Ctrl
+Z
thenU
)... Oddly enough when I go to the menu (Ctrl
+Z
), select configure minicom (O
) and then configure the display & keyboard, the optionAdd carriage return
is set toNo
! Go figure!
– user86969
Nov 17 '16 at 10:04
add a comment |
up vote
3
down vote
up vote
3
down vote
ANSWER:
In minicom press Ctrl+A Z
. This will show the menu. Then press U
("Add Carriage Ret"), and minicom will add the CR
symbol to each LF
symbol automatically.
You may want to do that again in order to turn this function OFF.
WORKAROUND:
Try sending the lines terminating with "rn"
from the microcontroller.r
means the Carriage return (ASCII code 13 or 0xd)n
means the Line feed or New line (ASCII code 10 or 0xa)
ANSWER:
In minicom press Ctrl+A Z
. This will show the menu. Then press U
("Add Carriage Ret"), and minicom will add the CR
symbol to each LF
symbol automatically.
You may want to do that again in order to turn this function OFF.
WORKAROUND:
Try sending the lines terminating with "rn"
from the microcontroller.r
means the Carriage return (ASCII code 13 or 0xd)n
means the Line feed or New line (ASCII code 10 or 0xa)
edited Dec 6 at 7:02
Community♦
1
1
answered Nov 14 '16 at 16:37
v_2e
1416
1416
So I get the answer is «No, it doesn't», right?
– user86969
Nov 14 '16 at 21:21
@Nasha I have never tried to do that. I just hit the very similar problem and solved it the way I described. So it was not be the answer to your actual question, but rather a work-around suggestion. Please see my edited answer for Minicom v.2.7.
– v_2e
Nov 15 '16 at 8:18
Ok, it seems to work now. Is there a command line argument to avoid doing it all the time interactively?
– user86969
Nov 15 '16 at 12:08
You can executeminicom -s
as root, chooseScreen and keyboard
, then pressT - Add carriage return
, andSave setup as dfl
to turn this option ON systemwide. Or you can save this configuration in a separate onfig-file, and then use asminicom -D /dev/ttyUSB0 /etc/minicom/minirc.myconfig
. Unfortunately, Minicom 2.7 release seems to include an old man page, so these new options are not described there.
– v_2e
Nov 15 '16 at 17:20
Saving theadd carriage return
option in the configuration file doesn't seem to work. I must go through the setup screens and manually tell minicom to add the carriage return (i.e.Ctrl
+Z
thenU
)... Oddly enough when I go to the menu (Ctrl
+Z
), select configure minicom (O
) and then configure the display & keyboard, the optionAdd carriage return
is set toNo
! Go figure!
– user86969
Nov 17 '16 at 10:04
add a comment |
So I get the answer is «No, it doesn't», right?
– user86969
Nov 14 '16 at 21:21
@Nasha I have never tried to do that. I just hit the very similar problem and solved it the way I described. So it was not be the answer to your actual question, but rather a work-around suggestion. Please see my edited answer for Minicom v.2.7.
– v_2e
Nov 15 '16 at 8:18
Ok, it seems to work now. Is there a command line argument to avoid doing it all the time interactively?
– user86969
Nov 15 '16 at 12:08
You can executeminicom -s
as root, chooseScreen and keyboard
, then pressT - Add carriage return
, andSave setup as dfl
to turn this option ON systemwide. Or you can save this configuration in a separate onfig-file, and then use asminicom -D /dev/ttyUSB0 /etc/minicom/minirc.myconfig
. Unfortunately, Minicom 2.7 release seems to include an old man page, so these new options are not described there.
– v_2e
Nov 15 '16 at 17:20
Saving theadd carriage return
option in the configuration file doesn't seem to work. I must go through the setup screens and manually tell minicom to add the carriage return (i.e.Ctrl
+Z
thenU
)... Oddly enough when I go to the menu (Ctrl
+Z
), select configure minicom (O
) and then configure the display & keyboard, the optionAdd carriage return
is set toNo
! Go figure!
– user86969
Nov 17 '16 at 10:04
So I get the answer is «No, it doesn't», right?
– user86969
Nov 14 '16 at 21:21
So I get the answer is «No, it doesn't», right?
– user86969
Nov 14 '16 at 21:21
@Nasha I have never tried to do that. I just hit the very similar problem and solved it the way I described. So it was not be the answer to your actual question, but rather a work-around suggestion. Please see my edited answer for Minicom v.2.7.
– v_2e
Nov 15 '16 at 8:18
@Nasha I have never tried to do that. I just hit the very similar problem and solved it the way I described. So it was not be the answer to your actual question, but rather a work-around suggestion. Please see my edited answer for Minicom v.2.7.
– v_2e
Nov 15 '16 at 8:18
Ok, it seems to work now. Is there a command line argument to avoid doing it all the time interactively?
– user86969
Nov 15 '16 at 12:08
Ok, it seems to work now. Is there a command line argument to avoid doing it all the time interactively?
– user86969
Nov 15 '16 at 12:08
You can execute
minicom -s
as root, choose Screen and keyboard
, then press T - Add carriage return
, and Save setup as dfl
to turn this option ON systemwide. Or you can save this configuration in a separate onfig-file, and then use as minicom -D /dev/ttyUSB0 /etc/minicom/minirc.myconfig
. Unfortunately, Minicom 2.7 release seems to include an old man page, so these new options are not described there.– v_2e
Nov 15 '16 at 17:20
You can execute
minicom -s
as root, choose Screen and keyboard
, then press T - Add carriage return
, and Save setup as dfl
to turn this option ON systemwide. Or you can save this configuration in a separate onfig-file, and then use as minicom -D /dev/ttyUSB0 /etc/minicom/minirc.myconfig
. Unfortunately, Minicom 2.7 release seems to include an old man page, so these new options are not described there.– v_2e
Nov 15 '16 at 17:20
Saving the
add carriage return
option in the configuration file doesn't seem to work. I must go through the setup screens and manually tell minicom to add the carriage return (i.e. Ctrl
+Z
then U
)... Oddly enough when I go to the menu (Ctrl
+Z
), select configure minicom (O
) and then configure the display & keyboard, the option Add carriage return
is set to No
! Go figure!– user86969
Nov 17 '16 at 10:04
Saving the
add carriage return
option in the configuration file doesn't seem to work. I must go through the setup screens and manually tell minicom to add the carriage return (i.e. Ctrl
+Z
then U
)... Oddly enough when I go to the menu (Ctrl
+Z
), select configure minicom (O
) and then configure the display & keyboard, the option Add carriage return
is set to No
! Go figure!– user86969
Nov 17 '16 at 10:04
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- 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%2funix.stackexchange.com%2fquestions%2f283924%2fhow-can-minicom-permanently-translate-incoming-newline-n-to-crlf%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