Skip to main content
MMath.10
Associate III
February 18, 2019
Question

Lora ADR in en.i-cube_lrwan v1.2.1

  • February 18, 2019
  • 0 replies
  • 638 views

My project is based on the END_NODE project provided by ST.

In a first time I fixed the Data rate to DR_4 for my payload need.

Now i want to try to use the ADR protocol.

So i change from

* LoRaWAN Adaptive Data Rate
 * @note Please note that when ADR is enabled the end-device should be static
 */
#define LORAWAN_ADR_STATE LORAWAN_ADR_OFF
/*!
 * LoRaWAN Default data Rate Data Rate
 * @note Please note that LORAWAN_DEFAULT_DATA_RATE is used only when ADR is disabled 
 */
#define LORAWAN_DEFAULT_DATA_RATE DR_4

to

* LoRaWAN Adaptive Data Rate
 * @note Please note that when ADR is enabled the end-device should be static
 */
#define LORAWAN_ADR_STATE LORAWAN_ADR_ON
/*!
 * LoRaWAN Default data Rate Data Rate
 * @note Please note that LORAWAN_DEFAULT_DATA_RATE is used only when ADR is disabled 
 */
#define LORAWAN_DEFAULT_DATA_RATE DR_0

But I see nothing activated by the ADR...

I'm on the thing network server.

The only change is in the lora.c files here

mibReq.Type = MIB_ADR;
 mibReq.Param.AdrEnable = LoRaParamInit->AdrEnable;
 LoRaMacMibSetRequestConfirm( &mibReq );

Any idea?

I read these two links :

https://community.st.com/s/question/0D50X00009XkbSMSAZ/icubelrwan-v112-set-tx-power?t=1550487240182

https://www.thethingsnetwork.org/docs/lorawan/adr.html

 EDIT :

I found this in loramac.c

/*!
 * LoRaMAC MCPS-Request for a confirmed frame
 */
typedef struct sMcpsReqConfirmed
{
 /*!
 * Frame port field. Must be set if the payload is not empty. Use the
 * application specific frame port values: [1...223]
 *
 * LoRaWAN Specification V1.0.2, chapter 4.3.2
 */
 uint8_t fPort;
 /*!
 * Pointer to the buffer of the frame payload
 */
 void* fBuffer;
 /*!
 * Size of the frame payload
 */
 uint16_t fBufferSize;
 /*!
 * Uplink datarate, if ADR is off
 */
 int8_t Datarate;
 /*!
 * Number of trials to transmit the frame, if the LoRaMAC layer did not
 * receive an acknowledgment. The MAC performs a datarate adaptation,
 * according to the LoRaWAN Specification V1.0.2, chapter 18.4, according
 * to the following table:
 *
 * Transmission nb | Data Rate
 * ----------------|-----------
 * 1 (first) | DR
 * 2 | DR
 * 3 | max(DR-1,0)
 * 4 | max(DR-1,0)
 * 5 | max(DR-2,0)
 * 6 | max(DR-2,0)
 * 7 | max(DR-3,0)
 * 8 | max(DR-3,0)
 *
 * Note, that if NbTrials is set to 1 or 2, the MAC will not decrease
 * the datarate, in case the LoRaMAC layer did not receive an acknowledgment
 */
 uint8_t NbTrials;
}McpsReqConfirmed_t;

Only confirmed message use ADR?

This topic has been closed for replies.