Skip to content

Commit 85c69f5

Browse files
jtguggedalrlubos
authored andcommitted
applications: asset_tracker_v2: Explicitly disable PSM if not enabled
If the user sets CONFIG_MODEM_AUTO_REQUEST_POWER_SAVING_FEATURES=n, it's reasonable to expect that PSM would not be requested by the device. However, the nRF9160 modem stores PSM request information to NVM, so PSM must explicitly be disabled before the modem is put into normal mode to be sure that PSM is not requested by the device. This patch adds such logic to the modem module. Signed-off-by: Jan Tore Guggedal <[email protected]>
1 parent 8934031 commit 85c69f5

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

applications/asset_tracker_v2/src/modules/modem_module.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -744,14 +744,19 @@ static int neighbor_cells_measurement_start(void)
744744
static int configure_low_power(void)
745745
{
746746
int err;
747+
bool enable = IS_ENABLED(CONFIG_MODEM_AUTO_REQUEST_POWER_SAVING_FEATURES);
747748

748-
err = lte_lc_psm_req(true);
749+
err = lte_lc_psm_req(enable);
749750
if (err) {
750751
LOG_ERR("lte_lc_psm_req, error: %d", err);
751752
return err;
752753
}
753754

754-
LOG_DBG("PSM requested");
755+
if (enable) {
756+
LOG_DBG("PSM requested");
757+
} else {
758+
LOG_DBG("PSM disabled");
759+
}
755760

756761
return 0;
757762
}
@@ -809,12 +814,10 @@ static int setup(void)
809814
}
810815
}
811816

812-
if (IS_ENABLED(CONFIG_MODEM_AUTO_REQUEST_POWER_SAVING_FEATURES)) {
813-
err = configure_low_power();
814-
if (err) {
815-
LOG_ERR("configure_low_power, error: %d", err);
816-
return err;
817-
}
817+
err = configure_low_power();
818+
if (err) {
819+
LOG_ERR("configure_low_power, error: %d", err);
820+
return err;
818821
}
819822

820823
err = modem_data_init();

doc/nrf/releases/release-notes-changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ nRF9160: Asset Tracker v2
6464

6565
* Updated the code and documentation to use the acronym GNSS instead of GPS when not referring explicitly to the GPS system.
6666
* Added support for atmospheric pressure readings retrieved from the BME680 sensor on Thingy:91.
67+
* Fixed an issue where PSM could be requested from the network even though it was disabled in Kconfig.
6768

6869
* Added:
6970

0 commit comments

Comments
 (0)