<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Basic http get example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58556/basic-http-get-example</link><description>Hello, 
 
 We are working with the nrf 9160 dk. 
 
 We need to use internet connectivity to send an http get and post to a remote server. 
 
 We want to utilize the NB-IoT modem on the board. 
 
 As it stands now, can get connected to the network but</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 04 Mar 2020 07:43:44 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58556/basic-http-get-example" /><item><title>RE: Basic http get example</title><link>https://devzone.nordicsemi.com/thread/237927?ContentTypeID=1</link><pubDate>Wed, 04 Mar 2020 07:43:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e300d916-00c1-4648-9bb2-2a7cc2456780</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="smauelGIS"]and its working with a resolved ip for google.[/quote]
&lt;p&gt;That is great to hear!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Basic http get example</title><link>https://devzone.nordicsemi.com/thread/237849?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 15:50:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a613522f-c922-4f9d-882b-0611b86bfa58</guid><dc:creator>smauelGIS</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We utlized the project below;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/http"&gt;https://github.com/Rallare/fw-nrfconnect-nrf/tree/nrf9160_samples/samples/nrf9160/http&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;and its working with a resolved ip for google.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks so much for your help&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Basic http get example</title><link>https://devzone.nordicsemi.com/thread/237788?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 13:53:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59448e3b-df72-4220-9788-e72e85ba1873</guid><dc:creator>smauelGIS</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for the reponse again!&lt;/p&gt;
&lt;p&gt;I tried the UDP sample you shared, below is the results;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.1.99-ncs1  ***
getaddrinfo err: 0
client_fd: 2
bind err: 0
sendto ret: 48&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Do you think it may be the sim? We are using a sim from iBasis with ICCID&lt;/p&gt;
&lt;p&gt;&lt;span&gt;893108001907353225&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kindly let us know.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Basic http get example</title><link>https://devzone.nordicsemi.com/thread/237729?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 12:34:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:407e8f43-fa70-4b8e-b2ae-e1f03a073931</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The AT commands do not include any IP related commands, unfortunately. UDP and TCP tests must be performed on a socket level.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Basic http get example</title><link>https://devzone.nordicsemi.com/thread/237708?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 12:01:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f1842f7-c030-466b-8837-d1a60a174279</guid><dc:creator>smauelGIS</dc:creator><description>[quote userid="2115" url="~/f/nordic-q-a/58556/basic-http-get-example/237702"]Have you tested if TCP works at all in your current network?[/quote]
&lt;p&gt;could you provide may be an AT command to test a TCP connection? I tried to get an AT command for a ping, but i could not find one at the reference site.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;the mqtt_sample even with the resolved IP does not work.&lt;/p&gt;
&lt;p&gt;I will try the UDP sample you sent.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and Regards.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;P.S kindly help with a tool to check if TCP works on a network.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Basic http get example</title><link>https://devzone.nordicsemi.com/thread/237702?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 11:47:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09bdaf56-3b50-48b0-8ae1-a9584c2f07ad</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tested setting the same IP in https_client sample, and had no problems connecting afterwards. However; I am on a completely different network than you.&lt;/p&gt;
[quote user="smauelGIS"]Please is there another config we need to do? Or a hardware plug we need to push?[/quote]
&lt;p&gt;The behavior you see is highly likely&amp;nbsp;inherited from the network that you are connecting to.&lt;/p&gt;
&lt;p&gt;Have you tested if TCP works at all in your current network?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Did you try mqtt_simple, where you set the IP manually in prj.conf? mqtt.eclipse.org currently resolves to&amp;nbsp;137.135.83.217, so that would be:&lt;/p&gt;
&lt;p&gt;CONFIG_MQTT_BROKER_HOSTNAME=&amp;quot;&lt;span&gt;137.135.83.217&lt;/span&gt;&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If that fails, try an UDP based sample, like this one (Change define NTP_HOST to 129.240.2.6):&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/Rallare/fw-nrfconnect-nrf/blob/nrf9160_samples/samples/nrf9160/ntp/src/main.c"&gt;https://github.com/Rallare/fw-nrfconnect-nrf/blob/nrf9160_samples/samples/nrf9160/ntp/src/main.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Basic http get example</title><link>https://devzone.nordicsemi.com/thread/237684?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 10:28:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2701418-1b34-4355-97e9-402b474475b3</guid><dc:creator>smauelGIS</dc:creator><description>&lt;p&gt;Thanks for the response;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So when we do my the manual resolving as you suggested; for example for google.com (&amp;quot;216.58.208.174&amp;quot;), getaddinfo() is ok, but we still get stuck at connect(), with an error &amp;quot;connect() failed, err: 60&amp;quot;.&lt;/p&gt;
&lt;p&gt;As you may note, this was the first error I sent to you at the start of this thread! We did manual resolving of google&amp;#39;s hostname.&lt;/p&gt;
&lt;p&gt;Please is there another config we need to do? Or a hardware plug we need to push?&lt;/p&gt;
&lt;p&gt;Kindly help&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Basic http get example</title><link>https://devzone.nordicsemi.com/thread/237678?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 10:11:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6556818-58ef-4f62-bd9e-e9297b36ce63</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user="smauelGIS"]Did you use &lt;span&gt;CONFIG_LTE_NETWORK_MODE_NBIOT&lt;/span&gt;&lt;span&gt;=y for the test with NB1?&lt;/span&gt;[/quote]
&lt;p&gt;Yes, I tested with this config entry.&lt;/p&gt;
[quote user="smauelGIS"]It still hangs infact at&amp;nbsp;getaddrinfo() procedure. we get an error code 60.[/quote]
&lt;p&gt;This indicates that the network you&amp;#39;re connected to does not provide a DNS service (getaddrinfo cannot resolve the hostname), or that its currently unavailable.&lt;/p&gt;
&lt;p&gt;You can manually resolve the hostname at your end, and input that as a string, like this &amp;quot;127.0.0.1&amp;quot;.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Basic http get example</title><link>https://devzone.nordicsemi.com/thread/237670?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 09:57:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:568057ec-2398-49ac-9e57-f5d1eff78e89</guid><dc:creator>smauelGIS</dc:creator><description>&lt;p&gt;kindly,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Did you use &lt;span&gt;CONFIG_LTE_NETWORK_MODE_NBIOT&lt;/span&gt;&lt;span&gt;=y for the test with NB1?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;We need to know if we are using the correct configuration.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Basic http get example</title><link>https://devzone.nordicsemi.com/thread/237665?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 09:49:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23379d5d-b872-4ac5-ba8b-23651b6b4f4b</guid><dc:creator>smauelGIS</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;We tried the sample the whole day yesterday and this morning. It still hangs infact at&amp;nbsp;getaddrinfo() procedure. we get an error code 60.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;None of the other samples are also running, they all hang!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please is there something else we need to do?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kindly note that we are Italy, Siracusa precisely.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks and regards&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Basic http get example</title><link>https://devzone.nordicsemi.com/thread/237653?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 09:25:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39ad69ec-e9fa-4aa2-8fcb-7b0f536ca83e</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I tested the sample with NB1 and M1, and it runs as it should at my end:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.1.99-ncs1  ***
HTTPS client sample started
Provisioning certificate
Waiting for network.. OK
Connecting to google.com
Sent 64 bytes
Received 903 bytes

