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

Merging application mqtt_simple and gps

Hello, 

I am trying to merge mqtt_simple and gps together. Each of them is working well on Thingy:91.

1. I am using lte_lc to configure the modem and enable PSM and eDRX.

How do I know if the modem enters PSM/eDRX mode?

Should I call something like AT+CEREG=5 using at_cmd_set?

Can I ask for a simple example on how to doing it?

2. is lte_lc_psm_req(true) using the parameter set from Kconfig?

such as

CONFIG_LTE_PSM_REQ_RPTAU="00000110"
CONFIG_LTE_PSM_REQ_RAT="00000010"

3.

"eDRX wake-up-and-listen period is 1ms.

Under PSM, a device will wake and receive and transmit control messages for about 100-200ms"

But how do I know how long the time is needed to transmit one packet?

For example, I want to send nmea data using MQTT every 2 seconds. But the data length received from nmea is not fixed.

Thank you in advance for your help.

Best Regards,

Leo 

Parents
  • Hello Leo, 

    How do I know if the modem enters PSM/eDRX mode?

    You can use the %XMODEMSLEEP and %XT3412 notifications to check the PSM status of the modem. Within your application, you can use the at_cmd_handler to process these notifications. But when it comes to co-existence of LTE and GPS, I’m not sure if you need to know the PSM status of the modem. It will basically take care of that by itself.

    2. is lte_lc_psm_req(true) using the parameter set from Kconfig?

    Yes.  

    But how do I know how long the time is needed to transmit one packet?

    Normally, the modem will prioritise the LTE stack. Sending data every 2 seconds might result in that the GPS stack does not get the possibility to run “long enough” for getting a fix. My recommendation is to make usage of PSM/eDRX accordingly to avoid this problem.

    I hope my answers will help you!

    Regards,

    Markus

Reply
  • Hello Leo, 

    How do I know if the modem enters PSM/eDRX mode?

    You can use the %XMODEMSLEEP and %XT3412 notifications to check the PSM status of the modem. Within your application, you can use the at_cmd_handler to process these notifications. But when it comes to co-existence of LTE and GPS, I’m not sure if you need to know the PSM status of the modem. It will basically take care of that by itself.

    2. is lte_lc_psm_req(true) using the parameter set from Kconfig?

    Yes.  

    But how do I know how long the time is needed to transmit one packet?

    Normally, the modem will prioritise the LTE stack. Sending data every 2 seconds might result in that the GPS stack does not get the possibility to run “long enough” for getting a fix. My recommendation is to make usage of PSM/eDRX accordingly to avoid this problem.

    I hope my answers will help you!

    Regards,

    Markus

Children
Related