<?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 switch between LTE-M and Ethernet</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66035/nrf9160-switch-between-lte-m-and-ethernet</link><description>Hi, 
 On our custom nRF9160 board we also have an ethernet interface. 
 We would like to be able to choose which interface should be used when a socket is created. 
 I am a little confused what the CONFIG_NET_SOCKETS_OFFLOAD does exactly, but I believe</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Feb 2024 13:20:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66035/nrf9160-switch-between-lte-m-and-ethernet" /><item><title>RE: nRF9160 switch between LTE-M and Ethernet</title><link>https://devzone.nordicsemi.com/thread/467379?ContentTypeID=1</link><pubDate>Fri, 02 Feb 2024 13:20:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a974ca72-ac00-4db7-b20e-7b438bed652c</guid><dc:creator>GilDev</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have you had any success with this? It seems like Zephyr has &lt;a href="https://docs.zephyrproject.org/latest/connectivity/networking/api/sockets.html#dealing-with-multiple-offloaded-interfaces"&gt;a socket dispatcher system&lt;/a&gt; that could help. I&amp;rsquo;m currently trying to achieve the same thing as you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 switch between LTE-M and Ethernet</title><link>https://devzone.nordicsemi.com/thread/270852?ContentTypeID=1</link><pubDate>Tue, 22 Sep 2020 12:54:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4ad3d59-2443-43d7-ba08-72755a934451</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;
[quote user=""]I am a little confused what the &lt;a title="CONFIG_NET_SOCKETS_OFFLOAD" href="https://docs.zephyrproject.org/latest/reference/kconfig/CONFIG_NET_SOCKETS_OFFLOAD.html" rel="noopener noreferrer" target="_blank"&gt;CONFIG_NET_SOCKETS_OFFLOAD&lt;/a&gt; does exactly, but I believe this disables the option to switch the interfaces at runtime, because the socket data is not going through the Zephyr stack, but instead is forwarded straight to the LTE-M modem.[/quote]
&lt;p&gt;&amp;nbsp;This offloads the NET stack, specifically wrt. to socket calls (send/recv/socket/poll etc). In the case of nRF9160, it routes the nrf_socket calls to zephyr&amp;#39;s API, which is done in the nrf91_sockets.c file:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/master/lib/bsdlib/nrf91_sockets.c"&gt;https://github.com/nrfconnect/sdk-nrf/blob/master/lib/bsdlib/nrf91_sockets.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Is this correct? How can we accomplish choosing which network interface (LTE-M vs. Ethernet) to use at run-time, when creating sockets?[/quote]
&lt;p&gt;I&amp;#39;m not sure its currently possible. But, didn&amp;#39;t you ask this specific question in this thread as well?&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/65943/socket-manager"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/65943/socket-manager&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It&amp;nbsp;isn&amp;#39;t currently&amp;nbsp;easy/possible to dynamically switch between two socket implementations as of now. If you ask in the zephyr mailing-list (or on their slack), you might get a bit more in-depth answer, as the developers there might have future insight on what is planned.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>