Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Disable console to UART0 (to use UART0 for other purposes)

    Scheduled Pinned Locked Moved LoPy
    uartuart0console
    8 Posts 4 Posters 4.0k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • E Offline
      Eric24
      last edited by

      How do I go about programmatically disabling console I/O to UART0? In production, I don't want the console to be there at all, and at the same time, I want to use UART0 to communicate with a serial device.

      Note: I say "programmatically" because I want to be able to select console or no console during boot-up (initially disabled, but enabled in boot.py if a particular input put is held low, for example).

      robert-hhR 1 Reply Last reply Reply Quote 1
      • robert-hhR Offline
        robert-hh @Eric24
        last edited by

        @Eric24 The are two aspects, REPL prompt and debug messages. The REPL prompt on the console is enabled in _boot.py with os.dupterm() and can be disableb with os.dupterm(None).
        The debug messages are told to be disabled some time in one of the next versions.

        1 Reply Last reply Reply Quote 0
        • RobTuDelftR Offline
          RobTuDelft
          last edited by

          @robert-hh Does disabling the REPL prompt free up the UART?

          Without data you're just another person with an opinion.
          Hackster | About me

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            Shaun @RobTuDelft
            last edited by Shaun

            @RobTuDelft
            Yes. I disable the REPL in boot.py and then use all three UARTS in my application. I use UART0 to communicate with a computer and UART1 & 2 to communicate with sensor networks.

            E 1 Reply Last reply Reply Quote 0
            • RobTuDelftR Offline
              RobTuDelft
              last edited by

              Ah great, didn't actually test this yet.

              Would it be possible to have all UARTs available and instead replicate the REPL over a websocket?

              Without data you're just another person with an opinion.
              Hackster | About me

              E 1 Reply Last reply Reply Quote 0
              • E Offline
                Eric24 @RobTuDelft
                last edited by

                @RobTuDelft I assume that would be the case (I haven't had a chance to test it yet), but looking at os.dupterm(None), I would think you could still Telnet into the device.

                1 Reply Last reply Reply Quote 0
                • E Offline
                  Eric24 @Shaun
                  last edited by

                  @Shaun Are you able to stop the debug messages, too? Based on my experience (and as @robert-hh mentions), I didn't think they could currently be disabled.

                  S 1 Reply Last reply Reply Quote 0
                  • S Offline
                    Shaun @Eric24
                    last edited by

                    @Eric24
                    The debug messages at startup, before the micropython interpreter starts, are not stopped, but this is not a problem for me.
                    No further debug messages are output once the python interpreter is started, unless the system throws an error.

                    The startup debug messages are output at 115kbs.

                    To stop the debug messages, my understanding is that one can compile a custom image with debug messages disabled, but I have not attempted this as they are not hampering my application.

                    1 Reply Last reply Reply Quote 0

                    Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                    Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                    With your input, this post could be even better 💗

                    Register Login
                    • 1 / 1
                    • First post
                      Last post

                    Pycom on Twitter

                    Pycom