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

    UART handler error

    Scheduled Pinned Locked Moved WiPy 2&3
    wipyuart0
    7 Posts 2 Posters 2.3k Views 2 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.
    • M Offline
      michalt38
      last edited by michalt38

      Hello,
      When I call uart irq like this:
      uart.irq(trigger = UART.RX_ANY, handler = hand)
      and hand function looks like this:
      def hand():
      return

      I've got this error:
      Uncaught exception in callback handler
      TypeError:

      And another thing is that when I write: bytes = UART.read() I've got this error:
      argument num/types mismatch

      What can cause those problems?

      L 1 Reply Last reply Reply Quote 0
      • L Offline
        livius @michalt38
        last edited by

        @michalt38

        Where do you found uart.irq docs?

        and what do you pass as argument of UART.write() ?
        It can not be empty - and it must by bytes()

        think about people first, then computers

        M 1 Reply Last reply Reply Quote 0
        • M Offline
          michalt38 @livius
          last edited by michalt38

          @livius Sorry, it was UART.read() and it is solved
          And I found UART.irq doc here: http://docs.micropython.org/en/latest/wipy/library/machine.UART.html#machine.UART.irq

          L 1 Reply Last reply Reply Quote 0
          • L Offline
            livius @michalt38
            last edited by

            @michalt38
            Do you have Wipy1 or Wipy2.0?

            And I found UART.irq doc here: http://docs.micropython.org/en/latest/wipy/library/machine.UART.html#machine.UART.irq

            This doc is for Wipy1.
            For Wipy2.0 doc are here
            https://docs.pycom.io/pycom_esp32/index.html
            uart is here
            https://docs.pycom.io/pycom_esp32/library/machine.UART.html

            think about people first, then computers

            M 1 Reply Last reply Reply Quote 0
            • M Offline
              michalt38 @livius
              last edited by

              @livius I've got WiPy 1

              L 1 Reply Last reply Reply Quote 0
              • L Offline
                livius @michalt38
                last edited by

                @michalt38 said in UART handler error:

                I've got WiPy 1

                I can not help more because i have only Wipy2.0.
                Maybe someone else...

                think about people first, then computers

                M 1 Reply Last reply Reply Quote 0
                • M Offline
                  michalt38 @livius
                  last edited by

                  This post is deleted!
                  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