<?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 ping event with AWS IoT</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/104637/nrf9160-ping-event-with-aws-iot</link><description>How does the device catch incoming ping events? 
 The device uses AWS IoT library, so it can&amp;#39;t open a raw socket. 
 It looks like the ping events closed inside the modem binary. 
 So, this code does not run. 
 /opt/nordic/ncs/v2.0.2/zephyr/subsys/net</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 30 Oct 2023 08:48:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/104637/nrf9160-ping-event-with-aws-iot" /><item><title>RE: nRF9160 ping event with AWS IoT</title><link>https://devzone.nordicsemi.com/thread/452941?ContentTypeID=1</link><pubDate>Mon, 30 Oct 2023 08:48:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5037ce5-a77e-4da3-a113-6da4c7aaec89</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="ksksue"]Ping events from the server are typically processed within the modem firmware, and the application side cannot catch these events.[/quote]
&lt;p&gt;Application can handle ICMP only if opening a SOCK_RAW type socket.&lt;/p&gt;
[quote user="ksksue"]Ping events from the server can be captured by opening a raw socket. However, it is not possible to simultaneously capture events with AWS IoT and pings from the server.[/quote]
&lt;p&gt;Yes, this is correct. A SOCK_RAW type socket cannot operate simultaneously as other sockets on&amp;nbsp;one specific PDN.&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: nRF9160 ping event with AWS IoT</title><link>https://devzone.nordicsemi.com/thread/452396?ContentTypeID=1</link><pubDate>Thu, 26 Oct 2023 02:05:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0574bac-8898-4a49-b45e-babf4897e2b9</guid><dc:creator>ksksue</dc:creator><description>&lt;p&gt;Thank you for your consideration.&lt;br /&gt;Having seen your post, this is my understanding:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ping events from the server are typically processed within the modem firmware, and the application side cannot catch these events.&lt;/li&gt;
&lt;li&gt;Ping events from the server can be captured by opening a raw socket. However, it is not possible to simultaneously capture events with AWS IoT and pings from the server.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 ping event with AWS IoT</title><link>https://devzone.nordicsemi.com/thread/451292?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2023 12:05:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b2f7198e-96ac-4906-89c9-c72721d64dd7</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you so much for your patience.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When opening a SOCK_RAW type socket, there&amp;#39;s restrictions that apply. Mainly, you have two options:&lt;/p&gt;
&lt;p&gt;* Open the SOCK_RAW on a&amp;nbsp;dedicated PDN&lt;/p&gt;
&lt;p&gt;or:&lt;/p&gt;
&lt;p&gt;* Keep all other sockets closed while the raw socket (SOCK_RAW type) is open.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;My apologies that these undocumented restrictions apply to this type of socket.&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: nRF9160 ping event with AWS IoT</title><link>https://devzone.nordicsemi.com/thread/450614?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2023 14:15:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8275c95e-9f8e-4fb8-be7c-95ee031088bc</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;Thank you for the detailed description.&lt;/p&gt;
&lt;p&gt;I was able to reproduce this scenario locally, and I&amp;#39;m awaiting response from R&amp;amp;D to look deeper into what the behavior is in this specific case.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I will update you as soon as I have new information,&amp;nbsp;usually after approx. 2 business days.&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: nRF9160 ping event with AWS IoT</title><link>https://devzone.nordicsemi.com/thread/450145?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2023 18:27:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9de8c706-6cf7-4289-b124-793c1f751648</guid><dc:creator>ksksue</dc:creator><description>&lt;p&gt;Thanks for the idea.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I try this.&lt;/p&gt;
&lt;p&gt;&amp;gt; ICMP reply is handled in slm via a raw socket type:&lt;/p&gt;
&lt;p&gt;&amp;gt;&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.4.99-dev2/applications/serial_lte_modem/src/slm_at_icmp.c#L297-L345"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.4.99-dev2/applications/serial_lte_modem/src/slm_at_icmp.c#L297-L345&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;But unfortunately, the results did not turn out as expected.&lt;br /&gt;I try to rewrote the code from sample/aws_iot.&lt;br /&gt;&lt;a href="https://github.com/ksksue/aws_iot_raw_socket/blob/8872d0894aaa9e67ae22f1ac448ab30a6144d2ec/src/main.c#L479-L655"&gt;https://github.com/ksksue/aws_iot_raw_socket/blob/8872d0894aaa9e67ae22f1ac448ab30a6144d2ec/src/main.c#L479-L655&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If raw socket open (call wan_socket_open), I can get ICMP packet. but, I cannot connect AWS IoT.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;AWS_IOT_EVT_CONNECTING
...
D:     src xxx.xxx.xxx.xxx, dst xxx.xxx.xxx.xxx
D:   ICMP(8) type 8, code 0, csum 0x910f, id 51, seq 
...
(not AWS_IOT_EVT_CONNECTED)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If connecting AWS IoT (comment out wan_socket_open()), I can&amp;#39;t get ICMP packet.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How&amp;nbsp; to&amp;nbsp;catch incoming ping events with connecting AWS IoT?&lt;/p&gt;
&lt;div id="gtx-trans" style="left:126px;position:absolute;top:407px;"&gt;
&lt;div class="gtx-trans-icon"&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 ping event with AWS IoT</title><link>https://devzone.nordicsemi.com/thread/450124?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2023 15:45:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bce2d82-822f-4dc7-b771-e9670a0e0840</guid><dc:creator>ksksue</dc:creator><description>&lt;p&gt;I think that the SDK can&amp;#39;t use both AWS IoT library and raw socket.&lt;br /&gt;Is this&amp;nbsp;correct or incorrect?&lt;/p&gt;
&lt;p&gt;If incorrect, I try this.&lt;/p&gt;
&lt;p&gt;&amp;gt; ICMP reply is handled in slm via a raw socket type:&lt;br /&gt;&amp;gt;&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.4.99-dev2/applications/serial_lte_modem/src/slm_at_icmp.c#L297-L345"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.4.99-dev2/applications/serial_lte_modem/src/slm_at_icmp.c#L297-L345&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t want to dump the IP trace.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 ping event with AWS IoT</title><link>https://devzone.nordicsemi.com/thread/450108?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2023 14:59:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a367c23d-80d9-46af-929e-d7ab0b4ed239</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&amp;#39;m uncertain about what you&amp;#39;re asking about in this case.&lt;/p&gt;
&lt;p&gt;Are you asking about ICMP in the generic LTE Network?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Or do you want to dump the IP trace?&lt;/p&gt;
&lt;p&gt;If yes, then you can do this by enabling modem traces and using this tool (+ Wireshark):&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/ug_cellular_monitor/UG/cellular_monitor/intro.html?cp=11_3_1"&gt;https://infocenter.nordicsemi.com/topic/ug_cellular_monitor/UG/cellular_monitor/intro.html?cp=11_3_1&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: nRF9160 ping event with AWS IoT</title><link>https://devzone.nordicsemi.com/thread/450099?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2023 14:25:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b655ed8f-7f73-484a-942c-3b9a0008607c</guid><dc:creator>ksksue</dc:creator><description>&lt;p&gt;If a raw socket is opened, AWS IoT&amp;#39;s packet goes to the raw socket. And communication with AWS IoT is&amp;nbsp;no longer possible.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;A)&amp;nbsp;&lt;br /&gt;application &amp;lt;--&amp;gt; AWS IoT(mqtt socket zephyr/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c)&lt;br /&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;--&amp;gt;&amp;nbsp;ping (can&amp;#39;t catch the events)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;B) open a raw socket&lt;br /&gt;application&amp;nbsp;&amp;lt;-X-&amp;gt; AWS IoT(mqtt socket zephyr/subsys/net/lib/mqtt/mqtt_transport_socket_tls.c)&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;--&amp;gt; raw socket send/recv (It can catch ping events)&lt;/p&gt;
&lt;p&gt;If&amp;nbsp;pattern B,&amp;nbsp;u&lt;span class="Y2IQFc" lang="en"&gt;nintentionally, raw socket receives AWS IoT&amp;#39;s packet and AWS IoT&amp;#39;s library stops working.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="Y2IQFc" lang="en"&gt;So,&amp;nbsp;in the case of&amp;nbsp;pattern A, I want to catch the ping events.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF9160 ping event with AWS IoT</title><link>https://devzone.nordicsemi.com/thread/450060?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2023 12:49:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:502b3290-605e-4b68-90eb-5ff4b2ea1df9</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;ICMP reply is handled in slm via a raw socket type:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/v2.4.99-dev2/applications/serial_lte_modem/src/slm_at_icmp.c#L297-L345"&gt;https://github.com/nrfconnect/sdk-nrf/blob/v2.4.99-dev2/applications/serial_lte_modem/src/slm_at_icmp.c#L297-L345&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is polled similar to any other socket type.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]The device uses AWS IoT library, so&amp;nbsp;it can&amp;#39;t&amp;nbsp;open&amp;nbsp;a raw socket.[/quote]
&lt;p&gt;Are you thinking of the keepalive for mqtt? This is configured via CONFIG_MQTT_KEEPALIVE&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>