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

    Long time before transmitting a packet.

    Scheduled Pinned Locked Moved Discussion
    lopyloratime
    13 Posts 5 Posters 906 Views 5 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
      snehasg96
      last edited by

      For some reason, some times lopy boards (Tx and Rx) takes almost up to 5 minutes before one packet gets sent to the receiver. Other times, it immediately starts sending when powered up.

      What could be the reason?

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

        @snehasg96 Which mode, protocol?

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          snehasg96 @bmarkus
          last edited by

          @bmarkus LoRA RAW socket

          lora = LoRa(mode=LoRa.LORA, region=LoRa.US915)
          s = socket.socket(socket.AF_LORA, socket.SOCK_RAW)

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

            @snehasg96 Could you post your code.

            Is it actually 5 minuites before any attempts to send are made. or is it actually 5 minuites before the receiving node gets the data but its been trying to send all along?

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              snehasg96 @Paul Thornton
              last edited by

              This post is deleted!
              J robert-hhR 2 Replies Last reply Reply Quote 0
              • J Offline
                jcaron @snehasg96
                last edited by

                @snehasg96 Can you add time information in your logs, and provide the source code for the sending side?

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

                  @snehasg96 I do not understand your finding. Since the socket you use at the receiver side is blocking, it means that anytime your script prints "received" then you received something.
                  Do these "Received" message start immediately of after 5 minutes?

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

                    This post is deleted!
                    robert-hhR 1 Reply Last reply Reply Quote 0
                    • robert-hhR Offline
                      robert-hh @snehasg96
                      last edited by

                      @snehasg96 said in Long time before transmitting a packet.:

                      Connecting on the port(COM 5) forever

                      So this message comes from Pymakr with Atom or VSC? What happens if you connect to the board with more simple tools like Putty, which, when connected stay that way?
                      What kind of interface board are you using? Expansion Board or another one? I'm trying to sort out other problems, because your scripts look fine.

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

                        @robert-hh Thanks for your prompt message.

                        I am using the PyMAKR pluggin for VSC. Also I am using an expansion board. I am quite not sure how to execute this script in Putty.

                        But please do let me know if its okay to position my boards at some distance and then go and manually press the reset button and record the loss rates?

                        Also I have tested it up to 65 meters. Any idea up till what distance I should be testing this to see some packet loss?

                        And, with regards to the initialization does it seem right to you?

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

                          @snehasg96 you have to permantly upload the files. If for instance you call them send.py and recv.py, you can start them from main.py yb including the statement:
                          import send
                          or
                          import recv
                          So do not use Run by pymaker but upload. Personally i do not use pymakr. It hides to much what it doing. I use something like Putty (Windows) or screen (OS X) or picocom (Linux) for the REPL prompt and Filezilla for file transfer. That is less comfortable but it is always obvious in which state the board is.
                          Lora is pretty sensitive and designed for longer distances. Depending on the set-up, you should see some packet loss at a distance of 500m and more. In my tests in a normal living area reception was OK up to 3km distance, and some packets were picked up by gateways 7 km away.
                          You could force worse reception, e.g. by not aligning the antennas (one upright, one horizontal) or use lower SF values. But still you need some distance between the units to get receive error.

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

                            @robert-hh Thanks alot for your insight. That was so helpful. I had forgot to mention that I had uploaded both these codes permanently using Filezilla and use the VSC to just connect and it automatically starts to send packets.

                            May I ask what command u use in putty to run these scripts? I would login using the address : 192.168.4.1. and how do i go about running the main.py code in the receiver?

                            Regarding the SF, I have not used any of that now which I assume will take the default value 6 in the initialization : lora = LoRa(mode=LoRa.LORA, region=LoRa.US915) ? Correct me if I am wrong.

                            Also Thanks for your comments. I will be certain of what I am doing right now.

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

                              @snehasg96 main.py is executed automatically when the device boots. If ouy wnat to run a script, like recv.py, manually, just enter at the REPL prompt (the one with >>>):
                              import recv

                              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