Open kadirozdinc opened 1 year ago
I can confirm the same issue. The code bellow will not put a node into a fixed data rate.
` LMIC_setAdrMode(0); LMIC_setDrTxpow(DR_SF10,14);
`
Hi, I am also using this library, and i can report the same issue, but i can go further. To me, it happens that the device does de join and the first message with SF7, but the next message are sent with the SF that you order. I don't know why it happens like that, but it really bother us, bucause usually the first join is the most difficult message, then the next messages do not have problems. If i power down the device, next join and first message again uses SF7, and after that it returns the specified SF. Kind regards
While digging around the library, I realized that this issue is related to Payload Size. If you look over "LoraWAN Regional Parameters" document, you will see Maximum payload size differs per DataRate. For example for SF12 and SF11 MaxPayloadSize is 51byte (FRMpayload). If in your example, you set DR0(SF12) and try to send payload that exceed this limitation, library decrease SF by itself. Please lower your payload below that limit and try again. For more info refer to Regional parameters documantation
I can also confirm, that setting the DR rate just before sending packet out works, should be written in the README.
If you set up SF before join that parameter will be deleted during join.
In EU868 region (and AS923 I think also) device will try to join on SF7 and if that fails it will increase SF and repeat. Than it will try to join on SF8, and if it fails it will increase SF on SF9. It will repeat this until SF12 and than it will try only on SF12. In US and AU region device is always trying to join on SF10.
If you want to set fixed SF, you need to do that in EV_JOINED part, next to "LMIC_setLinkCheckMode(0);". So after join is successful, than set up SF you want and disable ADR. Note that if device joined on e.g. SF11 it means that it couldn't reach gateway with lower SFs. So if you after join put e.g. SF8 or SF9, it is possible that you device will not be able to transfer messages to gateway.
@slavendam Can you provide full example please?
Can you provide full example please?
LMIC_setAdrMode(false);
LMIC_setDrTxpow(DR_SF12, 14); // or other SF you want
I am using this example with ABP method, but I am facing same problem. https://github.com/martinius96/hladinomer-studna-scripty/blob/master/examples/Hladinomer/LoRaWAN/LoRaWAN.ino
I tried your suggestion, I added to EV_JOINED case:
LMIC_setLinkCheckMode(0);
LMIC_setAdrMode(false);
LMIC_setDrTxpow(DR_SF12, 14); // or other SF you want
but no success. Still it is sending with SF9 as before.
I am using this example with ABP method, but I am facing same problem.
ABP doesn't go through process of joining so EV_JOINED is never called. For ABP you need to set this at the end of void setup() function. On line 266 in your example you already have function that setup SF. Just change value. https://github.com/martinius96/hladinomer-studna-scripty/blob/0a5983aaaee78427656a8620987ae33e96245f02/examples/Hladinomer/LoRaWAN/LoRaWAN.ino#L266
I tried but it does not work.
It's simply not using parameter I provided to that function on row 266.
Still SF9 is set, it does not react on provided value
still not solved by me
Hello, I implement ttn_otaa example successfully and I need to make DR fixed at SF12. I add these but doesn't work :
Codes are below :
How can i implement it correctly ?