&amp;gt;        HTTP/1.1 200 OK

Finished, closing socket.
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Do other samples also behave like this? Ie: Can you try to run mqtt_simple and see if it also hangs in the connect() procedure?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Basic http get example</title><link>https://devzone.nordicsemi.com/thread/237525?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 15:45:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a83519b5-e56e-4e65-804f-ab9f11237758</guid><dc:creator>smauelGIS</dc:creator><description>&lt;p&gt;Hello Hakon,&lt;/p&gt;
&lt;p&gt;Thank you so much for the reply.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please find below the results we get;&lt;/p&gt;
&lt;p&gt;errno = 60&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;HTTPS client sample started
Provisioning certificate
Waiting for network.. OK
Connecting to google.com
connect() failed, err: 60&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please note that we are in siracusa Italy so we only have NB-IoT, we therefore added the config&amp;nbsp;&lt;/p&gt;
&lt;p&gt;CONFIG_LTE_NETWORK_MODE_NBIOT_GPS=y&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;to the prj.conf file.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Kindly help us know what we need to check&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Basic http get example</title><link>https://devzone.nordicsemi.com/thread/237391?ContentTypeID=1</link><pubDate>Mon, 02 Mar 2020 11:02:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:38ba9fab-69f2-4fa3-9354-9727b71af67e</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s a https sample in ncs that might be helpful:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/NordicPlayground/fw-nrfconnect-nrf/tree/master/samples/nrf9160/https_client"&gt;https://github.com/NordicPlayground/fw-nrfconnect-nrf/tree/master/samples/nrf9160/https_client&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you try this and see if this fits your needs?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>