Change coding rate (LoPy 4)



  • 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.



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



  • @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.





  • @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?



  • @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?



  • @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.


Log in to reply
 

Pycom on Twitter