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

nRF9160 system gets stuck in "getaddrinfo" function

Hi,

I am using NCS v1.1.0 and modem fw 1.1.0.

We had prepared our application in NCS v1.0.0 and now i have moved it to v1.1.0. 

In new sdk v1.1.0 ,When i try to get Address of the server using "getaddrinfo" system gets stuck in that function. 

I debugged it and found that it gets stuck in "nrf_getaddrinfo" function inside "getaddrinfo". 

I found below similar case on developer zone. 

https://devzone.nordicsemi.com/f/nordic-q-a/55840/getaddrinfo-in-can-block-indefinitely-after-lte-connect/226889#226889

As mentioned in the case , I verified the LTE connection. I always call "getaddrinfo" after LTE connection.

Can you help me in resolving this issue ?

Regards,

Smitesh Mali

Parents
  • Hello, 

    We had prepared our application in NCS v1.0.0 and now i have moved it to v1.1.0. 

     Did your application work before moving to v1.1.0? Have you based your application on any of our samples or is this built from ground up?

    In new sdk v1.1.0 ,When i try to get Address of the server using "getaddrinfo" system gets stuck in that function. 

    I debugged it and found that it gets stuck in "nrf_getaddrinfo" function inside "getaddrinfo". 

     Are you getting any error messages? When and where are you calling the function in your application? I will need some more information about the application to be able to help. 

    As mentioned in the case , I verified the LTE connection. I always call "getaddrinfo" after LTE connection.

     And as mentioned by my colleague in that ticket:

    "How is the signal strength where you are testing? If you are certain you are connected to the network, and the signal strength is good could you take a modem trace when getaddrinfo hangs, so that we can analyze further?"

    Thanks!

    Kind regards,
    Øyvind

  • Did your application work before moving to v1.1.0? Have you based your application on any of our samples or is this built from ground up?

    Yes, my application was working before moving to 1.1.0. My application is based on "http application update" sample example. 

    Are you getting any error messages? When and where are you calling the function in your application? I will need some more information about the application to be able to help.

    No i am not getting any error message. It just gets stuck inside "nrf_getaddrinfo" function. I am calling "getaddrinfo" function after modem connects with network. There is delay of 1 second after connecting with network.  

    "How is the signal strength where you are testing? If you are certain you are connected to the network, and the signal strength is good could you take a modem trace when getaddrinfo hangs, so that we can analyze further?"

    I will try to tell you signal strength tomorrow. But there doesn't seem to be issue of signal strength as if i run "mqtt_sample" example in same hardware then i get address from "getaddrinfo" and also connecting with server without issue. 

    Regards,

    Smitesh Mali

  • Hi,

    Following is the RSSI response 

    CESQ = +CESQ: 99,99,255,255,24,65.

    Please refer above thread for rest of the answers. 

    Regards,

    Smitesh Mali

  • Hi,

    I have just found the solution to this problem. 

    We have "connect_to_provision" function in which "getaddrinfo" function is being called.

    We call "connect_to_provision" through "k_work_submit(&connect_to_provision_work)".

    I removed calling "connect_to_provision" function through "k_work_submit" and called it directly.

    After that system doesn't get stuck in "getaddrinfo" function. 

    Calling "connect_to_provision" through "k_work_submit" was working with NCS v1.0.0. 

    Can you tell me why same thing is not working with NCS v1.1.0 ?

    Regards,

    Smitesh Mali

Reply
  • Hi,

    I have just found the solution to this problem. 

    We have "connect_to_provision" function in which "getaddrinfo" function is being called.

    We call "connect_to_provision" through "k_work_submit(&connect_to_provision_work)".

    I removed calling "connect_to_provision" function through "k_work_submit" and called it directly.

    After that system doesn't get stuck in "getaddrinfo" function. 

    Calling "connect_to_provision" through "k_work_submit" was working with NCS v1.0.0. 

    Can you tell me why same thing is not working with NCS v1.1.0 ?

    Regards,

    Smitesh Mali

Children
Related