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 LORAWAN/LORA standalone gateway

    Scheduled Pinned Locked Moved LoPy
    lopyloralorawangatewayraspberry pi
    12 Posts 4 Posters 4.0k 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.
    • T Offline
      thomand1000
      last edited by

      Hi! I'm trying to build a gateway consisting of a Lopy connected to a Raspberry Pi over Uart. The lopy handles everything Lora (send/receive to/from lopy nodes) and the raspberry is going to handle everything about sending to database etc.

      I more or less have a prototype of the system up and working. I can send data (with info about what nodes the data should go to) from the RPI over uart to the gateway which forwards data to the lopy nodes. Data back from the nodes are received from the lopy gateway and sent back over uart to the RPi. I think its kinda cool :)

      I don't want to use for instance TTN. The connection to the closest antenna is to far away and I want to have complete control.

      But the problem is that I currently have the system set up with raw lora (Lora.lora) so I suspect there is a lot of collisions. If I use only one node everything works fine. If I add another node and they send relatively frequent it's quite random what is received by the gateway. Is there an easy fix to this? Alternatively how hard would it be to set ut this setup with lorawan instead? Any suggestions would be highly appreciated!

      1 Reply Last reply Reply Quote 0
      • sebS Offline
        seb
        last edited by

        In regards to setting up your own LoRaWAN gateway, we have a tutorial on our documentation website that demonstrates how to use a LoPy as a standard LoRaWAN gateway (https://docs.pycom.io/chapter/tutorials/lopy/lorawan-nano-gateway.html). With this script running on your LoPy, it will run as a single channel gateway. You can then connect it to any LoRaWAN network such as TTN or if you want to run your own there is an open source project for that too: https://www.loraserver.io/

        T G 2 Replies Last reply Reply Quote 0
        • T Offline
          thomand1000 @seb
          last edited by

          @seb Yes, I was thinking about using the LoRaWAN gateway example code and possibly rewrite it so that everything done over UDP is changed to UART. Do you think that is a good approach?

          1 Reply Last reply Reply Quote 0
          • sebS Offline
            seb
            last edited by

            Is there a specific reason you need to send the data over UART to the raspberry pi? It might be easier to just run the Lopy stand alone as a gateway and have it talk to a lorawan server and then access the data via the lorawan server.

            T 1 Reply Last reply Reply Quote 0
            • T Offline
              thomand1000 @seb
              last edited by

              @seb I'm at a University in Norway where it's quite hard to get a connection to WIFI for these kinds of devices. It's a Eduroam network. I have followed a thread on the forums to set up a connection, but unsuccessfully. Another thing is that the raspberry would allow importing the threading library, which could give me a bit more control over the different threads. When I got the UART connection between the devices working I kinda stopped looking back. But, I'm not 100% sure that it is the best choice

              1 Reply Last reply Reply Quote 0
              • sebS Offline
                seb
                last edited by

                Ah I see, in which case my recommended setup would be as follows:

                • Setup loraserver.io to run on your raspberry pi
                • Setup a wifi access point on the raspberry pi
                • Connect the LoPy to the new WiFi network running the LoRaWAN nano gateway code.

                I am unsure of your universities rules so this way you do not require internet connections on any of the device and the UDP packets wont get filtered out by your universities network. If you need internet access on the raspberry pi you can always just plug in an ethernet cable.

                From there loraserver.io just gives you an mqtt server to access the LoRaWAN network you just created,

                T 1 Reply Last reply Reply Quote 1
                • T Offline
                  thomand1000 @seb
                  last edited by

                  @seb Brilliant. I'll try that. Thanks! :)

                  1 Reply Last reply Reply Quote 0
                  • G Offline
                    gnm @seb
                    last edited by

                    hi guys,

                    I find the project of connecting the nanoGateway to the LoRa server (open source) from www.loraserver.io very very interesting.
                    I do not know @thomand1000 if you have succeded or not with @seb suggestions (I suppose so, because the thread is inactive since a week ago), but I would really like to try it. However, I have many doubts about it, and maybe you could help me with, or maybe we can help each other in case you haven't got things working yet.
                    First, let me tell you my progress (not much, but it will help you to understand where I am stand): I have small LoRaWAN network running, with a nano-gateway taken from https://docs.pycom.io/chapter/tutorials/lopy/lorawan-nano-gateway.html
                    and connected to TTN directly from my Lopy, but honestly I don't understand the details of the nanogateway.py. However, beyond my lack of understanding of the nanogateway (and of loraserver, I am just about to investigate about it), it seems that the packet-forwarder used in www.loraserver.io is the semtech packet-forwarder (https://github.com/Lora-net/packet_forwarder/tree/master/lora_pkt_fwd), the same packet-forwarder the nanogateway is using to connect to TTN (https://docs.pycom.io/chapter/tutorials/lopy/lorawan-nano-gateway.html)...so it should work, I think.
                    Anyway, could anyone help me to understand how to install, configure and run the required services in the raspberry, and also how to modify the nanogateway? I would really appreciate it. I really want to try the loraserver (running locally in the raspberry) with the nanogateway.

                    T 1 Reply Last reply Reply Quote 0
                    • T Offline
                      thomand1000 @gnm
                      last edited by

                      @gnm I ended ut using the lorawan-nano-gateway code and set up a Raspberry pi as a wifi-hotspot forwarding wifi packets to and from lopy to TTN. I might try to set up the loraserver.io on the Rpi, but I haven't tried it yet.

                      G 1 Reply Last reply Reply Quote 0
                      • G Offline
                        gnm @thomand1000
                        last edited by

                        Hi @thomand1000,

                        I have tested the nanogateway without the raspberry and it worked fine. I don't know why did you need the raspberry when connecting to TTN.

                        Now I am trying to use the raspberry to host the loraserver.io...but I am failling. Why did you decide not to go ahead with loraserver.io? Let me know if you try again ;)

                        T 1 Reply Last reply Reply Quote 0
                        • T Offline
                          thomand1000 @gnm
                          last edited by

                          @gnm I set up the Raspberry because I found it hard to connect to Eduroam wifi at my university. Setting up my own Wifi hotspot was therefore much easier (ethernet from raspberry pi). I ended up using TTN because it was easy and next to no modification of the example code from pycom was needed. I will let you know if I continue working on this

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

                            I'm trying to use nano-gateway with loraserver.io but I can not downstream messages just upstream.

                            Can you share if you had the same problem?

                            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