1. Modifying Join Rate
In RegionCN470.c, there is the following function:
int8_t RegionCN470AlternateDr( AlternateDrParams_t* alternateDr ){ int8_t datarate = 0;
if( ( alternateDr->NbTrials % 48 ) == 0 ) { datarate = DR_0; } else if( ( alternateDr->NbTrials % 32 ) == 0 ) { datarate = DR_1; } else if( ( alternateDr->NbTrials % 24 ) == 0 ) { datarate = DR_2; } else if( ( alternateDr->NbTrials % 16 ) == 0 ) { datarate = DR_3; } else if( ( alternateDr->NbTrials % 8 ) == 0 ) { datarate = DR_4; } else { datarate = DR_2; } return datarate;}
It can be seen that: the join rate is continuously adjusted during the joining process, mainly related to the number of join attempts. When the number of join attempts is a multiple of 48, DR_0 is used; when it is a multiple of 32, DR_1 is used; and so on. For other join attempts, DR_2 (which corresponds to SF10 for CN470) is used.If you want to modify the join rate, you can adjust it according to the actual situation.
2. Modifying Join Interval
In the RegionCommon.c file, there is the following function:
#define BACKOFF_DC_1_HOUR 100
#define BACKOFF_DC_10_HOURS 1000
#define BACKOFF_DC_24_HOURS 10000
uint16_t RegionCommonGetJoinDc( TimerTime_t elapsedTime ){ uint16_t dutyCycle = 0; if( elapsedTime < 3600000 ) { dutyCycle = BACKOFF_DC_1_HOUR; } else if( elapsedTime < ( 3600000 + 36000000 ) ) { dutyCycle = BACKOFF_DC_10_HOURS; } else { dutyCycle = BACKOFF_DC_24_HOURS; } return dutyCycle;}
elapsedTime represents the elapsed time, and it can be seen that as time goes on, the join interval becomes longer.If you want to change the join time, you can modify the three macros above.
======================================
Related Articles:
LoRa Serial Port Transparent Transmission
LoRa Connection to Tencent Cloud IoT Platform
STM32 and LoRa Low Power Debugging Summary
