Ultra-low Power NB-IOT example code

Hi, 

I am looking for a sample code, which demonstrates the ultra-low power capabilities of the nRF9160 with the following features: 

  • The device should send some dummy data to the nRF Cloud and then enter PSM. 
  • After a certain TAU, the device should wake up, send another dummy message and enter PSM again and so on.
  • The TAU Period should be configurable. 
  1. Which of the given Application/Samples suits these requirements? 
  2. Can you provide me with the documentation about how to enter PSM and how to configure TAU? 
  3. Are there any current measurements provided by nordic, which underpin the current values statet in the datasheet? 

Thanks in advance for your advice.

Parents
  • Hi,

    Which of the given Application/Samples suits these requirements? 

    We two relevant samples that you could combine:

    nRF9160: UDP has sending dummy data, going to sleep and waking up after a given time.

    nRF9160: nRF Cloud REST Device Message is a sample for sending data to the nRF Cloud.

    Since you want to use NB-IoT you will have to change in prj.conf from

    CONFIG_LTE_NETWORK_MODE_LTE_M=y

    to

    CONFIG_LTE_NETWORK_MODE_NBIOT=y

    Can you provide me with the documentation about how to enter PSM and how to configure TAU? 

    If set up, the device should automatically enter PSM when it is done with the communication.

    You can change the settings in compile time via your prj.conf. In the UDP sample you can find the following section there:

    ## PSM
    CONFIG_UDP_PSM_ENABLE=y
    CONFIG_LTE_PSM_REQ_RPTAU="00100001"
    CONFIG_LTE_PSM_REQ_RAT="00000000"

    Config documentation:

    CONFIG_LTE_PSM_REQ_RPTAU

    CONFIG_LTE_PSM_REQ_RAT

    As it can be seen there, the official documentation about the data formats can be found in 3GPP 27.007 Ch. 7.38. nd 3GPP 24.008 Ch. 10.5.7.4a (Periodic-TAU) and 3GPP 27.007 Ch. 7.38. and 3GPP 24.008 Ch. 10.5.7.3 (Active-Time), but for a quick reference you can for example use the +CPSMS AT command documentation.

    If you want to do it in runtime, we have the enabling power saving features in our LTE link controller library documentation. You can also find the API documentation there.

    You can also send the aforementioned AT command for setting this configuration.

    Also some networks may grant you Periodic-TAU, but not Active-Time. In that case the PSM will NOT work.

    For checking the actual granted values you can use the lte_lc_psm_get() function or %XMONITOR AT command.

    Remember that Periodic-TAU is the maximum time your device can be offline. It should be larger than the actual time your device is asleep.

    The device should automatically go into the System ON sleep mode while in idle thread.

    Are there any current measurements provided by nordic, which underpin the current values statet in the datasheet? 

    We have for example a guide on getting started with current measurements on the nRF9160 that also has some real-life measurements using the UDP sample.

    Best regards,

    Michal

  • Dear Michal, 

    Thanks you for your answer and sorry for my late reply, I had some trouble setting up my system for the reception of UDP packages. However, the UDP example works now and the average current in PSM mode is around 3 uA :-)

    I have a last question regarding the UDP example: 

    I want to send a certain amount of data in order to be able to compare it to another hardware solution I have to investigate. My understanding is that the size of the UDP payload in the code is determined by two settings: 

    main.c

    #define UDP_IP_HEADER_SIZE 28

    (I assume this setting should not be changed)

    and there is this setting in the nRF Kconfig: 

    I assume this one is represented by the CONFIG_UPD_DATA_UPLOAD_SIZE_BYTES define, which is also used in the main.c

    	printk("Transmitting UDP/IP payload of %d bytes to the ",
    	       CONFIG_UDP_DATA_UPLOAD_SIZE_BYTES + UDP_IP_HEADER_SIZE);

    So using these two values the total payload is 38 Bytes. 

    However, the size of the UPD packets I receive on the corresponding port are 60 bytes each. Are these additional bytes generated in the network or by the nRF9160?
    The following image shows the data I receive on the port caputred with Wireshark: 

    As you can see the actual data is 10 Bytes, however, the total package size is 60 Bytes. I am not so familiar with UDP. My only concern is to know if the 60 bytes are sent by the NRF9160 or if the chip actually only sends the 38 bytes. I hope you understand what I mean. 

    If I want to change the length of the data payload can I just change the value in the Kconfig view? 

    Have a great day!

Reply
  • Dear Michal, 

    Thanks you for your answer and sorry for my late reply, I had some trouble setting up my system for the reception of UDP packages. However, the UDP example works now and the average current in PSM mode is around 3 uA :-)

    I have a last question regarding the UDP example: 

    I want to send a certain amount of data in order to be able to compare it to another hardware solution I have to investigate. My understanding is that the size of the UDP payload in the code is determined by two settings: 

    main.c

    #define UDP_IP_HEADER_SIZE 28

    (I assume this setting should not be changed)

    and there is this setting in the nRF Kconfig: 

    I assume this one is represented by the CONFIG_UPD_DATA_UPLOAD_SIZE_BYTES define, which is also used in the main.c

    	printk("Transmitting UDP/IP payload of %d bytes to the ",
    	       CONFIG_UDP_DATA_UPLOAD_SIZE_BYTES + UDP_IP_HEADER_SIZE);

    So using these two values the total payload is 38 Bytes. 

    However, the size of the UPD packets I receive on the corresponding port are 60 bytes each. Are these additional bytes generated in the network or by the nRF9160?
    The following image shows the data I receive on the port caputred with Wireshark: 

    As you can see the actual data is 10 Bytes, however, the total package size is 60 Bytes. I am not so familiar with UDP. My only concern is to know if the 60 bytes are sent by the NRF9160 or if the chip actually only sends the 38 bytes. I hope you understand what I mean. 

    If I want to change the length of the data payload can I just change the value in the Kconfig view? 

    Have a great day!

Children
Related