ESP32-LoRaWAN Library - Questions

Hello,

I have some questions about this library. I’m in Brazil, so I’m using the RegionUS915.h config as the frequency is the same as the permitted in here.

1- Is the maximum spreding factor 10? Why? I would like to use 11, or even 12 in some applications. Is a bit confuse the RegionUS915.h file.

Here I have some DR informations, but I dont know which SF and band correspond to each DR.

/*!

  • Minimal datarate that can be used by the node
    */
    #define US915_TX_MIN_DATARATE DR_0

/*!

  • Maximal datarate that can be used by the node
    */
    #define US915_TX_MAX_DATARATE DR_4

/*!

  • Minimal datarate that can be used by the node
    */
    #define US915_RX_MIN_DATARATE DR_8

/*!

  • Maximal datarate that can be used by the node
    */
    #define US915_RX_MAX_DATARATE DR_13

Looking the line bellow I thin the DR_0 correspond to SF 10, DR_1 to SF 9, DR_2 to SF8 and so on…

static const uint8_t DataratesUS915[] = { 10, 9, 8, 7, 8, 0, 0, 0, 12, 11, 10, 9, 8, 7, 0, 0 };

Am I right?

2 - How the library deal with the DR in order to adjust according appdatasize?

Looking this line below, I guess the max appdatasize I can understand that DR_0 - max data is 28 bytes, DR_1 max data is 53 and so on…

static const uint8_t MaxPayloadOfDatarateUS915[] = { 28, 53, 125, 242, 242, 0, 0, 0, 53, 129, 242, 242, 242, 242, 0, 0 };

However if the ADR is true, and my packet is bigger than 28 bytes, the library can know that the DR canoot be decreased to DR_0?

3 - I think is a stupid question, but I ll do anyway hahah, ADR just work with confirmed messages? I mean if bool loraWanAdr = true; thebool isTxConfirmed = true; must be true?

Thanks!!

Hi
As the spreding factor increase , it takes more time while sending a packet. Send a long packet with high spread factory probability will increase spectrum interference. The max spread factory is determinated by Lora Application Alliance.
You can modify “US915_TX_MIN_DATARATE” to DR_1, the min payloads becomes 53 bytes. other if you modify “US915_TX_MIN_DATARATE” to DR_2,the min payloads becomes 125 bytes.
ADR works both for confirm and unconfirm up link.

Hello,

I’m not sure if you are right.

Look this comment from [brocaar] (https://forum.chirpstack.io/u/brocaar):

I think the confirmed uplink is the one that set the ADRACKReq otherwise there is no way that the node knows if it need to deacrease the DR, another important point is, with your library I could see the DR deacrease using confirmed uplink, but I could see it increase after a while. The literature about it says that it should be in the firmware part. Can you help with this ?