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

    Scheduled Pinned Locked Moved Firmware
    lopyloraother
    4 Posts 3 Posters 1.2k 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.
    • S Offline
      SameerChouksey
      last edited by

      Hello,

      l am using below code to wait for the UART data and take action accordingly. It works for the first time but once I receive some data uart.any() is always true after that. The uart buffer doesn't get clear it seems. Please check.

      while(1):
      if uart.any():
      data = uart.readall()
      print("data received over UART:"+str(data))
      s.setblocking(True)
      print(s.send(data))
      time.sleep(0.5)
      del data

      Objective is to send data only when there is a new data available over uart.

      Regards,
      Sameer

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

        @sameerchouksey It could be related to this issue:
        https://forum.pycom.io/topic/2595/uart-rx-buffer-issue-after-buffer-overflow
        That is about to be fixed soon.

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

          Hi,

          Yes, it seems to be the same issue. When can I expect a fix for this?

          Any work around? any other api to check new data arrival at UART?

          Regards
          Sameer

          1 Reply Last reply Reply Quote 0
          • R Offline
            rootmi
            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