<?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>nRF9160 Ethernet and LTE both available but cannot open sockets under Ethernet</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96529/nrf9160-ethernet-and-lte-both-available-but-cannot-open-sockets-under-ethernet</link><description>I&amp;#39;ve got an nRF 9160-dk board I have been able to connect over the LTE using TLS to my own data repository site and to google.com and example.com 
 What I&amp;#39;ve not been able to do is get a connection over the Ethernet to anything. 
 So far I&amp;#39;ve tried: </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 26 Jan 2024 15:11:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96529/nrf9160-ethernet-and-lte-both-available-but-cannot-open-sockets-under-ethernet" /><item><title>RE: nRF9160 Ethernet and LTE both available but cannot open sockets under Ethernet</title><link>https://devzone.nordicsemi.com/thread/466279?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2024 15:11:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:379d6d88-7be4-4fcb-87a6-f8ef6b0545db</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/gildev"&gt;GilDev&lt;/a&gt;&amp;nbsp;,&lt;br /&gt;&lt;br /&gt;We do not have sample that would directly assist you in your implementation effort. I hope that you can find some useful suggestions/ideas in the&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/knutel"&gt;knutel&lt;/a&gt;&amp;nbsp;post.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Ethernet and LTE both available but cannot open sockets under Ethernet</title><link>https://devzone.nordicsemi.com/thread/466166?ContentTypeID=1</link><pubDate>Fri, 26 Jan 2024 09:07:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df52f0cb-ba9d-4753-bc66-b22a54a6cd50</guid><dc:creator>GilDev</dc:creator><description>&lt;p&gt;Thanks a lot for your reply! That really looks like a pain to get everything working together&amp;hellip;&lt;/p&gt;
