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

SUPL library fails: at_cmd: Response buffer not large enough

Hi,

I am trying to do AGPS with the supl library. 
I obtained version 0.7 through the application and installed it (and enabled the required config options).

Unfortunately, this is now crashing the (asset_tracker_v2) application:

[00:00:19.456,542] <dbg> cloud_codec_ringbuffer.cloud_codec_populate_sensor_buffer: Entry: 1 of 9 in sensor buffer filled
[00:00:19.468,200] <dbg> agps.open_supl_socket: ip 74.125.193.192 (c0c17d4a) port 7276
[00:00:19.508,056] <wrn> modem_module: Unsupported modem firmware version: mfw_nrf9160_1.3.0
[00:00:19.517,150] <wrn> modem_module: Expected firmware version: mfw_nrf9160_1.2.3
[00:00:19.525,543] <wrn> modem_module: You can change the expected version through the
[00:00:19.534,210] <wrn> modem_module: EXPECTED_MODEM_FIRMWARE_VERSION setting.
[00:00:19.542,327] <wrn> modem_module: Please upgrade: http://bit.ly/nrf9160-mfw-update
[00:00:19.551,147] <inf> event_manager: MODEM_EVT_MODEM_STATIC_DATA_READY
[00:00:19.558,380] <dbg> modules_common.module_enqueue_msg: modem module: Enqueued: MODEM_EVT_MODEM_STATIC_DATA_READY
[00:00:19.569,549] <dbg> modules_common.module_enqueue_msg: data module: Enqueued: MODEM_EVT_MODEM_STATIC_DATA_READY
[00:00:19.580,535] <dbg> modules_common.module_enqueue_msg: cloud module: Enqueued: MODEM_EVT_MODEM_STATIC_DATA_READY
[00:00:19.591,644] <dbg> modules_common.module_enqueue_msg: app module: Enqueued: MODEM_EVT_MODEM_STATIC_DATA_READY
[00:00:19.602,661] <dbg> modules_common.module_get_next_msg: app module: Dequeued MODEM_EVT_MODEM_STATIC_DATA_READY
[00:00:19.613,922] <dbg> modules_common.module_get_next_msg: data module: Dequeued MODEM_EVT_MODEM_STATIC_DATA_READY
[00:00:19.625,305] <inf> agps: Starting SUPL session
[00:00:19.633,697] <err> at_cmd: Response buffer not large enough
[00:00:19.640,716] <err> supl_client: Fetching LTE info failed

The error is pretty straightforward, but I already increased the AT buffer size from 2700 to 4000, and I still get this error..

Is this normal? What is the recommended AT buffer size for use with AGPS?

(I am using SDK 1.5.0, modem firmware 1.3.0, revision 1 of the thingy91.)

Kind regards,

Arnout

