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

nrf9160 mqtt_simple and gps can not coexist

Hi, Sir:

I am using nrf9160 to develop a project of mqtt and GPS, using mqtt to upload GPS data to the cloud server; I use the software and hardware information as follows:

hardware:

  • nRF9160 DK

software:

  • system: ubuntu + SES
  • ncs : v1.1.0
  • modem : mfw_nrf9160_1.1.0.zip
  • mode: nb-lot and gps(CONFIG_LTE_NETWORK_MODE_NBIOT_GPS=y)
  • example: ncs/nrf/samples/nrf9160/mqtt_simple

I use the mqtt_simple demo as the development starting point, and it works works, next I added gps function;then I met some problem:

After GPS starting to run, mqtt run with errors and cannot publish or subscribe any data:

[11:17:28:682] ***** Booting Zephyr OS build v2.0.99-ncs1 *****␍␊
[11:17:28:695] The MQTT simple sample started␍␊
[11:17:28:696] LTE Link Connecting ...␍␊
[11:17:28:700] >>entry gps thread␍␊
[11:17:35:347] +CEREG: 2,"1D2C","0D1E2742",9,0,0,"11100000","11100000"␍␊
[11:17:48:656] +CEREG: 1,"1D2C","0D1E2742",9,,,"00000100","11100000"␍␊
[11:17:48:661] LTE Link Connected!␍␊
[11:17:48:668] GPS initialized␍␊
[11:17:48:668] mqtt domain www.freqmesh.com␍␊
[11:17:48:850] IPv4 Address found 47.106.164.80␍␊
[11:17:48:853] client id =0983000a4a25␍␊
[11:17:49:188] [mqtt_evt_handler:277] MQTT client connected!␍␊
[11:17:49:193] Subscribing to: hurry/down len 10␍␊
[11:17:49:348] [mqtt_evt_handler:327] SUBACK packet id: 1234␍␊
[11:17:49:665] Enabling PSM␍␊
[11:17:49:673] PSM enabled␍␊
[11:17:50:678] GPS started successfully.␍␊
[11:17:50:681] Searching for satellites to get position fix. This may take several minutes.␍␊
[11:17:50:691] The device will attempt to get a fix for 180 seconds, before the GPS is stopped.␍␊
[11:17:50:695] GPS operation started␍␊
[11:18:49:195] [mqtt_evt_handler:284] MQTT client disconnected -104␍␊
[11:18:49:200] POLLNVAL␍␊
[11:18:49:200] Disconnecting MQTT client...␍␊
[11:18:49:209] Could not disconnect MQTT client. Error: -128␍

I don't know why? Could you  please provide a solution?

Harry

Best Wishes!

Related