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 irq for Fipy

    Scheduled Pinned Locked Moved FiPy
    6 Posts 3 Posters 476 Views 3 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.
    • S Offline
      sanjoy
      last edited by

      Hi all,
      I need a receive callback event for uart. From the micropython site and also from a previous discussion from this forum, I found the following implementation
      uart1.irq(uart1.RX_ANY, priority=1, handler=irq_uart1, wake=machine.IDLE)

      However, on my Fipy it shows this error,
      AttributeError: 'UART' object has no attribute 'irq'

      This is the current firmware version
      (sysname='FiPy', nodename='FiPy', release='1.18.2', version='v1.8.6-849-07a52e4 on 2019-02-08', machine='FiPy with ESP32', lorawan='1.0.2', sigfox='1.0.1')

      Is the uart.irq only available for wipy? How can I get this on fipy board? Does it require to upgrade the firmware?

      1 Reply Last reply Reply Quote 0
      • P Offline
        Paul Thornton
        last edited by

        Hello Sanjoy.

        We dont expose the ability to receive a callback event on uart irq's. our implementation is a little different to the standard Micropython versions.

        1 Reply Last reply Reply Quote 0
        • S Offline
          sanjoy
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • S Offline
            sanjoy
            last edited by

            Hi Paul,
            Thanks for the reply.
            Could you please suggest me how should I implement this? Any example available?
            I need uart.irq for fipy, so that it does not need to perform polling to check if any rx data is available.

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

              @sanjoy You can use threading or uasyncio. Threading is easier to understand. It just uses more RAM, but that should be not problem with a FiPy.

              S 1 Reply Last reply Reply Quote 1
              • S Offline
                sanjoy @robert-hh
                last edited by

                @robert-hh Thanks a lot for the suggestion. Threading worked quite well for 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