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

    New firmware release 1.6.7.b1 (LoRaWAN Nano Gateway with TTN example!!)

    Scheduled Pinned Locked Moved Announcements & News
    firmware
    113 Posts 34 Posters 88.4k Views 32 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
      rikkertmark
      last edited by

      Hello,

      first of all, the LoraWAN Nano Gateway works great!!

      I used the HTTP Intergration of the TTN it post the received data to my PHP script and the PHP script placed the data in my own database.

      I have used the HTTP intergration below.

      https://www.thethingsnetwork.org/docs/applications/http/

      I see that is possible that I can receive also the Latitude, longitude and altitude of the device. without place this in the payload, but this is not implement in python script.
      Is it possible to implement this in python without put this values in the raw payload?

      "latitude": 52.2345,               // Latitude of the device
      "longitude": 6.2345,              // Longitude of the device
      "altitude": 2                            // Altitude of the device
      

      Best Regards,
      Mark

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

        Hi,

        Will the nano gateway work with any node or just Lopys? For example, will Multitech's mDot work?

        Regards,
        Javier

        1 Reply Last reply Reply Quote 0
        • L Offline
          livius @daniel
          last edited by

          @daniel
          I just upgraded my board and see - but no info about this version

          (sysname='WiPy', nodename='WiPy', release='1.6.8.b1', version='v1.8.6-504-gff1098f6 on 2017-03-13', machine='WiPy with ESP32')
          

          also after upgrade i now have:

          OSError: I2C bus error
          

          think about people first, then computers

          1 Reply Last reply Reply Quote 0
          • M Offline
            MainSheet @daniel
            last edited by MainSheet

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • B Offline
              bihut
              last edited by

              In the nanogateway.py file, where is the function const()?. Because const(2), const(1), etc. is not recognized.

              Thanks in advance.

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

                @bihut const() is a kind of Micropython directive, not a function. It's kind of similar to #define in C.

                1 Reply Last reply Reply Quote 0
                • RobTuDelftR Offline
                  RobTuDelft
                  last edited by

                   File "main.py", line 12, in <module>                                                                                  
                    File "nanogateway.py", line 94, in start                                                                              
                    File "nanogateway.py", line 161, in _push_data                                                                        
                  ValueError: odd-length string
                  

                  My gateway id is 'gateway-rob', should I change that?

                  Without data you're just another person with an opinion.
                  Hackster | About me

                  J 1 Reply Last reply Reply Quote 0
                  • J Offline
                    jmarcelino @RobTuDelft
                    last edited by jmarcelino

                    @RobTuDelft
                    Your gateway ID has to be a EUI64 (hexadecimal) e.g. 240ac4fffe008d44 which for now you can base on your WiFi hardware address.

                    That's what TTN accepts too. Have you registered your gateway there as the packet forwarder type? They've changed this now to "I'm using the legacy packet forwarder" checkbox, make sure it's ticked.

                    RobTuDelftR 1 Reply Last reply Reply Quote 1
                    • RobTuDelftR Offline
                      RobTuDelft @jmarcelino
                      last edited by

                      @jmarcelino Great, thanks. Machine unique ID/MAC (machine.unique_id()) can be used directly, without any changes or what is the convention here? Noticed the checkbox indeed.

                      Now I have another quesiton pertaining LoRa transmission. When I send the payload ("hi") as lora_sock.send(bytes([0x68, 0x69])) or as lora_sock.send('hi') the payload ends up as cc26 for example on the other end; which if I translate to ascii again is not "hi". Any clue what is happening here?

                      Without data you're just another person with an opinion.
                      Hackster | About me

                      J 1 Reply Last reply Reply Quote 0
                      • J Offline
                        jmarcelino @RobTuDelft
                        last edited by

                        @RobTuDelft
                        Though the process doesn't actually guarantee unique numbers there is a convention to add FFFE in the middle to expand the 48-bit MAC to the EUI64 expected by the Things Network.
                        0_1494697690137_89649-pic1.png

                        I'm not sure what you mean in the LoRa problem. Is this with mode=LoRa.LORA or mode=LoRa.LORAWAN? And what is the "the other end": another LoPy, a LoRaWAN network server or something else?

                        RobTuDelftR 1 Reply Last reply Reply Quote 2
                        • RobTuDelftR Offline
                          RobTuDelft @jmarcelino
                          last edited by

                          @jmarcelino Thanks for clarifying.
                          As for the second issue, this is now resolved (had to do with encryption on the LoRaWAN).

                          Without data you're just another person with an opinion.
                          Hackster | About me

                          1 Reply Last reply Reply Quote 0
                          • J Offline
                            jomifo Pybytes Beta
                            last edited by

                            I have successfully used the nanogateway example code to push some temperature sensor data (MCP9808) to TTN and am happy about that. Now I'm wondering are there ways using this example to configure LoRa to increase the range? I see the LORA_GW_DR = "SF7BW125" property in the config, but am unsure how or if this can be used to tweak Lora.
                            Thanks.

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

                              @jomifo yes, if you change the spreading factor to 12 ("SF12BW125") the range will be much better. Do this both on the nano-gateway and in the node. You also need to tweak the Join command like this:

                              lora.join(activation, auth, * ,timeout=None, dr=None)

                              Specify the dr and make it 0 (which is the same as SF12BW125).

                              Cheers,
                              Daniel

                              J 1 Reply Last reply Reply Quote 0
                              • J Offline
                                jomifo Pybytes Beta @daniel
                                last edited by

                                @daniel Excellent! Seems no need to directly alter the join command since the 'dr' parameter also uses a config parameter, 'LORA_NODE_DR'. I'm looking at the latest example on Github.

                                1 Reply Last reply Reply Quote 0
                                • F Offline
                                  fredg
                                  last edited by

                                  I'm coming from this tutorial: https://docs.pycom.io/chapter/tutorials/lopy/lorawan-nano-gateway.html

                                  You should update it probably to mention the "I'm using the legacy packet forwarder" for TTN network, and update the code to make it easy to extract the GATEWAY_ID.
                                  Or maybe update the code to allow any GATEWAY_ID for TTN? I'm not sure how it really works...

                                  J 2 Replies Last reply Reply Quote 1
                                  • J Offline
                                    jmarcelino @fredg
                                    last edited by

                                    @fredg
                                    Thank you very much for your suggestion, TTN changed their language and gateway registration process recently - we'll update our documentation to reflect this.

                                    1 Reply Last reply Reply Quote 0
                                    • J Offline
                                      jmarcelino @fredg
                                      last edited by

                                      @fredg
                                      I've updated the Nano-gateway documentation to show how to generate a Gateway ID and also to reflect the changes in the TTN interface: https://docs.pycom.io/chapter/tutorials/lopy/lorawan-nano-gateway.html

                                      Thanks again for your suggestion!

                                      1 Reply Last reply Reply Quote 2
                                      • D Offline
                                        Devang Sharma
                                        last edited by

                                        @daniel, I live in India. While registering the gateway, which frequency plan I should choose? Can I choose Europe or do I have to choose Asia?

                                        Thanks.

                                        J 1 Reply Last reply Reply Quote 0
                                        • J Offline
                                          jmarcelino @Devang Sharma
                                          last edited by jmarcelino

                                          @devang-sharma
                                          India has a unique Frequency plan:

                                          https://kotahi.net/network/frequencies/

                                          I recommend setting your config.py for the nano gateway and nodes to

                                          LORA_FREQUENCY = 865062500

                                          and make sure your nodes use this 865062500 frequency as well:

                                          # set the 3 default channels to the same frequency
                                          lora.add_channel(0, frequency=config.LORA_FREQUENCY, dr_min=0, dr_max=5)
                                          lora.add_channel(1, frequency=config.LORA_FREQUENCY, dr_min=0, dr_max=5)
                                          lora.add_channel(2, frequency=config.LORA_FREQUENCY, dr_min=0, dr_max=5)
                                          
                                          D 1 Reply Last reply Reply Quote 1
                                          • D Offline
                                            Devang Sharma @jmarcelino
                                            last edited by

                                            @jmarcelino, thanks. I've sent them an e-mail in order to get a free network connection. I hope they'll reply soon.

                                            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
                                            • 5
                                            • 6
                                            • 5 / 6
                                            • First post
                                              Last post

                                            Pycom on Twitter

                                            Pycom