How can minicom “permanently” translate incoming newline (n) to CR+LF?











up vote
6
down vote

favorite
2












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.










share|improve this question




























    up vote
    6
    down vote

    favorite
    2












    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.










    share|improve this question


























      up vote
      6
      down vote

      favorite
      2









      up vote
      6
      down vote

      favorite
      2






      2





      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.










      share|improve this question















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 2 '17 at 16:59

























      asked May 18 '16 at 12:41







      user86969





























          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.






          share|improve this answer




























            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)






            share|improve this answer























            • 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 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













            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
            });


            }
            });














            draft saved

            draft discarded


















            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.






            share|improve this answer

























              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.






              share|improve this answer























                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.






                share|improve this answer












                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.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered May 2 '17 at 16:59







                user86969































                    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)






                    share|improve this answer























                    • 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 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

















                    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)






                    share|improve this answer























                    • 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 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















                    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)






                    share|improve this answer














                    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)







                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    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 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




















                    • 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 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


















                    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




















                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    Morgemoulin

                    Scott Moir

                    Souastre