nRF9160 get device position using AT command

I am playing around with nRF9160 on the Thingy 91. I am testing various AT command and just familiarizing myself with the LTE and AT commands.

For me, the most important modem funcionality is to be able to detect device position. I have been going through the AT command document trying to figure out how can this be done:

https://infocenter.nordicsemi.com/pdf/nrf9160_at_commands_v2.2.pdf

but I could not find a way to do this.

I have flashed the device with asset tracker v2 application and opened cellular monitor:

I was hoping to see the device position here but I do not think that is the case since I cannot see position parameter anywhere

I have also tried this:

https://electronics.stackexchange.com/questions/73427/trying-to-find-location-in-gsm-network

but it did not seem to work.

Apologies in advance if my questions are silly, I am quite new to this.

My main question

1. Is there a way to get the device location (latitude, longitude) using AT command? 

2. Can you monitor device position in Cellular Monitor?

Parents
  • Hello,

    Apologies in advance if my questions are silly, I am quite new to this.

    Not at all. 

    1. Is there a way to get the device location (latitude, longitude) using AT command? 

    No, the AT commands does not communicate with the GNSS module. It uses the GNSS interface from the modem library which is shown in our GNSS sample.

    Can you monitor device position in Cellular Monitor?

    The output from this sample is shown in the Serial Terminal which can be opened from the Cellular Monitor. 

    I have flashed the device with asset tracker v2 application and opened cellular monitor:

    The position of the device running Asset Tracker v2 is uploaded to nRF Cloud. More information on this is described in the nRF Cloud documentation.

    If you need more details, please provide more information on what you are trying to achieve Slight smile

    Kind regards,
    Øyvind

  • Thanks for response.

    If you need more details, please provide more information on what you are trying to achieve

    I was simply hoping that I would be able to fully control the modem using AT commands if the modem is running at_client or asset_tracker_v2 firmware while the other MCU (nrf52840) is running connectivity_bridge application to allow communication with the modem.

    I have read somewhere that when you are working with the modems, you have 2 options:

    1. Write your own application if manufacturer provides SDK and tools for it (same as in asset_tracker_v2).

    2. Use AT commands and simply control the modem by using standartised AT commands that all modems should support according to 3GPP standard. In fact, if I am not mistaken, some modems (such as Quectel) do not even allow writing your own application on the modem side like you allow on the nRF9160. You can only control some modems via AT commands. Is that correct? 

    Anyways, since I cannot read the device position using AT command, I do not have any other option but to write my own application since for my project I need to get the position. Is there any particular reason why on the nRF9160 is not possible to extract device position using AT command? If that was possible, I could just use AT commands for my project and that would probably simplify the development.

  • Thanks. I have looked at standard and proprietary AT command list:

    https://www.nordicsemi.com/-/media/Software-and-other-downloads/SiP/nRF91x1-SiP/v0.8-nRF91x1_CIoT_and_Positioning-AT-Commands-reference-guide.pdf

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.5.0/nrf/applications/serial_lte_modem/doc/AT_commands_intro.html#slm-at-intro

    I have also flashed the serial LTE modem application on the nRF9160 on Thingy91 while running connectivity_bridge aplication on the nRF52840. 

    As expected, it does not seem to work right out of the box.

    I have configured Serial terminal (Termite) as shown in the instructions:

    https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/slm_description.html#communicating-with-the-modem-on-thingy-91

    But I cannot see anything being printed on the serial console:

    I have also tried to open RTT terminal but it is also empty.

    I have also tried to send some AT commands, but no response

    I have built the project using the following build configuration:

    Considering everything, I believe there might be some issue with the project configuration. Is there a possibility you can try this on your side with ncs v.2.5.0 and check if you see messages being printed to the console with the default project configuration (not changing anything).

    I can upload a simple hello world program to the nRF9160 such as below:

    #include <stdio.h>
    #include <stdlib.h>
    #include <zephyr/kernel.h>
    
    int main(void)
    {
    	while(1){
    		printf("Hello World\n");
    		k_msleep(1000);
    	}
    }

    and I will see the hello world messages on the terminal:

    So that proves that there is no issues on my HW.

  • zazas321 said:
    www.nordicsemi.com/.../quote]

    Note that you are referring to nRF9161/nRF9131 AT Commands Reference guide. This does not work for the nRF9160. The AT Commmand reference guide for nRF9160 is found here.

    zazas321 said:

    But I cannot see anything being printed on the serial console:

    I tested with the Serial Terminal (found under nRF Connect for Desktop) and did not have any issues with running the application (SLM v2.5.0) on my Thingy:91


    What version of the Connectivity Bridge are you running? How are you programming the device?

    [/quote]
  • You were right regarding the nRF9161. I was looking a the wrong document, thanks for clarifying.

    Regarding the serial monitor, I have tried Serial Terminal found at NRF Connect and I can say that it works!

    However, I still have some questions.

    Question 1

    It does not work on Termite. Perhaps the serial port settings are not correct? I am pretty sure I have configured as suggested on your website:

    developer.nordicsemi.com/.../slm_description.html

    but it still does not work:

    If you have termite, could you please try this on your side just to confirm there is an issue on my side?

    Question 2

    As you can see from the image above, I have tried to use AT#XGPS command but the ERROR has been returned. Perhaps you got any ideas why would that be the case?

    I use the following example:

    Can you run it on your side just to confirm it works on your side?

  • zazas321 said:
    If you have termite, could you please try this on your side just to confirm there is an issue on my side?

    I'm afraid I don't have Termite on my machine. If you do get results with the Serial Terminal then the application is working as intended

    zazas321 said:
    As you can see from the image above, I have tried to use AT#XGPS command but the ERROR has been returned. Perhaps you got any ideas why would that be the case?

    I get the same result and will investigate. 

    Kind regards,
    Øyvind

  • Hello again, 

    Øyvind said:
    I get the same result and will investigate. 

    This is a bug which will be fixed in the next tagged version. Should be availble on the main branch for testing now. 

    Kind regards,
    Øyvind

Reply Children
  • Thank you very much for investigating this further! Are you suggesting that there is an issue with the AT#XGPS command on the ncs v2.5.0 or this issue is specific to the serial_LTE application? 

    Being able to get the device location using AT#XGPS at command I would consider to be one of the most important GNSS funcionalities. It is quite strange how no one have noticed it earlier.

    Anyways, regarding the termite, I have been further experimenting with it and discovered that you have to set Flow Control in order to get the response:

    However, on your website this is not shown:

    which is quite misleading.

  • zazas321 said:
    Anyways, regarding the termite, I have been further experimenting with it and discovered that you have to set Flow Control in order to get the response:

    Thanks for pointing out! I will inform our documentation team about this.

    zazas321 said:
    Thank you very much for investigating this further! Are you suggesting that there is an issue with the AT#XGPS command on the ncs v2.5.0 or this issue is specific to the serial_LTE application? 

    No, sorry, the issue seems to be with the example itself which will be fixed in latest version. The #XGPS command does not have 5 arguments but 4. 



    Can you try issuing  AT#XGPS=1,0,0,0 instead?

    Kind regards,
    Øyvind

Related