&lt;p&gt;In my case, I&amp;rsquo;m only enabling one of the interface at a time depending on different factors (SIM inserted? Ethernet link available?). The rest of the time the device sleeps and everything is turned off, so I don&amp;rsquo;t really need the second interface to take over in case packets can&amp;rsquo;t flow through the first one, but of course I still need my sockets opening to use the right (up) one.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m also using the AWS IoT library and also found the socket opening stuff was buried deep, though the issue about managing these two interfaces should probably be handled elsewhere anywhere. I&amp;rsquo;ll try to experiment a bit more and see if I can sort things out&amp;hellip; I really thought all that network interfaces and connectivity manager stuff would help making this easier, but it seems to be aimed only at Wi-Fi and LTE somehow.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Ethernet and LTE both available but cannot open sockets under Ethernet</title><link>https://devzone.nordicsemi.com/thread/466049?ContentTypeID=1</link><pubDate>Thu, 25 Jan 2024 14:32:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed8bec43-c5c1-44dd-bd7a-b95c52b5ab6d</guid><dc:creator>knutel</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note that the below is a terrible hack and is not the &amp;quot;correct&amp;quot; way to do this.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I finally got this working, but not without forking both sdk-zephyr and sdk-nrf. There are at least two issues related to how Zephyr handles multiple network interfaces:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Zephyr does support multiple network interfaces. Choosing which one to use is primarily based on static priority and address family match. It is possible to change to priorities such that either Ethernet or LTE comes first, but whether or not a route towards the destination exists from the chosen interface is not taken into account. This means that if you pull the Ethernet cable or LTE disconnects, packets will not magically start flowing through the other interface.&lt;/li&gt;
&lt;li&gt;Enabling NRF_MODEM_LIB also enables CONFIG_NET_SOCKETS_OFFLOAD and this also offloads DNS to the modem. This means that &lt;code&gt;getaddrinfo()&lt;/code&gt; will fail if LTE is not connected.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There is an additional gotcha: the net shell DNS lookup does not call &lt;code&gt;getaddrinfo()&lt;/code&gt; like your application does. This had me confused for a while.&lt;/p&gt;
&lt;p&gt;It is possible to choose which interface to bind a new socket to, but I was using &lt;code&gt;aws_lib&lt;/code&gt; and the call to create a socket is buried deep within `mqtt` so that did not solve my problem.&lt;/p&gt;
&lt;p&gt;I could not find any official way to solve 1. and 2. What I did in the end was:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Add a flag in &lt;code&gt;zephyr/subsys/net/lib/sockets/socket_dispatcher.c&lt;/code&gt; to tell the dispatcher whether or not to allow using the modem.&lt;/li&gt;
&lt;li&gt;Add the same flag in &lt;code&gt;zephyr/subsys/net/lib/sockets/getaddrinfo.c&lt;/code&gt; to make sure the &lt;code&gt;getaddrinfo()&lt;/code&gt; calls use the modem or Ethernet accordingly.&lt;/li&gt;
&lt;li&gt;Export the function &lt;code&gt;static int nrf91_socket_create(int family, int type, int proto)&lt;/code&gt; from &lt;code&gt;nrf/lib/nrf_modem_lib/nrf91_sockets.c&lt;/code&gt; so that when &lt;code&gt;zephyr/subsys/net/lib/sockets/socket_dispatcher.c&lt;/code&gt; iterates over the interfaces, it can check if it is looking at the modem.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The flag was then used to switch between LTE and Ethernet. A connectivity manager was made to detect if either interface had internet connectivity and switch accordingly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Ethernet and LTE both available but cannot open sockets under Ethernet</title><link>https://devzone.nordicsemi.com/thread/465507?ContentTypeID=1</link><pubDate>Tue, 23 Jan 2024 09:40:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39404459-7fd6-44ec-afdd-3bdd10552001</guid><dc:creator>GilDev</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m having the same issue. Can&amp;rsquo;t get the http_get sample nor the aws-sample to work on my nRF9160DK using the Ethernet controller ENC424J600. DHCPv4 works fine, I can ping fine make DNS lookups through the net shell, but everytime a `getaddrinfo()` is called, I get a -11 error and cannot go any further.&lt;/p&gt;
&lt;p&gt;Also&amp;nbsp;`CONFIG_NET_SOCKETS_OFFLOAD` can&amp;rsquo;t really be disabled as it is required by `CONFIG_LTE_CONNECTIVITY`.&lt;/p&gt;
&lt;p&gt;Any idea on how to proceed? I&amp;rsquo;ve been at it for days at this point. Should the offloading be disabled? Why isn&amp;rsquo;t my DNS server somehow not used by `getaddrinfo()`?&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Ethernet and LTE both available but cannot open sockets under Ethernet</title><link>https://devzone.nordicsemi.com/thread/416222?ContentTypeID=1</link><pubDate>Mon, 20 Mar 2023 10:17:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:faef4991-e45c-4667-8ee0-f2583ab99127</guid><dc:creator>knutel</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/zeitue"&gt;Taylor&lt;/a&gt; Did you make any progress on this? I am also trying to get LTE and Ethernet going in the same firmware, with the exception that I am using the link_board_eth.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Ethernet and LTE both available but cannot open sockets under Ethernet</title><link>https://devzone.nordicsemi.com/thread/410535?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2023 08:34:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b23610f5-1925-4d22-8d3b-5d8e0d89c344</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;OK. You can get back when your other code issues get resolved.&lt;br /&gt;&lt;br /&gt;Best regards,&amp;nbsp;&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Ethernet and LTE both available but cannot open sockets under Ethernet</title><link>https://devzone.nordicsemi.com/thread/410458?ContentTypeID=1</link><pubDate>Thu, 16 Feb 2023 17:39:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a21df31-8e29-41a2-95e3-634a64377e6e</guid><dc:creator>Taylor</dc:creator><description>&lt;p&gt;I seem to have broken my code more when I was trying to get this information, I&amp;#39;ll reply once I get the new issues resolved.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Ethernet and LTE both available but cannot open sockets under Ethernet</title><link>https://devzone.nordicsemi.com/thread/409645?ContentTypeID=1</link><pubDate>Mon, 13 Feb 2023 14:49:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:410807c6-a3a7-4a0b-94b6-f423425c1dc6</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Could you show your setup? How are your devices connected?&lt;/p&gt;
[quote user=""]What I&amp;#39;ve not been able to do is get a connection over the Ethernet to anything.[/quote]
&lt;p&gt;What have you tested? What are the results?&amp;nbsp;&lt;/p&gt;
[quote user=""]&lt;span&gt;which results in me getting&amp;nbsp;&lt;/span&gt;EPROTOTYPE (-107)[/quote]
&lt;p&gt;Could you show the full application log which contains this error?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Ethernet and LTE both available but cannot open sockets under Ethernet</title><link>https://devzone.nordicsemi.com/thread/409402?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2023 16:13:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0d99c09d-2704-4a24-a0d0-41af0836b0ec</guid><dc:creator>Taylor</dc:creator><description>&lt;p&gt;I&amp;#39;m trying to make it where we can use Ethernet or LTE-M&amp;nbsp;to upload data over https. I&amp;#39;ve taken a snapshot of the code and put it on Github:&amp;nbsp;&lt;a id="" href="https://github.com/zeitue/lte-and-ethernet"&gt;https://github.com/zeitue/lte-and-ethernet&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 Ethernet and LTE both available but cannot open sockets under Ethernet</title><link>https://devzone.nordicsemi.com/thread/409381?ContentTypeID=1</link><pubDate>Fri, 10 Feb 2023 14:29:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e924ac99-4840-4210-9d0a-45adc42aa66b</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;Could you provide more information about your setup?&lt;br /&gt;&lt;br /&gt;Could you elaborate on what you try to achieve?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>