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

    How to check if there are any packets in the transmission queue

    Scheduled Pinned Locked Moved Discussion
    4 Posts 3 Posters 37 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.
    • K Offline
      keik
      last edited by

      Hi! I am currently writing a program to measure the maximum data transfer rate between two LoRa nodes using LoRa RAW. One of the problems I've encountered is an error message: "OSError: [Errno 11] EAGAIN", when trying to send several packages in short amount of time.

      I know this is related to duty cycle limiting, which means that I need to implement a functionality where the program checks if there are any packets in the transmission queue before it starts transmitting. I do not want to use a hardcoded timer between each transmission, as this would impact the results.

      My question is if anybody out there has any idea on how to solve this problem, so the program itself can determine when to send the next package?

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @keik
        last edited by

        @keik Haven't looked into that for ages, but IIRC the behaviour changes depending on some settings of the socket, like blocking or something similar.

        Also you can use callbacks to be notified when TX is done (or has failed).

        1 Reply Last reply Reply Quote 0
        • K Offline
          keik
          last edited by

          Thanks for the answer. I already tried using callbacks, but couldn't quite figure it out. Luckily, i managed to find some piece of code on the web which seems to check if there are any data in the socket.

          # Check if the socket is busy
          r, w, x = select.select([tx], [tx], [], 0)
          if r or w:
              tx.send(package)
          

          Where tx is the name of the socket.

          P 1 Reply Last reply Reply Quote 0
          • P Offline
            pickles parade @keik
            last edited by pickles parade

            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