mirror of https://github.com/ARMmbed/mbed-os.git
[IOTCELL-1181] Using higher data rates to connect
The stack was trying to connect with default data rates which happened to be the lowest data rates in a specific region. In the beginning device and NS do not have agreed upon tx rx parameters and there can be synchronization issues. When we use lower datarates, we may end up having a minute and a half long transmissions that hnot only blocks the channel for a long time but also reduce the chance of proper synch between device and NS. That's why we have decided to begin with higher data rates and gradually decrease datarate if we do not hear from the network server.pull/7601/head
parent
36a4c557b7
commit
b0b026126c
|
@ -1755,9 +1755,7 @@ lorawan_status_t LoRaMac::initialize(EventQueue *queue)
|
|||
_params.timers.mac_init_time = _lora_time.get_current_time();
|
||||
|
||||
_params.sys_params.adr_on = MBED_CONF_LORA_ADR_ON;
|
||||
|
||||
_params.is_nwk_public = MBED_CONF_LORA_PUBLIC_NETWORK;
|
||||
_lora_phy->setup_public_network_mode(MBED_CONF_LORA_PUBLIC_NETWORK);
|
||||
_params.sys_params.channel_data_rate = _lora_phy->get_default_max_tx_datarate();
|
||||
|
||||
return LORAWAN_STATUS_OK;
|
||||
}
|
||||
|
|
|
@ -514,13 +514,16 @@ void LoRaPHY::reset_to_default_values(loramac_protocol_params *params, bool init
|
|||
|
||||
params->sys_params.channel_tx_power = get_default_tx_power();
|
||||
|
||||
params->sys_params.channel_data_rate = get_default_tx_datarate();
|
||||
// We shall always start with highest achievable data rate.
|
||||
// Subsequent decrease in data rate will mean increase in range henceforth.
|
||||
params->sys_params.channel_data_rate = get_default_max_tx_datarate();
|
||||
|
||||
params->sys_params.rx1_dr_offset = phy_params.default_rx1_dr_offset;
|
||||
|
||||
params->sys_params.rx2_channel.frequency = get_default_rx2_frequency();
|
||||
|
||||
params->sys_params.rx2_channel.datarate = get_default_rx2_datarate();
|
||||
// RX2 data rate should also start from the maximum
|
||||
params->sys_params.rx2_channel.datarate = get_default_max_tx_datarate();
|
||||
|
||||
params->sys_params.uplink_dwell_time = phy_params.ul_dwell_time_setting;
|
||||
|
||||
|
@ -560,6 +563,11 @@ uint8_t LoRaPHY::get_default_tx_datarate()
|
|||
return phy_params.default_datarate;
|
||||
}
|
||||
|
||||
uint8_t LoRaPHY::get_default_max_tx_datarate()
|
||||
{
|
||||
return phy_params.default_max_datarate;
|
||||
}
|
||||
|
||||
uint8_t LoRaPHY::get_default_tx_power()
|
||||
{
|
||||
return phy_params.default_tx_power;
|
||||
|
|
|
@ -423,6 +423,14 @@ public:
|
|||
*/
|
||||
uint8_t get_default_tx_datarate();
|
||||
|
||||
/**
|
||||
* @brief get_default_max_tx_datarate Gets the maximum achievable data rate for
|
||||
* LoRa modulation. This will always be the highest data rate achievable with
|
||||
* LoRa as defined in the regional specifications.
|
||||
* @return Maximum achievable data rate with LoRa modulation.
|
||||
*/
|
||||
uint8_t get_default_max_tx_datarate();
|
||||
|
||||
/**
|
||||
* @brief get_default_tx_power Gets the default TX power
|
||||
* @return Default TX power
|
||||
|
|
Loading…
Reference in New Issue