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

Get GPS and send it to MQTT Broker

Hi,

I'm quiet new with nrf9160.


I try to mix the two sample GPS and MQTT to send my position each time it change to a MQTT broker.

I have create two threads, one for the MQTT and the second for get the GPS position.

How to setup the modem to use MQTT (LTE) and GPS.
If I use the GPS setup from the example, I get each time an error (-8) when I send the AT%XSYSTEMMODE command.

Exist it some example of this application?

Thank you

Thomas

Parents Reply
  • Which carrier are you trying to connect to and is this a local sim or roaming SIM?

    Could you also attach the serial Output log from the application?

    From your modem log I see that you first set only xsystemmode=1,0,0,0 (LTE-M mode)

    then later on you select xsystemmode=1,0,1,0 (LTE-M mode + GPS) and get an ERROR. 
    You must put the modem in offline mode or power off mode to be able to switch xsystemmode.

    Also if you are going to utilize GPS in PSM mode or eDRX you need to request these values from the network.

Children
No Data
Related