This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF9160 MQTT + TLS + PSM

Hi,

I have build a application based on the mqtt-simple-sample and successfully integrated TLS.

Now I wanted to measure the floor current in PSM. I did wait some minutes after my application aborted the

mqtt-session and measured a floor current of 980 uAs, what seems way to high in my opinion. In comparison, I measured

a current of 50 uAs with an empty application in PSM and a floor current of 100 uAs in my application without the use of TLS.

Is it normal, that the current consumption is so much higher through the use of TLS or did I missed something in the configs

or the application flow?

My prj.conf files:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#SPM config
CONFIG_IS_SPM=y
CONFIG_GPIO=n
CONFIG_SERIAL=n
CONFIG_UART_CONSOLE=n
#MQTT config
# General config
CONFIG_TEST_RANDOM_GENERATOR=y
# Networking
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS_OFFLOAD=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

And the main:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void main(void) {
volatile int err;
u32_t turner = 0;
volatile static int init_cnt = 0;
provision_certificate();
k_timer_init(&my_timer, my_expiry_function, NULL);
buttons_leds_init();
modem_configure();
err = lte_lc_psm_req(true);
if(err != 0) {
dk_set_leds_state(0x00, DK_LED1_MSK);
} else {
dk_set_leds_state(DK_LED1_MSK, 0x00);
}
client_init(&client);
while (1) {
if(btn_flag > 0) {
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Thanks in advance and best regards.