http_client network error on thingy91

Hello,

I am trying to use http requests on Thingy91 and therefore I tried with the sample from zephyr/samples/net/sockets/http_client.

I can build the project without any problem but when I try to run it, I get the following error when I open a putty terminal:

I did not change anything in the code, and I was supposing it was not a network problem since I activated my SIM card and I can run the asset_tracker and see the data in nrFcloud without any issue.

I am using the nrfConnectSDK 2.0.0, and the SIM is from twilio.

Best regards,

C

Parents
  • rupcar said:

    I am using Super SIM cards from Twilio.

    Here is the log I get when running the AT Commands:

    Ok thanks, Carole! :-)

    rupcar said:

    I am not sure I understand what to deduce from there ?

    Looking at the provided log, I can see that the modem loses connection to the network quite immediately after it got attached to it.

    2022-07-27T12:13:44.762Z DEBUG modem << +CEREG: 2,"0065","01052508",7 
    
    2022-07-27T12:13:52.386Z DEBUG modem << +CEREG: 5,"0065","01052508",7,,,"11100000","11100000" 
    
    ... 
    
    2022-07-27T12:13:52.463Z DEBUG modem << +CEREG: 2,"0065","01052508",7 
    
    2022-07-27T12:13:53.901Z DEBUG modem << %CESQ: 255,0,255,0 
    
    2022-07-27T12:13:53.906Z DEBUG modem << +CEREG: 2 

    rupcar said:
    the "getAddrInfo() failed" appears half of the time again.

    That could explain the error you are facing. 

    Did you start your Thingy:91 for the first time after a longer shut-down period or has the device been reset/restarted a couple of times before the log was recorded? I ask because this might make a significant difference if the modem performs a cold start or not. 

    Cheers, 

    Markus 

Reply
  • rupcar said:

    I am using Super SIM cards from Twilio.

    Here is the log I get when running the AT Commands:

    Ok thanks, Carole! :-)

    rupcar said:

    I am not sure I understand what to deduce from there ?

    Looking at the provided log, I can see that the modem loses connection to the network quite immediately after it got attached to it.

    2022-07-27T12:13:44.762Z DEBUG modem << +CEREG: 2,"0065","01052508",7 
    
    2022-07-27T12:13:52.386Z DEBUG modem << +CEREG: 5,"0065","01052508",7,,,"11100000","11100000" 
    
    ... 
    
    2022-07-27T12:13:52.463Z DEBUG modem << +CEREG: 2,"0065","01052508",7 
    
    2022-07-27T12:13:53.901Z DEBUG modem << %CESQ: 255,0,255,0 
    
    2022-07-27T12:13:53.906Z DEBUG modem << +CEREG: 2 

    rupcar said:
    the "getAddrInfo() failed" appears half of the time again.

    That could explain the error you are facing. 

    Did you start your Thingy:91 for the first time after a longer shut-down period or has the device been reset/restarted a couple of times before the log was recorded? I ask because this might make a significant difference if the modem performs a cold start or not. 

    Cheers, 

    Markus 

Children
  • Hi again,


    Actually, after a second check, it seems like when I turn it on for the first time, I have the error. If I turn it off and back on again pretty quickly, I still have the error. Though, if after getting the error, I wait a few minutes (it still takes 5-10mn), this is what I get on the log after the error:

    2022-07-28T08:52:22.593Z DEBUG modem << getaddrinfo() failed, err 115
    2022-07-28T08:55:18.391Z DEBUG modem << [00:03:20.319,458] [0m<dbg> lte_lc: at_handler_cereg: +CEREG notification: +CEREG: 0
    2022-07-28T08:55:18.401Z DEBUG modem << [0m
    2022-07-28T08:55:18.408Z DEBUG modem << [00:03:20.319,610] [0m<dbg> lte_lc_helpers: parse_cereg: Network registration status: 0[0m
    2022-07-28T08:55:18.410Z DEBUG modem << [00:03:20.319,641] [0m<dbg> lte_lc_helpers: parse_cereg: LTE mode not found, error code: -22[0m
    2022-07-28T08:55:27.122Z DEBUG modem << [00:03:29.049,224] [0m<dbg> lte_lc: at_handler_cereg: +CEREG notification: +CEREG: 2,"0065","01052508",7
    2022-07-28T08:55:27.126Z DEBUG modem << [0m
    2022-07-28T08:55:27.130Z DEBUG modem << [00:03:29.049,438] [0m<dbg> lte_lc_helpers: parse_cereg: Network registration status: 2[0m
    2022-07-28T08:55:27.141Z DEBUG modem << [00:03:29.049,468] [0m<dbg> lte_lc_helpers: parse_cereg: LTE mode: 7[0m
    2022-07-28T08:55:27.145Z DEBUG modem << [00:03:29.145,599] [0m<dbg> lte_lc: at_handler_cscon: +CSCON notification[0m
    2022-07-28T08:55:35.364Z DEBUG modem << [00:03:37.289,794] [0m<dbg> lte_lc: at_handler_cereg: +CEREG notification: +CEREG: 5,"0065","01052508",7,,,"11100000","11100000"
    2022-07-28T08:55:35.368Z DEBUG modem << [0m
    2022-07-28T08:55:35.373Z DEBUG modem << [00:03:37.290,069] [0m<dbg> lte_lc_helpers: parse_cereg: Network registration status: 5[0m
    2022-07-28T08:55:35.380Z DEBUG modem << [00:03:37.290,100] [0m<dbg> lte_lc_helpers: parse_cereg: LTE mode: 7[0m
    2022-07-28T08:55:39.007Z DEBUG modem << [00:03:40.936,004] [0m<dbg> lte_lc: at_handler_cscon: +CSCON notification[0m
    2022-07-28T08:56:33.788Z DEBUG modem << [00:04:35.726,623] [0m<dbg> lte_lc: at_handler_cscon: +CSCON notification[0m
    2022-07-28T08:56:40.455Z DEBUG modem << [00:04:42.393,218] [0m<dbg> lte_lc: at_handler_cscon: +CSCON notification[0m
    2022-07-28T08:56:41.979Z DEBUG modem << [00:04:43.917,755] [0m<dbg> lte_lc: at_handler_cscon: +CSCON notification[0m
    2022-07-28T08:56:47.976Z DEBUG modem << [00:04:49.913,055] [0m<dbg> lte_lc: at_handler_cscon: +CSCON notification[0m
    

    and then, if I turn it off and back on, it works.

    It seems like the connection takes too long to get stable . It also happens when I used the asset_tracker, it takes a bit of time before it connects and I can see the data on nrfCloud. Do you have any suggestions on where is it coming from and how to manage it ?
    thank you!

    Carole

Related