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

Change destination server for agps code

Hi,

I got a nordic thingy:91 and just play a bit with it and the asset_tracker application. Then I flashed the agps code because just want to send GPS coordinates on the server.

Now My question now is:

Is there any way I can send the GPS data to our AWS server? 

If Yes, Can you guide me for the same.

Best Regards,

Rahul Kidecha

  • Hi,

    In order to send the GPS data to another server, you have to change the cloud backend to AWS, and change the endpoint and device ID, as well as any other requirements by AWS. I would recommend taking a look at the Cloud client sample, which shows how to connect to, and communicate with a cloud service using a cloud backend firmware library. This sample supports the AWS IoT library already. In prj.conf in the cloud client sample, you'll find the necessary configurations for AWS under 'AWS IoT'.

    The A-GPS sample uses either nRF Cloud A-GPS feature or an external SUPL client in order to use A-GPS. If you're to use the nRF Cloud A-GPS feature, you would have to be connected to nRF Cloud as well. However, I don't know how well the API can handle two instances simultaneously. Another option is to use SUPL client. You can select the different A-GPS sources in the sample via the CONFIG_AGPS_SRC_SUPL configurable option. 

    Best regards,

    Marte

  • Hi Marte,

    Thank you for your reply.

    But if you could help me with the proper steps it would be grateful. This everything is pretty much new for me.

    Rahul Kidecha

  • Hi,

    I was referring to the cloud client sample and made changes in the AWS IoT library but I don understand what should put in 

    CONFIG_AWS_IOT_SEC_TAG

    please let me know from where i will get Tag value?

    Also while referring to AWS IoT library can you tell me where exactly because i have done changes in prj file.

  • Hi,

    The security tag can be chosen as whatever you want it to be, however, the default security tag 16842753 is reserved for the nRF Cloud. This tag is set when you program the certificates to the on-board modem.

    Have you read the documentation for the AWS IoT library? The simplest way to do this in your project, would probably be to change the example such that you send the A-GPS data (which you get from the external SUPL client) over MQTT to the AWS IoT message broker. How to set up this is described in the documentation for the AWS IoT library, from the part about initializing and out. There's also an AWS IoT sample that shows how to do this as well.

    Best regards,

    Marte

  • HI,

    As mentioned I have made changes in prj file of the cloud client sample. changes are mentioned below:

    1) change the cloud backend to the AWS_IOT

    2) Enable AWS IOT setting and added ID, HOSTNAME and SEC TAG.

    3) Updated the modem certificates.

    after that when build and run the code got below output.

    2020-12-22T22:46:26.583Z INFO Application data folder: C:\Users\rahul\AppData\Roaming\nrfconnect\pc-nrfconnect-linkmonitor
    2020-12-22T22:46:26.608Z DEBUG App pc-nrfconnect-linkmonitor v1.1.10 official
    2020-12-22T22:46:26.608Z DEBUG App path: C:\Users\rahul\.nrfconnect-apps\node_modules\pc-nrfconnect-linkmonitor
    2020-12-22T22:46:26.608Z DEBUG nRFConnect 3.6.1 is supported by the app (^3.6.0)
    2020-12-22T22:46:26.608Z DEBUG nRFConnect path: C:\Users\rahul\AppData\Local\Programs\nrfconnect\resources\app.asar
    2020-12-22T22:46:26.608Z DEBUG HomeDir: C:\Users\rahul
    2020-12-22T22:46:26.608Z DEBUG TmpDir: C:\Users\rahul\AppData\Local\Temp
    2020-12-22T22:46:35.543Z INFO Modem port is opened
    2020-12-22T22:46:35.548Z DEBUG modem >> AT+CFUN?
    2020-12-22T22:46:35.566Z DEBUG modem << +CFUN: 1
    2020-12-22T22:46:35.568Z DEBUG modem << OK
    2020-12-22T22:46:35.581Z DEBUG modem >> AT+CGSN=1
    2020-12-22T22:46:35.592Z DEBUG modem << +CGSN: "352656101080789"
    2020-12-22T22:46:35.594Z DEBUG modem << OK
    2020-12-22T22:46:35.599Z DEBUG modem >> AT+CGMI
    2020-12-22T22:46:35.607Z DEBUG modem << Nordic Semiconductor ASA
    2020-12-22T22:46:35.608Z DEBUG modem << OK
    2020-12-22T22:46:35.613Z DEBUG modem >> AT+CGMM
    2020-12-22T22:46:35.620Z DEBUG modem << nRF9160-SICA
    2020-12-22T22:46:35.621Z DEBUG modem << OK
    2020-12-22T22:46:35.624Z DEBUG modem >> AT+CGMR
    2020-12-22T22:46:35.633Z DEBUG modem << mfw_nrf9160_1.2.0
    2020-12-22T22:46:35.635Z DEBUG modem << OK
    2020-12-22T22:46:35.636Z INFO Nordic Semiconductor ASA nRF9160-SICA [mfw_nrf9160_1.2.0] SerNr: 352656101080789
    2020-12-22T22:46:35.641Z DEBUG modem >> AT+CEMODE?
    2020-12-22T22:46:35.648Z DEBUG modem << +CEMODE: 2
    2020-12-22T22:46:35.650Z DEBUG modem << OK
    2020-12-22T22:46:35.664Z DEBUG modem >> AT%XCBAND=?
    2020-12-22T22:46:35.675Z DEBUG modem << %XCBAND: (1,2,3,4,5,8,12,13,17,18,19,20,25,26,28,66)
    2020-12-22T22:46:35.678Z DEBUG modem << OK
    2020-12-22T22:46:35.688Z DEBUG modem >> AT+CMEE?
    2020-12-22T22:46:35.694Z DEBUG modem << +CMEE: 0
    2020-12-22T22:46:35.696Z DEBUG modem << OK
    2020-12-22T22:46:35.699Z DEBUG modem >> AT+CMEE=1
    2020-12-22T22:46:35.705Z DEBUG modem << OK
    2020-12-22T22:46:35.709Z DEBUG modem >> AT+CNEC?
    2020-12-22T22:46:35.717Z DEBUG modem << +CNEC: 0
    2020-12-22T22:46:35.718Z DEBUG modem << OK
    2020-12-22T22:46:35.721Z DEBUG modem >> AT+CNEC=24
    2020-12-22T22:46:35.726Z DEBUG modem << OK
    2020-12-22T22:46:35.729Z DEBUG modem >> AT+CGEREP?
    2020-12-22T22:46:35.738Z DEBUG modem << +CGEREP: 0,0
    2020-12-22T22:46:35.741Z DEBUG modem << OK
    2020-12-22T22:46:35.745Z DEBUG modem >> AT+CGDCONT?
    2020-12-22T22:46:35.753Z DEBUG modem << +CGDCONT: 0,"IP","","",0,0
    2020-12-22T22:46:35.754Z DEBUG modem << OK
    2020-12-22T22:46:35.763Z DEBUG modem >> AT+CGACT?
    2020-12-22T22:46:35.770Z DEBUG modem << +CGACT: 0,0
    2020-12-22T22:46:35.771Z DEBUG modem << OK
    2020-12-22T22:46:35.775Z DEBUG modem >> AT+CGEREP=1
    2020-12-22T22:46:35.781Z DEBUG modem << OK
    2020-12-22T22:46:35.787Z DEBUG modem >> AT+CIND=1,1,1
    2020-12-22T22:46:35.793Z DEBUG modem << OK
    2020-12-22T22:46:35.797Z DEBUG modem >> AT+CEREG=5
    2020-12-22T22:46:35.803Z DEBUG modem << OK
    2020-12-22T22:46:35.807Z DEBUG modem >> AT+CEREG?
    2020-12-22T22:46:35.818Z DEBUG modem << +CEREG: 5,2,"8402","02066D02",7,0,0,"11100000","11100000"
    2020-12-22T22:46:35.820Z DEBUG modem << OK
    2020-12-22T22:46:35.830Z DEBUG modem >> AT%CESQ=1
    2020-12-22T22:46:35.835Z DEBUG modem << OK
    2020-12-22T22:46:35.839Z DEBUG modem >> AT+CESQ
    2020-12-22T22:46:35.847Z DEBUG modem << +CESQ: 99,99,255,255,8,39
    2020-12-22T22:46:35.848Z DEBUG modem << OK
    2020-12-22T22:46:35.853Z DEBUG modem >> AT%XSIM=1
    2020-12-22T22:46:35.863Z DEBUG modem << OK
    2020-12-22T22:46:35.867Z DEBUG modem >> AT%XSIM?
    2020-12-22T22:46:35.875Z DEBUG modem << %XSIM: 1
    2020-12-22T22:46:35.877Z DEBUG modem << OK
    2020-12-22T22:46:35.888Z DEBUG modem >> AT+CPIN?
    2020-12-22T22:46:35.897Z DEBUG modem << +CPIN: READY
    2020-12-22T22:46:35.898Z DEBUG modem << OK
    2020-12-22T22:46:35.906Z DEBUG modem >> AT+CPINR="SIM PIN"
    2020-12-22T22:46:35.920Z DEBUG modem << +CPINR: "SIM PIN",3
    2020-12-22T22:46:35.921Z DEBUG modem << OK
    2020-12-22T22:46:35.927Z DEBUG modem >> AT+CIMI
    2020-12-22T22:46:35.935Z DEBUG modem << 204080813563573
    2020-12-22T22:46:35.936Z DEBUG modem << OK
    2020-12-22T22:46:35.936Z INFO IMSIdentity: 204080813563573
    2020-12-22T22:46:36.299Z DEBUG modem << +CGEV: ME PDN ACT 0,0
    2020-12-22T22:46:36.302Z DEBUG modem << +CNEC_ESM: 50,0
    2020-12-22T22:46:36.308Z DEBUG modem >> AT+CGDCONT?
    2020-12-22T22:46:36.309Z DEBUG modem << +CEREG: 5,"8402","02066D02",7,,,"11100000","11100000"
    2020-12-22T22:46:36.310Z DEBUG modem << I: Network registration status: Connected - roaming
    2020-12-22T22:46:36.311Z DEBUG modem << I: Connected to LTE network
    2020-12-22T22:46:36.311Z DEBUG modem << I: Connecting to cloud
    2020-12-22T22:46:36.312Z DEBUG modem << I: Next connection retry in 30 seconds
    2020-12-22T22:46:36.313Z DEBUG modem << +CIND: "service",1
    2020-12-22T22:46:36.314Z DEBUG modem << +CIND: "roam",1
    2020-12-22T22:46:36.314Z DEBUG modem << I: CLOUD_EVT_CONNECTING
    2020-12-22T22:46:36.321Z DEBUG modem << +CGDCONT: 0,"IP","ibasis.iot","10.165.46.0",0,0
    2020-12-22T22:46:36.322Z DEBUG modem << OK
    2020-12-22T22:46:36.325Z DEBUG modem >> AT+CGACT?
    2020-12-22T22:46:36.335Z DEBUG modem << +CGACT: 0,1
    2020-12-22T22:46:36.336Z DEBUG modem << OK


    2020-12-22T22:46:36.692Z DEBUG modem << E: mqtt_connect, error: -95
    2020-12-22T22:46:36.693Z DEBUG modem << I: CLOUD_EVT_CONNECTING
    2020-12-22T22:46:39.126Z DEBUG modem << %CESQ: 39,1,3,0
    2020-12-22T22:46:39.726Z DEBUG modem << %CESQ: 34,1,3,0

    If you see the last four lines getting one error and it always stuck at CLOUD_EVT_CONNECTING.

    In the cloud client sample, it displays the message on the nrf cloud terminal. Does the same thing suppose to happen on the AWS cloud?

    But it did not display anything? Do I miss any other setting in prj file or on AWS CLOUD?

Related