Closed Kongduino closed 3 months ago
I believe LoRaWAN still needs to use some basic function of LoRa for sending, receiving packets and setting SF, BW, DR... So "Support LoRaWAN" may include "Support LoRa".
When in LoRaWAN mode there is no possibility to set SF/BW/DR, it is all handled by the LoRaWAN protocol and the regional LoRaWAN settings.
The API has been split into two parts, RAKLorawan / RAKLoraP2P, which is great. However, a large chunk of RAKLoraP2P functions is still inside RAKLorawan files. Why?!?
As a consequence of this, compiling with "Support LoRa P2P" does not work, as some of the required functions are in RAKLorawan. Oops.
Also, there were many changes in the API, which is also kind of great, as they made the API more readable. However, it seems like the devs never bothered to recompile the examples published with the BSP: if they did they would have realized that the examples, especially the example for P2P (which is originally by me), would not compile, since they use the old API. Oops...
In boards.txt we have these definitions, for what to do when the user wants support for LoRaWAN and/or LoRa P2P:
There are 2 issues here.
SUPPORT_LORA
should really beSUPPORT_LORAWAN
. LoRa != LoRaWAN. AndSUPPORT_LORA_P2P
should beSUPPORT_LORA
, really. This has an unfortunate consequence:In sleep.cpp / sleep.h,
sleep.lora()
is restricted toSUPPORT_LORA
(meaning LoRaWAN). Which doesn't make sense, since this is for LoRa P2P.So either the
SUPPORT_LORA
is to be replaced withSUPPORT_LORA_P2P
, or, as I suggest above, makeSUPPORT_LORA
for P2P, and useSUPPORT_LORAWAN
for LoRaWAN...All these points are valid for all platforms, but I happen to be using RAK3172 right now. I have made all these changes myself (except SUPPORT_LORAWAN, as it's quite more extensive), and it is working well. It makes code smaller too, since if you are using only P2P or LoRaWAN, the other API doesn't get included. I'd be happy to contribute – or put up an alternate version on my GitHub.