Parents
  • Thanks for the feedback, Arnout.

    Arnout said:
    However this crashes midway, in the same way as the asset_tracker_v2 did

    What do you mean by “crashes”? Does the device reset?

    At which point in the application does that happen? During a library function call?

    Regards,

    Markus

  • Hi,

    It crashes because z_arm_exc_spurious is called.. (which eventually resets the device)

    The stack trace is gone, so I can't see exactly where it goes wrong.

    Also, if I change "timing" (by stepping through the code instead of pressing go) it does not seem to  crash, but goes into some infinite loop in gnss_interface_read

     

     

    So, don't know what to tell you, aside that after the supl library has been called, strange things happen. (Perhaps it overwrites memory due to some mismatch of compiled structures, dunno. Without source code of the supl library, its not super easy to figure out)

    In theory, I could go and try and debug each call to the library and check when the problem happens to try and pinpoint it further, but I was hoping you would be able to reproduce this quickly and narrow it down more quickly.

    Kind regards,

    Arnout

  • By the way, tested on asset_tracker_v2 on v1.6.0, with following config diff:

    $ git diff
    diff --git a/applications/asset_tracker_v2/prj.conf b/applications/asset_tracker_v2/prj.conf
    index c39629ddc..a2b154a27 100644
    --- a/applications/asset_tracker_v2/prj.conf
    +++ b/applications/asset_tracker_v2/prj.conf
    @@ -52,20 +52,20 @@ CONFIG_LTE_PSM_REQ_RAT="00000011"
     #                 section.
    
     # # AWS IoT
    -# ## Mandatory application specific configurations for AWS_IOT.
    -# CONFIG_AWS_IOT=y
    -# CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
    -# CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y
    -# CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST=y
    -# CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN=2048
    -# CONFIG_AWS_IOT_MQTT_PAYLOAD_BUFFER_LEN=2048
    -# CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=1
    -# CONFIG_AWS_IOT_CLIENT_ID_APP=y
    -# CONFIG_AWS_FOTA=y
    +## Mandatory application specific configurations for AWS_IOT.
    +CONFIG_AWS_IOT=y
    +CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
    +CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y
    +CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST=y
    +CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN=2048
    +CONFIG_AWS_IOT_MQTT_PAYLOAD_BUFFER_LEN=2048
    +CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=1
    +CONFIG_AWS_IOT_CLIENT_ID_APP=y
    +CONFIG_AWS_FOTA=y
    
     # ## AWS IoT options that must be configured.
    -# CONFIG_AWS_IOT_SEC_TAG=42
    -# CONFIG_AWS_IOT_BROKER_HOST_NAME=""
    +CONFIG_AWS_IOT_SEC_TAG=333
    +CONFIG_AWS_IOT_BROKER_HOST_NAME="awdikgy1zj16p-ats.iot.eu-central-1.amazonaws.com"
    
     # # Azure IoT Hub
     # ## Mandatory application specific configurations for AZURE_IOT_HUB.
    @@ -87,14 +87,14 @@ CONFIG_LTE_PSM_REQ_RAT="00000011"
     # CONFIG_AZURE_FOTA_SEC_TAG=11
    
     # nRF Cloud
    -CONFIG_NRF_CLOUD=y
    -CONFIG_AGPS=y
    -CONFIG_AGPS_SRC_NRF_CLOUD=y
    -CONFIG_NRF_CLOUD_AGPS=y
    +#CONFIG_NRF_CLOUD=y
    +#CONFIG_AGPS=y
    +#CONFIG_AGPS_SRC_NRF_CLOUD=y
    +#CONFIG_NRF_CLOUD_AGPS=y
     ## Because PGPS consumes a lot of data its disabled by default.
    -CONFIG_NRF_CLOUD_PGPS=n
    -CONFIG_NRF_CLOUD_CONNECTION_POLL_THREAD=y
    -CONFIG_NRF_CLOUD_SEND_TIMEOUT=y
    +#CONFIG_NRF_CLOUD_PGPS=n
    +#CONFIG_NRF_CLOUD_CONNECTION_POLL_THREAD=y
    +#CONFIG_NRF_CLOUD_SEND_TIMEOUT=y
     CONFIG_GPS_MODULE_NMEA=y
    
     # MQTT
    @@ -140,8 +140,8 @@ CONFIG_WATCHDOG_APPLICATION=y
     # is selected. However, due to licensing, the SUPL library must be manually
     # downloaded and configured according to the instructions found in the SUPL
     # client library documentation in NCS.
    -# CONFIG_AGPS=y
    -# CONFIG_AGPS_SRC_SUPL=y
    +CONFIG_AGPS=y
    +CONFIG_AGPS_SRC_SUPL=y
    
     # Event Manager
     CONFIG_EVENT_MANAGER=y
    

    console output:

    *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
    [00:00:00.245,849] <inf> event_manager: APP_EVT_START
    [00:00:00.252,258] <err> ext_sensors: Accelerometer device is not ready
    [00:00:00.259,887] <err> sensor_module: EXT_SENSOR_EVT_ACCELEROMETER_ERROR
    [00:00:00.272,186] <inf> event_manager: DATA_EVT_CONFIG_INIT
    [00:00:00.278,625] <inf> app_module: Device mode: Active
    [00:00:00.284,332] <inf> app_module: Start data sample timer: 120 seconds interval
    [00:00:00.292,541] <inf> event_manager: APP_EVT_ACTIVITY_DETECTION_DISABLE
    [00:00:00.382,019] <inf> event_manager: MODEM_EVT_LTE_CONNECTING
    %CESQ: 49,2,15,2
    +CEREG: 2,"4E84","01042208",7,0,0,"11100000","11100000"
    [00:00:03.696,746] <inf> event_manager: MODEM_EVT_LTE_DISCONNECTED
    [00:00:03.703,918] <inf> event_manager: MODEM_EVT_LTE_CELL_UPDATE
    +CSCON: 1
    +CEREG: 5,"4E84","01042208",7,,,"11100000","11100000"
    [00:00:04.641,052] <inf> event_manager: MODEM_EVT_LTE_CONNECTED
    [00:00:04.647,979] <inf> event_manager: MODEM_EVT_LTE_PSM_UPDATE
    [00:00:04.655,090] <wrn> cloud_module: Cloud connection establishment in progress
    [00:00:04.663,269] <wrn> cloud_module: New connection attempt in 32 seconds if not successful
    [00:00:04.672,698] <inf> event_manager: CLOUD_EVT_CONNECTING
    [00:00:08.422,546] <inf> event_manager: CLOUD_EVT_CONNECTED
    [00:00:08.610,504] <inf> event_manager: DATA_EVT_DATE_TIME_OBTAINED
    [00:00:08.617,706] <inf> event_manager: APP_EVT_DATA_GET - Requested data types (MOD_DYN, BAT, ENV, GNSS, MOD_STAT)
    [00:00:08.635,864] <inf> event_manager: GPS_EVT_ACTIVE
    [00:00:08.641,967] <inf> event_manager: GPS_EVT_AGPS_NEEDED
    [00:00:08.649,291] <inf> agps: SUPL is initialized
    [00:00:08.658,721] <inf> event_manager: SENSOR_EVT_ENVIRONMENTAL_DATA_READY
    [00:00:08.699,493] <inf> event_manager: MODEM_EVT_MODEM_STATIC_DATA_READY
    [00:00:08.745,666] <inf> event_manager: MODEM_EVT_MODEM_DYNAMIC_DATA_READY
    [00:00:08.791,503] <inf> event_manager: MODEM_EVT_BATTERY_DATA_READY
    [00:00:08.853,973] <inf> agps: Starting SUPL session
    [00:00:08.860,961] <err> at_cmd: Response buffer not large enough
    [00:00:08.867,889] <err> supl_client: Fetching LTE info failed
    <crash>

    Debugger output:

