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

    Pygate custom firmware

    Scheduled Pinned Locked Moved WiPy 2&3
    12 Posts 3 Posters 76 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.
    • S Offline
      Stefano Floriani @Gijs
      last edited by Stefano Floriani

      @Gijs
      Hi,
      I don't want to use a remote gateway server but only a local one that sends data to my site via http post.
      Thanks a lot

      1 Reply Last reply Reply Quote 0
      • G Offline
        Gijs
        last edited by

        You can run a local version of the Chirpstack service, and from there you should be able to integrate with a webhook to generate the http post you mention. Have a look at their documentation

        It should also be possible to modify the firmware to generate a HTTP Post in the format you're looking for, but Im guessing you're not looking for that.

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          Stefano Floriani @Gijs
          last edited by

          @Gijs

          But I found out that the code pygate it's on firmware! I should send the packet lora from HTTP url on my web site. It's possible customized this code? This is my question!
          Thanks

          1 Reply Last reply Reply Quote 0
          • G Offline
            Gijs
            last edited by

            Sorry, Im not sure what you mean, could you perhaps clarify for me what it is you want to achieve? I might have misunderstood your question

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              Stefano Floriani @Gijs
              last edited by Stefano Floriani

              @Gijs

              machine.pygate_init(buf)
              Hi, this is the only code to manage the gateway, I would like to modify the firmware to be able to direct the data of my devices lora via http and not ttn server or other ..
              I write on json config my url http and send only via http.
              It's possible.
              Thanks a lot

              J 1 Reply Last reply Reply Quote 0
              • G Offline
                Gijs
                last edited by

                You'll indeed need to change the firmware to send a HTTP Post request instead. The change is minor I think, around this line: https://github.com/pycom/pycom-micropython-sigfox/blob/Dev/esp32/pygate/lora_pkt_fwd/lora_pkt_fwd.c#L1798, but you'll have to check that. I believe the JSON packet is already formatted, its probably just the protocol you need to change, if you set the server address to your own

                S 1 Reply Last reply Reply Quote 0
                • J Offline
                  jcaron @Stefano Floriani
                  last edited by

                  @Stefano-Floriani Note that the LNS (LoRaWAN Network Server) as implemented by TTN or others does quite a few things which aren't done by the gateway:

                  • It keeps a record of active devices, applications, keys, etc.
                  • It manages multiple gateaways
                  • It manages network configurations (channels, frequencies, data rates, downlink settings...)
                  • It deduplicates data when the same frame is received via multiple gateways
                  • It manages ACKs for confirmed frames
                  • It manages timing of downlinks and selection of which gateway to send them through
                  • It manages ADR if in use
                  • It handles encryption/decryption of frame contents.

                  A pure gateway in LoRaWAN mode does not see the contents of frames, that data is encrypted between the end-device and the LNS, so the gateway can't send any of that data to a URL directly.

                  So you have the following options:

                  • Run a (simplified, probably) LNS on the gateway. You'd probably have to ditch a few features. No idea if there are any LNS implementations in (micro)python or C/C++ that could be incorporated and if the LoPy has enough ressources for that. You'd probably have to change the way you configure and manage the whole thing.
                  • Do not use LoRaWAN but raw LoRa and do you own stuff. No idea if the Pygate can easily be modified to do this.

                  It's nearly certainly much easier and in the long run much more flexible to run an LNS (e.g. chirpstack) which will manage the gateway and forward received frames to the URL you want.

                  1 Reply Last reply Reply Quote 1
                  • S Offline
                    Stefano Floriani @Gijs
                    last edited by

                    @Gijs

                    I don't never compilated a firmware, Can kindly You help me with example code http post and procedure for compilated firmware? Thanks a lot

                    1 Reply Last reply Reply Quote 0
                    • G Offline
                      Gijs
                      last edited by

                      @Stefano-Floriani Please also have a look at the suggestions @jcaron made which I did not think about. Im not aware of any LNS implementations on Micropython, but the raw LoRa solution could be viable for your situation

                      If, after that, you're still looking to compile your own firmware, have a look at the readme page on the github repository: https://github.com/pycom/pycom-micropython-sigfox. If you have no experience writing C code its going to be a steep hill to climb and I would suggest to make use of a local Chirpstack server, or using LoRa raw instead, we have some examples there: https://docs.pycom.io/tutorials/networks/lora/lora-mac/, https://docs.pycom.io/tutorials/networks/lora/lora-mac-nano-gateway/

                      S 1 Reply Last reply Reply Quote 0
                      • S Offline
                        Stefano Floriani @Gijs
                        last edited by

                        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