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

    LoPy Nano-Gateway

    Scheduled Pinned Locked Moved Guides
    62 Posts 27 Posters 50.6k Views 31 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.
    • R Offline
      Roberto @Colateral
      last edited by

      Hi @Colateral
      As i wrote in my last message, there is a new example of the nano-gateway with a non-blocking loop approach.
      Regarding the memory issues we will look into this. I left the code on the other post running for 3 hours without any problems. I will leave it running today on a test bench for 24+ h to see if there are any problems and monitor the memory while it transmits. Will let you know the results.

      The link to the new code is
      https://forum.pycom.io/post/3242

      C 1 Reply Last reply Reply Quote 0
      • C Offline
        Colateral @Roberto
        last edited by

        @Roberto HI Roberto. Thanks. I ran the last script and is running fine. Regarding the memory leak, I believe is related with socket blocking approach. If we change the script and move to non blocking (as your script does) everything works fine.

        R 1 Reply Last reply Reply Quote 0
        • R Offline
          Roberto @Colateral
          last edited by

          @Colateral
          Thanks for the quick response, i'll try a blocking approach to see if i can reproduce the error and check whats the root of it.

          1 Reply Last reply Reply Quote 0
          • A Offline
            assia
            last edited by

            @Colateral said in LoPy Nano-Gateway:
            Hi @Roberto i am bbegginer in LoRa and i don't understand the use of rx_iq and tx_iq.!
            thanks

            B 1 Reply Last reply Reply Quote 0
            • B Offline
              borjam @assia
              last edited by

              @assia said in LoPy Nano-Gateway:

              @Colateral said in LoPy Nano-Gateway:
              Hi @Roberto i am bbegginer in LoRa and i don't understand the use of rx_iq and tx_iq.!

              It's easy. A LoRaWAN network is not a peer to peer network. There is a master (the gateway) that communicates with the nodes, but there is no node to node communication.

              Imagine that one of your nodes has the receiver active and another one transmits. The transmission is intended to be received by the gateway, of course (we said that there is no node-to-node communication) but the receiving node will get the packet anyway, if only to discard it.

              That reception and discarding has an energy cost. How do you avoid it? By having the nodes transmit in a mode that a node can't understand, only the gateway.

              Now, imagine this scenario: you make the nodes use tx_iq inversion (which is a sort of signal inversion) and the gateway use rx_iq inversion.

              In this case, a signal transmitted by a node will be inverted, and the gateway will successfully decode it. But other nodes, expecting a non inverted signal, won't detect the inverted signal. So you have just avoided the unintended packet reception problem.

              A C 2 Replies Last reply Reply Quote 1
              • A Offline
                assia @borjam
                last edited by

                @borjam
                Thanks for the quick response, It's much clearer now.

                1 Reply Last reply Reply Quote 0
                • C Offline
                  Colateral @borjam
                  last edited by

                  @borjam So how you can implement a mesh network using Lora? You put the GW in both tx and rx ?

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    assia
                    last edited by

                    Hi @Roberto I tried to modify your code because I need to send a payload that contains the current time with a header containing mac address of the node and the length of the payload. Everything went well on the node side but rated nano gateway I have an Index Error: bytes index out of rang. it is because the adresse mac ? knowing that lora.mac() give : b'p\xb3\xd5I\x95kA\xf3' with length=8 but i don't understand what does mean the : b'p......' and how the length is 8 !!

                    thanks

                    node

                    # LoRa node
                    
                    SRC_ADR_MAC=lora.mac()
                    #compteur packets 
                    PACKETs_Cnt=5
                    while(PACKETs_Cnt>0):
                       
                        # Package send containing a simple string
                        msg=time.time()
                        msg_len=len(str(msg))
                        
                        pkg = struct.pack('!%dsBi' % len(SRC_ADR_MAC), SRC_ADR_MAC, msg_len, msg)
                        
                        lora_sock.send(pkg)
                        
                        PACKETs_Cnt=PACKETs_Cnt-1
                        time.sleep(5)
                    

                    nano GW

                    # LoRa GW
                    
                    while (True):
                       
                        recv_pkg = lora_sock.recv(255)
                        if (len(recv_pkg) > 2):
                    
                            device_adr_mac, msg_len, msg = struct.unpack('!%dsBi' %8 ,   recv_pkg) 
                    # %8 because len(lora.mac())=8
                    
                            print('Device: %s - Pkg:  %s' % (device_adr_mac, msg))
                    
                        time.sleep(5)
                    
                    
                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      MJ
                      last edited by

                      Hi there, i am still new to lopy. I have try the example of the Lora.nanogateway code (https://docs.pycom.io/chapter/tutorials/lopy/lora-mac-nano-gateway.html) with only 1 lopy as gateway and 1 lopy as node. There is no response between both of them after i have coded it. What happen to this? Thank you.

                      C 1 Reply Last reply Reply Quote 0
                      • C Offline
                        Colateral @MJ
                        last edited by

                        @mj Are you using 2 instances of pymaker ? If not, describe what you did.

                        M 1 Reply Last reply Reply Quote 0
                        • M Offline
                          MJ @Colateral
                          last edited by

                          @colateral Hi, i am using 1 gateway that only with pymaker opened while the node i using the power bank to power up. I have try both in vice versa yet no result showing out.

                          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
                          • 2
                          • 3
                          • 4
                          • 4 / 4
                          • First post
                            Last post

                          Pycom on Twitter

                          Pycom