ElectronicCats / Beelan-LoRaWAN

A LoRaWAN library for compatible arduino board
https://www.beelan.mx
MIT License
190 stars 77 forks source link

Enabling ADR ( LoRaWAN Adaptive Data Rate) #36

Closed lambertoo closed 3 years ago

lambertoo commented 4 years ago

Hello all, i would like to thank the author of this library it’s supper easy to use without any complexity, so now i have two questions one is instead of setting a specific DataRate like lora.setDataRate(SF8BW125) is there a way we can let a node decided which DataRate is best for it according to the distance between node and Gateway.

My second question is i was checking in the library function but i haven’t seen any way we can put a node into sleep mode without putting the whole microcontroller into sleep mode. Thanks

novvere commented 4 years ago

Hi lambertoo, ADR is set by server and sent to the node using MAC commands I have plans to implement it in this library if the authors aren't already doing it but first need to add MAC commands functionality. I'm still checking differences in regional parameters implying changes in functionality from EU868 (my region) and US915 (original library region)

daeynasvistas commented 3 years ago

@mr3188 .. do you have some news on ADR enhancement? It's a very useful feature ;)

novvere commented 3 years ago

I'm sorry I have been busy looking at confirmed downlink/uplink issues but I will try to work on MAC commands common code to be able to have ADR on top.

With ADR the server ask the node to change DR but there are some SX12... registers that give us information of last messages signal strength. i haven't used it before but I suppose it can help the to the node decide which DR to use.

I will first try with LinkCheck MAC command that seems to be simpler and then go forward with ADR.

novvere commented 3 years ago

I have successfully sent LinkCheckReq command from the node to the ChirpStack server as a single uplink with port=0 and 0x02 in payload. ChirpStack recognises the command but I can't see any downlink with LinkReqAns from the server.

I don't know if the problems is the ChirpStack server or the gateway (RAK831), and I will not have another gateway to test until next week. With TTN v2 I don't see any information about the command, just an uplink without payload.

I will try sending the command together with a regular uplink using Frame options field. Does any body know how to trace communication between ChirpStack server and the gateway?

novvere commented 3 years ago

I have changed the gateway to a Dragino LPS8 and know I can see LickCheckAns dow links. I will confirm I'm handling LinkCheckAns correctly before pushing changes to repo.

novvere commented 3 years ago

I have created #75 as a base to implement ADR support. It has some MAC commands already working and tested and I will commit changes to be able to discuss if it meets al regional requirements we need to change frequencies, active channels and data rates now stored in static structures.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.