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

    socket.send(msg) timeout

    Scheduled Pinned Locked Moved LoPy
    7 Posts 3 Posters 2.3k 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.
    • C Offline
      chris
      last edited by

      Hi, does anyone know a reason why the send would give a:
      OSError: [Errno 11] EAGAIN
      for a LoRa socket? I don't believe its doing anything like waiting on a ack confirmation is it? I'm running with socket.setblocking(False) and a raw LoRa socket. I'm trying to send at 100msec intervals.

      I've also seen where the a recv function will timeout when I know its missed several sends and only a moment before it was working.

      I'm trying to send a a higher rate until the other device sends a response. Sort of a re-transmit until acknowledged scheme. My intent is to allow intermittent signal strength to be more responsive and usable.

      Thanks,

      Chris

      1 Reply Last reply Reply Quote 0
      • C Offline
        chris
        last edited by

        I did just upgrade to the latest firmware (1.3) and the problem is still there.

        D 1 Reply Last reply Reply Quote 0
        • D Offline
          daniel @chris
          last edited by

          @chris if this is with the 868MHz version of the LoPy then you are experiencing the effect of duty cycle control. Transmitting every 100ms is just not possible in Europe. Besides that, sending a LoRaWAN packet (per protocol specs) takes more than 1 second because the device needs to wait for the first receive window (which occurs 1 second after the packet is sent).

          Just to be clear, is this happening with LoRaWAN or raw LoRa. Which data rate are you using?

          Cheers,
          Daniel

          1 Reply Last reply Reply Quote 0
          • C Offline
            chris
            last edited by

            This is on the 915MHz version and with LoRa RAW. I did slow things down and it technically worked but it's not too usable at those speeds. When I look at how long it takes to send a packet using time stamps around the socket send it's fast. Is there any way to really see how long the radio is taking? Also how come the send buffer can't take the new data and send it over to the radio when ready?

            bmarkusB 1 Reply Last reply Reply Quote 0
            • D Offline
              daniel
              last edited by

              @chris ok, then it's definitely not because of the duty cycle limitations. I'll investigate. What's the size of the packets that you are trying to send?

              1 Reply Last reply Reply Quote 0
              • bmarkusB Offline
                bmarkus @chris
                last edited by

                @chris said in socket.send(msg) timeout:

                Is there any way to really see how long the radio is taking?

                You can measure the power consumption of the board, best with an oscilloscope. You will see the increased consumption when transmitter is on.

                1 Reply Last reply Reply Quote 0
                • C Offline
                  chris
                  last edited by

                  The send packet is 7 bytes long and the ack is 2 bytes. On the data rate I didn't set so whatever the default is.

                  Power consumption is a good point on how to tell if it's busy but I want a software method. If we could tie a specific exception type to this cause then I could do something special in the exception handler.

                  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