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

    Change coding rate (LoPy 4)

    Scheduled Pinned Locked Moved LoPy
    lopy
    7 Posts 4 Posters 974 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.
    • A Offline
      Asb
      last edited by

      Hi

      I define my class Otaa, for over the air activation the following way:
      Code snip 1:

      class Otaa:
          def __init__(self,dr, APP_EUI, APP_KEY):
              self.lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.EU868, coding_rate=LoRa.CODING_4_5)
      

      The coding rate can have the following values according to lopy4 doc: 4_5, 4_6, 4_7 or 4_8.

      In my example above I have set the coding rate to 4_5, to verify this I print the coding rate in my "forever" while loop in main program, like this:
      Code snip 2:

      print('Coding rate: ' +str(lora.lora.coding_rate())
      

      which gives the following results: Coding rate: 1
      Which is equivalent to a coding rate of 4_5 according to:
      0_1539611123638_coding_rate.PNG

      So far so good, when I try to change the coding rate to 4_8 the coding rate shows Coding rate: 4 when I run my code.
      This is as expected, however when I'm looking at my device at the things network the coding rate always shows 4_5, both when I have programmed my Lopy to have a coding rate of 4_5 and 4_8!

      Image from the things network, when I have set my coding rate to 4_8 as shown in Code snip 1, but ttn shows 4_5:
      0_1539611105247_ttn_cr.PNG

      So my question is: Is the coding rate really set to 4_8, when I set it to be 4_8 like this:

      class Otaa:
          def __init__(self,dr, APP_EUI, APP_KEY):
              self.lora = LoRa(mode=LoRa.LORAWAN, region=LoRa.EU868, coding_rate=LoRa.CODING_4_8)
      

      Please let me know if you need more information, thanks.

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @Asb
        last edited by

        @asb Scroll down a bit in the documentation page you linked to:

        In LoRa.LORAWAN mode, only adr, public, tx_retries and device_class are used. All the other params will be ignored as they are handled by the LoRaWAN stack directly.

        1 Reply Last reply Reply Quote 1
        • A Offline
          Asb
          last edited by Asb

          @jcaron Thanks, should have read the documentation more carefully.

          Are there any specific reasons why you're not able to change the coding rate in LoRa.LORAWAN mode?

          bmarkusB robert-hhR 2 Replies Last reply Reply Quote 0
          • bmarkusB Offline
            bmarkus @Asb
            last edited by

            @asb said in Change coding rate (LoPy 4):

            @jcaron Thanks, should have read the documentation more carefully.

            Are there any specific reasons why you're not able to change the coding rate in LoRa.LORAWAN mode?

            Just curious, why do you want to change CR?

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

              @asb See also the discussion here: https://www.thethingsnetwork.org/forum/t/dirty-trick-to-improve-node-performance/3460/2

              1 Reply Last reply Reply Quote 1
              • A Offline
                Asb @bmarkus
                last edited by Asb

                @bmarkus the LoPy4 node is working under not so good signal to noise ratios, and as a result sometimes packet loss. Therefore I'd like to try to change the coding rate to see if that might solve any problems, this combined with changing the spread factor.

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

                  @asb During my testing, changing the spread factor has a huge impact on reliability and receiption distance.

                  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