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

Lowering the power consumption of nRF9160 mqtt_example

Hi,

I've been trying to lower the power consumption of the MQTT example and followed the guide in here

1. I compiled the low power UDP example and do exactly all the things provided here. However, the minimum current for me is 50uA at 5V supply. The supply is external and everything is set properly but I do not know why I produce the results reported( My DK version is 0.8.2). I want to know why I am not getting the same results.

2. I tried to lower the power consumption of the MQTT example by modifying it to be like the low power UDP example(here) and lowered the minimum current to 50uA which is again like the UDP example. But when the LTE link is established, the average current increases to 500uA . In the UDP example, I do not see any spikes on the current unless when it transfers data. But at the MQTT example, there are some spikes that are related to the LTE connection( I activated PSM but there are not any sensible difference). Is there any way that I can reduce the power consumption in the MQTT example? Why PSM is not helping?

This is the main.c of my code:

 modem_configure();

        err = lte_lc_psm_req(true);
        if (err) {
                printk("ERROR: set edrx %d\n", err);
                return;
        }


	client_init(&client);

	err = mqtt_connect(&client);
	if (err != 0) {
		printk("ERROR: mqtt_connect %d\n", err);
		return;
	}

	err = fds_init(&client);
	if (err != 0) {
		printk("ERROR: fds_init %d\n", err);
		return;
	}

3. The thing that is strange to me is that in the MQTT example there is a "modem_configure" function that calls the "lte_lc_init_and_connect" function for establishing the LTE connection. However, in the UDP example, this function is not used and only "lte_lc_psm_req" is used. However, if I delete the "lte_lc_init_and_connect" function from MQTT example, it cannot get connected to the server because there is not an LTE connection. Can anyone clear this up for me?

Parents
  • Hi,

     

    First, you need to disable the serial output by setting CONFIG_SERIAL=n in both the spm/prj.conf and mqtt_simple/prj.conf.

     

    The thing that is strange to me is that in the MQTT example there is a "modem_configure" function that calls the "lte_lc_init_and_connect" function for establishing the LTE connection. However, in the UDP example, this function is not used and only "lte_lc_psm_req" is used. However, if I delete the "lte_lc_init_and_connect" function from MQTT example, it cannot get connected to the server because there is not an LTE connection. Can anyone clear this up for me?

    The start up procedure runs certain functions and drivers prior to the application reaching the main() function, one of these can be initializing a LTE connection to the network, but you can also set this config in your prj.conf to call it in your application instead (via modem_configure()):

    https://github.com/NordicPlayground/fw-nrfconnect-nrf/blob/master/applications/asset_tracker/prj.conf#L20

     

    Kind regards,

    Håkon

  • Hi,

    Thanks for the response. 

    First, you need to disable the serial output by setting CONFIG_SERIAL=n in both the spm/prj.conf and mqtt_simple/prj.conf.

    1. I actually did disable serial by setting CONFIG_SERIAL=n in both spm/prj.conf and mqtt_simple/prj.conf. When I do not disable the serial in both of them I will get the idle current of 600uA. The thing is when I disable both of them I still get 50uA as the idle current which is higher than the 7uA that is reported. At first, I thought maybe because I did something wrong with the MQTT example. However, when I exactly compiled the PSM example and uploaded it to the chip again I got 50uA as the idle current.

    The start up procedure runs certain functions and drivers prior to the application reaching the main() function, one of these can be initializing a LTE connection to the network, but you can also set this config in your prj.conf to call it in your application instead (via modem_configure()):

    2. Can you please help me with those certain functions? I want to activate the LTE before my main function too. Which modifications should I do? I looked at the In the proj.conf of the PSM code, and there are two following options

    CONFIG_LTE_LINK_CONTROL=y
    CONFIG_LTE_LEGACY_PCO_MODE=y

    However, when I add them into my MQTT proj.conf I still do not get connected to LTE prior to the main function. 

    3. One last question, what does "CONFIG_LTE_LEGACY_PCO_MODE=y" do?

Reply
  • Hi,

    Thanks for the response. 

    First, you need to disable the serial output by setting CONFIG_SERIAL=n in both the spm/prj.conf and mqtt_simple/prj.conf.

    1. I actually did disable serial by setting CONFIG_SERIAL=n in both spm/prj.conf and mqtt_simple/prj.conf. When I do not disable the serial in both of them I will get the idle current of 600uA. The thing is when I disable both of them I still get 50uA as the idle current which is higher than the 7uA that is reported. At first, I thought maybe because I did something wrong with the MQTT example. However, when I exactly compiled the PSM example and uploaded it to the chip again I got 50uA as the idle current.

    The start up procedure runs certain functions and drivers prior to the application reaching the main() function, one of these can be initializing a LTE connection to the network, but you can also set this config in your prj.conf to call it in your application instead (via modem_configure()):

    2. Can you please help me with those certain functions? I want to activate the LTE before my main function too. Which modifications should I do? I looked at the In the proj.conf of the PSM code, and there are two following options

    CONFIG_LTE_LINK_CONTROL=y
    CONFIG_LTE_LEGACY_PCO_MODE=y

    However, when I add them into my MQTT proj.conf I still do not get connected to LTE prior to the main function. 

    3. One last question, what does "CONFIG_LTE_LEGACY_PCO_MODE=y" do?

Children
Related