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,

    Error -95 is EUPNOTSUPP, which is "operation not supported on transport endpoint", and from your log I can see that you're able to connect to the network, but not to AWS cloud. Are your certificates and your sec tag correct, are they the same as for your device on AWS IoT? You check out creating a thing in AWS IoT.

    Please be aware that we have reduced staff due to holiday season, so response time might be slower than normal.

    Best regards,

    Marte

  • Hi,

    Please be aware that we have reduced staff due to holiday season, so response time might be slower than normal.

    I can understand and really appreciate your effort.

    I checked the AWS_IOT sample code which is intended to connect the aws_IOT cloud and display the messages. we have made the changes mentioned in Readme file. We added the certificate and sec tag too.

    After the changes, we load the code and checked on the link monitor.please check Below:


    2020-12-25T02:48:20.900Z DEBUG modem >> AT%CMNG=0,201,0,"MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\n
    2020-12-25T02:48:20.915Z DEBUG modem >> ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\n
    2020-12-25T02:48:20.930Z DEBUG modem >> b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\n
    2020-12-25T02:48:20.951Z DEBUG modem >> MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\n
    2020-12-25T02:48:20.967Z DEBUG modem >> b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\n
    2020-12-25T02:48:20.994Z DEBUG modem >> ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\n
    2020-12-25T02:48:21.009Z DEBUG modem >> 9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\n
    2020-12-25T02:48:21.024Z DEBUG modem >> IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\n
    2020-12-25T02:48:21.040Z DEBUG modem >> VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\n
    2020-12-25T02:48:21.057Z DEBUG modem >> 93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\n
    2020-12-25T02:48:21.073Z DEBUG modem >> jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\n
    2020-12-25T02:48:21.092Z DEBUG modem >> AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\n
    2020-12-25T02:48:21.108Z DEBUG modem >> A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\n
    2020-12-25T02:48:21.125Z DEBUG modem >> U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\n
    2020-12-25T02:48:21.142Z DEBUG modem >> N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\n
    2020-12-25T02:48:21.229Z DEBUG modem >> o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\n
    2020-12-25T02:48:21.243Z DEBUG modem >> 5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\n
    2020-12-25T02:48:21.258Z DEBUG modem >> rqXRfboQnoZsG4q5WTP468SQvvG5\n"
    2020-12-25T02:48:21.437Z DEBUG modem << OK
    2020-12-25T02:48:21.441Z INFO Updating client certificate...
    2020-12-25T02:48:21.442Z DEBUG modem >> AT%CMNG=0,201,1,"MIIDWTCCAkGgAwIBAgIUfmLe0K7GkGsVXcvC0xcXgvrrEkIwDQYJKoZIhvcNAQEL\n
    2020-12-25T02:48:21.461Z DEBUG modem >> BQAwTTFLMEkGA1UECwxCQW1hem9uIFdlYiBTZXJ2aWNlcyBPPUFtYXpvbi5jb20g\n
    2020-12-25T02:48:21.477Z DEBUG modem >> SW5jLiBMPVNlYXR0bGUgU1Q9V2FzaGluZ3RvbiBDPVVTMB4XDTIwMTIyNDAzNDk0\n
    2020-12-25T02:48:21.494Z DEBUG modem >> OVoXDTQ5MTIzMTIzNTk1OVowHjEcMBoGA1UEAwwTQVdTIElvVCBDZXJ0aWZpY2F0\n
    2020-12-25T02:48:21.510Z DEBUG modem >> ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALz732T+tCgER2y5nn21\n
    2020-12-25T02:48:21.526Z DEBUG modem >> 0Pk+O6cXYy9yOGv0kL5oJkTQ4YLPFAlHgr8KrXW/v1JGgT6NirsuhQZX8G7IXet2\n
    2020-12-25T02:48:21.549Z DEBUG modem >> q7ygMa5kW39vzwVSA6ThmZGV7ffGh4f/tIQ4y94BUf2ZSAYLXiXzItUnKWoeEhH2\n
    2020-12-25T02:48:21.564Z DEBUG modem >> /7GaJpDkjJ+loFdRoJaYiwuhD5izE2pGRgMORaOHj3PS9bCaLjY6YXBMm9Js13XL\n
    2020-12-25T02:48:21.577Z DEBUG modem >> m6U6tIbTqav3XQbYXouW0161eT7CbBJQftJus/4ZPNqJzyuIOTmDh1yvlf2ohz3P\n
    2020-12-25T02:48:21.594Z DEBUG modem >> QCX0CB7IKCFwSEPrIPPOOESCdT+p19tfhZS3K/UCHL0MOskM7r1iXeMquMfQGre5\n
    2020-12-25T02:48:21.611Z DEBUG modem >> qSkCAwEAAaNgMF4wHwYDVR0jBBgwFoAUgjvxMWwRS5zRp5CsMtNiIehI8P4wHQYD\n
    2020-12-25T02:48:21.704Z DEBUG modem >> VR0OBBYEFKkkABIKWFw3Ed1YTSkMu4qAUrFaMAwGA1UdEwEB/wQCMAAwDgYDVR0P\n
    2020-12-25T02:48:21.720Z DEBUG modem >> AQH/BAQDAgeAMA0GCSqGSIb3DQEBCwUAA4IBAQBKlYnhzpfzw+Fo2avO81llZFXq\n
    2020-12-25T02:48:21.737Z DEBUG modem >> cfpl5/GBwXtpJtFAHXShUpk4sxmsKP7pTdkMNhOPmZ5fSGbN7eV63ZJ0v7dwAgFz\n
    2020-12-25T02:48:21.753Z DEBUG modem >> OJ9mVTQh/RIA+I0w3x5JO+/oXCjWuGScURa4bhTXAL3L+VZ4HGjKrygRgfpMANTh\n
    2020-12-25T02:48:21.772Z DEBUG modem >> 3svwXpBvx5Uq11Sip8Fda9Av1JJbZLkz4WCD7Y3dXHpcP2GdCWkilpOzqM+mOCv7\n
    2020-12-25T02:48:21.787Z DEBUG modem >> quYiK6l91h6OQO8PWRF9k0nr8DUfT4JRSZ+mbgBVyBMBi3l8/0+dPFqhTQdr5fgP\n
    2020-12-25T02:48:21.804Z DEBUG modem >> 7kMBp9BRpTMtNwXktDgdySxOsPgczEb41aaUtVfFBc4nc1I+XDIWIK2Na3il\n"
    2020-12-25T02:48:21.978Z DEBUG modem << OK
    2020-12-25T02:48:21.979Z INFO Updating private key...
    2020-12-25T02:48:21.981Z DEBUG modem >> AT%CMNG=0,201,2,"MIIEowIBAAKCAQEAvPvfZP60KARHbLmefbXQ+T47pxdjL3I4a/SQvmgmRNDhgs8U\n
    2020-12-25T02:48:21.992Z DEBUG modem >> CUeCvwqtdb+/UkaBPo2Kuy6FBlfwbshd63arvKAxrmRbf2/PBVIDpOGZkZXt98aH\n
    2020-12-25T02:48:22.006Z DEBUG modem >> h/+0hDjL3gFR/ZlIBgteJfMi1Scpah4SEfb/sZomkOSMn6WgV1GglpiLC6EPmLMT\n
    2020-12-25T02:48:22.020Z DEBUG modem >> akZGAw5Fo4ePc9L1sJouNjphcEyb0mzXdcubpTq0htOpq/ddBthei5bTXrV5PsJs\n
    2020-12-25T02:48:22.033Z DEBUG modem >> ElB+0m6z/hk82onPK4g5OYOHXK+V/aiHPc9AJfQIHsgoIXBIQ+sg8844RIJ1P6nX\n
    2020-12-25T02:48:22.051Z DEBUG modem >> 21+FlLcr9QIcvQw6yQzuvWJd4yq4x9Aat7mpKQIDAQABAoIBAQCD904z9DhRiUtm\n
    2020-12-25T02:48:22.069Z DEBUG modem >> /OdT2Van9XEqaQZ150jG+ezpSUkP3Nzcv0W6hRkj1ozyIIe1KE6wI56wvvddSqM2\n
    2020-12-25T02:48:22.160Z DEBUG modem >> eOw8tI2QFj0bDjFmd+kUSgUJahAWvZ+C2jtiGIkxm4eg60MZ16OXtPB1h6bXOZWN\n
    2020-12-25T02:48:22.178Z DEBUG modem >> 6JmtudErb/1mSHJ6OOoSj4mYH8VYxFdkRU9TbHLg7nqNDiSeIBQn051B95UZqL01\n
    2020-12-25T02:48:22.193Z DEBUG modem >> jXYEhmZ+aMXYmwuI74OK4O9RJTKMyMyecQ9rbsviud9qq9oj59WRrfs+VmcSLCYN\n
    2020-12-25T02:48:22.209Z DEBUG modem >> hyAaV/lBhHzn4hsrcC/RgNubs/EYYKkPEvWA9NHOiGYnJEYS5rFqfZ4GKHjXrkdx\n
    2020-12-25T02:48:22.225Z DEBUG modem >> zFeINphRAoGBAOyAkN3Wq1Ne9w9sxZl6jXnJxyZ7cT3dTYJWqa7P+OGtVLChLK4x\n
    2020-12-25T02:48:22.241Z DEBUG modem >> NDlAQr2RJQxxN+IbMYXV/XiUNJYZgObx0uPr5MUuq13SXdown3KxmJBY7y9MpcP9\n
    2020-12-25T02:48:22.258Z DEBUG modem >> pe6/+GkPo9lZZS3XDX4zuwxqGJgO7f6U7sESx4kKERAeB5V+GcroUJqXAoGBAMyQ\n
    2020-12-25T02:48:22.275Z DEBUG modem >> a9mQUTrAAgZgmKVgBD8Em44KurCC9xhrQaxW/chfrlIdXNnZWXqrX31jrKBz7V8R\n
    2020-12-25T02:48:22.292Z DEBUG modem >> 24ME6OaBgDUu13Pqic0lFMItKNGUDpr3aIxRAdZvbyPjnYHkC7aQ/UX++V0U8nGi\n
    2020-12-25T02:48:22.313Z DEBUG modem >> DInf+K4LNsupVmNB4zrUaqCjpAKFFKSvnLTgwxI/AoGAEPBsb9cuUjxdCbfKt2F1\n
    2020-12-25T02:48:22.332Z DEBUG modem >> vKFdKD5zL/En2gwG/0RaGR/nDvecUaWojekyXo2Ez81UKVe1Rla7XuWOlqmg9+me\n
    2020-12-25T02:48:22.349Z DEBUG modem >> J0EAE7dyArhMjJIq+XYK7VvRVdvxi4YhWmZZjnzWSX0DqDLc/osJ/Kuks09ucGuO\n
    2020-12-25T02:48:22.367Z DEBUG modem >> ZjnIHOKhsjvUYzqy8juNemUCgYBZZUO8cDUPV5mK7+vFWZCBeaIBEO9E8/bH1Rd+\n
    2020-12-25T02:48:22.383Z DEBUG modem >> GQYO6sFjYTGSgkl4Miwov8ZQ2FiDk2o6d4rQMQe2NiIxpe1SmUHZGaMc83bugfBO\n
    2020-12-25T02:48:22.399Z DEBUG modem >> YZhL/aa0KGRMvzvfLL2COUsAQocw4YBZQGeMp5nqprX56nFC5FE0ok6qSz4aOiRh\n
    2020-12-25T02:48:22.417Z DEBUG modem >> Z1fYQQKBgF2XX/ZJ+1/r1KU/KgSs84TLTUx4nkB3PNkDCYeOw8C02crlOUP4Eyhc\n
    2020-12-25T02:48:22.435Z DEBUG modem >> ZvjXRyEzp7JOoKWn8xFCDPt0yD+XqEC8LPI/YmmdZTwmY9L9p4g4eK8ODJrA83aU\n
    2020-12-25T02:48:22.449Z DEBUG modem >> w6FHJu04l36nM8A+tsLzg7WDwo1n4OcHjC0WRGzfVN0D2OB/86PN\n"
    2020-12-25T02:48:24.091Z DEBUG modem << OK
    2020-12-25T02:48:24.094Z INFO Certificate update completed
    2020-12-25T02:48:39.950Z DEBUG modem << Next connection retry in 30 seconds
    2020-12-25T02:48:39.954Z DEBUG modem << AWS_IOT_EVT_CONNECTING


    2020-12-25T02:48:40.023Z DEBUG modem << E: getaddrinfo, error -11
    2020-12-25T02:48:40.026Z DEBUG modem << E: client_broker_init, error: -10
    2020-12-25T02:48:40.029Z DEBUG modem << E: mqtt_connect, error: -22
    2020-12-25T02:48:40.032Z DEBUG modem << AWS_IOT_EVT_CONNECTING

    Now I am getting above error. And got stuck.

    Do I need to do any other changes to the main.c file or any prj file except you mentioned in Readme file?

  • Hi,

    mqtt_connect error -22 indicates that you're not able to connect to the AWS IoT broker.

    Which version of NCS are you using?

    Rkidechaa said:
    Do I need to do any other changes to the main.c file or any prj file except you mentioned in Readme file?

    You have to complete the steps in the setup, like setting up an AWS account and a connection to AWS IoT. Besides this, you shouldn't have to make any changes to the files except the ones mentioned (CONFIG_AWS_IOT_BROKER_HOST_NAMECONFIG_AWS_IOT_SEC_TAG, and CONFIG_AWS_IOT_CLIENT_ID_STATIC to reflect the values retrieved when setting up the AWS account).

    The sample might require increasing the values of CONFIG_AWS_IOT_MQTT_RX_TX_BUFFER_LEN and CONFIG_AWS_IOT_MQTT_PAYLOAD_BUFFER_LEN, but I don't see how this will affect the initial connection to the broker.

    Which version of the modem firmware are you using? You can find newer versions here.

    Could you provide a modem trace showing the problem?

    Best regards,

    Marte

  • Hi,

    Finally, I successfully connected to my own AWS cloud server using AWS_IOT sample code.

    Now, what needs to be changed in AGPS code to send the data to the AWS cloud. will do configuration setting for AWS IOT

    what else?

    Do i need to enable CONFIG_AGPS_SRC_SUPL in prj file?

  • Hi,

    Great to hear that you successfully connected to the server now!
    Yes, you have to enable AGPS_SRC_SUPL in order to use an external SUPL client for A-GPS. The A-GPS data can be sent to your ASW cloud server using MQTT as in the AWS IoT sample.

    Best regards,

    Marte

Related