Reply
  • By the way, tested on asset_tracker_v2 on v1.6.0, with following config diff:

    $ git diff
    diff --git a/applications/asset_tracker_v2/prj.conf b/applications/asset_tracker_v2/prj.conf
    index c39629ddc..a2b154a27 100644
    --- a/applications/asset_tracker_v2/prj.conf
    +++ b/applications/asset_tracker_v2/prj.conf
    @@ -52,20 +52,20 @@ CONFIG_LTE_PSM_REQ_RAT="00000011"
     #                 section.
    
     # # AWS IoT
    -# ## Mandatory application specific configurations for AWS_IOT.
    -# CONFIG_AWS_IOT=y
    -# CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
    -# CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y
    -# CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST=y
    -# CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN=2048
    -# CONFIG_AWS_IOT_MQTT_PAYLOAD_BUFFER_LEN=2048
    -# CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=1
    -# CONFIG_AWS_IOT_CLIENT_ID_APP=y
    -# CONFIG_AWS_FOTA=y
    +## Mandatory application specific configurations for AWS_IOT.
    +CONFIG_AWS_IOT=y
    +CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
    +CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=y
    +CONFIG_AWS_IOT_AUTO_DEVICE_SHADOW_REQUEST=y
    +CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN=2048
    +CONFIG_AWS_IOT_MQTT_PAYLOAD_BUFFER_LEN=2048
    +CONFIG_AWS_IOT_APP_SUBSCRIPTION_LIST_COUNT=1
    +CONFIG_AWS_IOT_CLIENT_ID_APP=y
    +CONFIG_AWS_FOTA=y
    
     # ## AWS IoT options that must be configured.
    -# CONFIG_AWS_IOT_SEC_TAG=42
    -# CONFIG_AWS_IOT_BROKER_HOST_NAME=""
    +CONFIG_AWS_IOT_SEC_TAG=333
    +CONFIG_AWS_IOT_BROKER_HOST_NAME="awdikgy1zj16p-ats.iot.eu-central-1.amazonaws.com"
    
     # # Azure IoT Hub
     # ## Mandatory application specific configurations for AZURE_IOT_HUB.
    @@ -87,14 +87,14 @@ CONFIG_LTE_PSM_REQ_RAT="00000011"
     # CONFIG_AZURE_FOTA_SEC_TAG=11
    
     # nRF Cloud
    -CONFIG_NRF_CLOUD=y
    -CONFIG_AGPS=y
    -CONFIG_AGPS_SRC_NRF_CLOUD=y
    -CONFIG_NRF_CLOUD_AGPS=y
    +#CONFIG_NRF_CLOUD=y
    +#CONFIG_AGPS=y
    +#CONFIG_AGPS_SRC_NRF_CLOUD=y
    +#CONFIG_NRF_CLOUD_AGPS=y
     ## Because PGPS consumes a lot of data its disabled by default.
    -CONFIG_NRF_CLOUD_PGPS=n
    -CONFIG_NRF_CLOUD_CONNECTION_POLL_THREAD=y
    -CONFIG_NRF_CLOUD_SEND_TIMEOUT=y
    +#CONFIG_NRF_CLOUD_PGPS=n
    +#CONFIG_NRF_CLOUD_CONNECTION_POLL_THREAD=y
    +#CONFIG_NRF_CLOUD_SEND_TIMEOUT=y
     CONFIG_GPS_MODULE_NMEA=y
    
     # MQTT
    @@ -140,8 +140,8 @@ CONFIG_WATCHDOG_APPLICATION=y
     # is selected. However, due to licensing, the SUPL library must be manually
     # downloaded and configured according to the instructions found in the SUPL
     # client library documentation in NCS.
    -# CONFIG_AGPS=y
    -# CONFIG_AGPS_SRC_SUPL=y
    +CONFIG_AGPS=y
    +CONFIG_AGPS_SRC_SUPL=y
    
     # Event Manager
     CONFIG_EVENT_MANAGER=y
    

    console output:

    *** Booting Zephyr OS build v2.6.0-rc1-ncs1  ***
    [00:00:00.245,849] <inf> event_manager: APP_EVT_START
    [00:00:00.252,258] <err> ext_sensors: Accelerometer device is not ready
    [00:00:00.259,887] <err> sensor_module: EXT_SENSOR_EVT_ACCELEROMETER_ERROR
    [00:00:00.272,186] <inf> event_manager: DATA_EVT_CONFIG_INIT
    [00:00:00.278,625] <inf> app_module: Device mode: Active
    [00:00:00.284,332] <inf> app_module: Start data sample timer: 120 seconds interval
    [00:00:00.292,541] <inf> event_manager: APP_EVT_ACTIVITY_DETECTION_DISABLE
    [00:00:00.382,019] <inf> event_manager: MODEM_EVT_LTE_CONNECTING
    %CESQ: 49,2,15,2
    +CEREG: 2,"4E84","01042208",7,0,0,"11100000","11100000"
    [00:00:03.696,746] <inf> event_manager: MODEM_EVT_LTE_DISCONNECTED
    [00:00:03.703,918] <inf> event_manager: MODEM_EVT_LTE_CELL_UPDATE
    +CSCON: 1
    +CEREG: 5,"4E84","01042208",7,,,"11100000","11100000"
    [00:00:04.641,052] <inf> event_manager: MODEM_EVT_LTE_CONNECTED
    [00:00:04.647,979] <inf> event_manager: MODEM_EVT_LTE_PSM_UPDATE
    [00:00:04.655,090] <wrn> cloud_module: Cloud connection establishment in progress
    [00:00:04.663,269] <wrn> cloud_module: New connection attempt in 32 seconds if not successful
    [00:00:04.672,698] <inf> event_manager: CLOUD_EVT_CONNECTING
    [00:00:08.422,546] <inf> event_manager: CLOUD_EVT_CONNECTED
    [00:00:08.610,504] <inf> event_manager: DATA_EVT_DATE_TIME_OBTAINED
    [00:00:08.617,706] <inf> event_manager: APP_EVT_DATA_GET - Requested data types (MOD_DYN, BAT, ENV, GNSS, MOD_STAT)
    [00:00:08.635,864] <inf> event_manager: GPS_EVT_ACTIVE
    [00:00:08.641,967] <inf> event_manager: GPS_EVT_AGPS_NEEDED
    [00:00:08.649,291] <inf> agps: SUPL is initialized
    [00:00:08.658,721] <inf> event_manager: SENSOR_EVT_ENVIRONMENTAL_DATA_READY
    [00:00:08.699,493] <inf> event_manager: MODEM_EVT_MODEM_STATIC_DATA_READY
    [00:00:08.745,666] <inf> event_manager: MODEM_EVT_MODEM_DYNAMIC_DATA_READY
    [00:00:08.791,503] <inf> event_manager: MODEM_EVT_BATTERY_DATA_READY
    [00:00:08.853,973] <inf> agps: Starting SUPL session
    [00:00:08.860,961] <err> at_cmd: Response buffer not large enough
    [00:00:08.867,889] <err> supl_client: Fetching LTE info failed
    <crash>

    Debugger output:

Children
No Data
Related