<?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>UDP on openthread is not received</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/88037/udp-on-openthread-is-not-received</link><description>This example automatically create the thread network. Once the button is pressed every 3 second udp is sent. 
 Issue is I am not receiving the packet on 2nd device. I am not seeing print from port_data_callback(). 
 What am I missing? Thanks. 
 Using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 24 May 2022 19:24:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/88037/udp-on-openthread-is-not-received" /><item><title>RE: UDP on openthread is not received</title><link>https://devzone.nordicsemi.com/thread/369373?ContentTypeID=1</link><pubDate>Tue, 24 May 2022 19:24:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1df51d28-cf94-46e5-ac48-cca451fce32c</guid><dc:creator>swap007</dc:creator><description>&lt;p&gt;Thead start -&amp;gt; wait for device to have their role in network -&amp;gt; udp open -&amp;gt; create buffer -&amp;gt; udp send&lt;/p&gt;
&lt;p&gt;Address and port is not needed in initiation stage in otUdpOpen but it needs in otUDPsend().&lt;/p&gt;
&lt;p&gt;Detailed:&lt;/p&gt;
&lt;p&gt;- otUdpOpen ~ In this function parameter otUdpSocket does not need to be initalize with values. It can be memset(&amp;amp;m_socket, 0, sizeof(otUdpSocket));&amp;nbsp;otUdpReceive also need to be passed so, response can be seen when it receives&lt;/p&gt;
&lt;p&gt;&amp;nbsp;- otUdpSend ~ In this function parameter otMessageInfo, it need the address (in my case ff03::1) and port 1234&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Note: I suggest Nordic to add this as an example, I have seen lot of people struggled on same issue in devzone forums.&lt;/p&gt;
&lt;p&gt;Best,&lt;/p&gt;
&lt;p&gt;Swap&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UDP on openthread is not received</title><link>https://devzone.nordicsemi.com/thread/369166?ContentTypeID=1</link><pubDate>Tue, 24 May 2022 06:55:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8635f58b-36fa-439a-b235-754b40c4813a</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Glad to hear that you figured it out!&lt;/p&gt;
&lt;p&gt;Do you mean that you only needed to set up the network before otUdpopen()? You didn&amp;#39;t need to set it up to listen at a specific port number?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UDP on openthread is not received</title><link>https://devzone.nordicsemi.com/thread/369148?ContentTypeID=1</link><pubDate>Tue, 24 May 2022 04:44:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79d96263-0b60-4aaf-936a-a1ce64584a47</guid><dc:creator>swap007</dc:creator><description>&lt;p&gt;Actually, there was no error output of init function or send function. I wish&amp;nbsp;otUdpOpen() function return error if thread network is not up.&lt;/p&gt;
&lt;p&gt;FInally, I found the issue by try and error with help of CLI example.&lt;/p&gt;
&lt;p&gt;One key piece was missed is : I should not be doing udp init before the thread network is up. Once I call the init function once both devices are part of openthread network, everything is fine.&lt;/p&gt;
&lt;p&gt;Thank you for the help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UDP on openthread is not received</title><link>https://devzone.nordicsemi.com/thread/368637?ContentTypeID=1</link><pubDate>Thu, 19 May 2022 13:17:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05b0477c-48ea-42dc-8139-d7a758f535dc</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I just want to confirm:&lt;/p&gt;
[quote user="swap007"], init_udp() and send_udp() is not printing any error[/quote]
&lt;p&gt;Does that mean that you see &amp;quot;otUdpOpen SUCCESS&amp;quot; in the log, or that you don&amp;#39;t see anything?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am not sure about this one. We don&amp;#39;t have any examples using this UDP other than deep inside &amp;quot;Matter&amp;quot;, so it is not that easy to see how it is supposed to be used.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Assuming that this is Openthreads take on the UDP IP protocol, I would assume that it requires a bit more setup, such as an UDP port, which I &lt;strong&gt;assume&lt;/strong&gt; will be part of the socket setup.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Perhaps you can try to both send and receive, but replace the other device (receiver and sender, respectively) with the &lt;a href="https://github.com/openthread/openthread/blob/main/src/cli/README_UDP.md"&gt;CLI example&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Looking at the testing description it looks like you need to bind to a port, and there is a function called &lt;a href="https://openthread.io/reference/group/api-udp#otudpbind"&gt;otUdpBind()&lt;/a&gt;, so I believe you need to call this from the receiver. From the description it looks like the 3rd parameter in otUdpBind() is an otSockAddr, which contains a port number.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UDP on openthread is not received</title><link>https://devzone.nordicsemi.com/thread/368487?ContentTypeID=1</link><pubDate>Thu, 19 May 2022 02:36:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:74407cf3-b574-4136-a3ae-cf55f4acacd9</guid><dc:creator>swap007</dc:creator><description>&lt;p&gt;I got an update. I think UDP packet is received by the net_openthead but it&amp;#39;s not propogated to the callback passed in by&amp;nbsp;otUdpOpen() function. ( I have not verified by nrf sniffer yet)&lt;/p&gt;
&lt;p&gt;There are two devices in this screenshot. both devices are flashed with the code posted above.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;left device addr- fe80:0:0:0:dc50:c721:81ac:8d9a:49153 send to ff02::1:1994 ----&amp;gt; received at right device&lt;/p&gt;
&lt;p&gt;right device addr: fe80:0:0:0:24af:a408:99fc:72e5:49153 send to ff02::1:1994 -----&amp;gt; received at left device&lt;/p&gt;
&lt;p&gt;Do I need to set any type of filter so, it can be seen in callback?&lt;/p&gt;
&lt;p&gt;After adding&amp;nbsp;CONFIG_OPENTHREAD_LOG_LEVEL_INFO=y, I saw the prints starting [INFO]-MAC-----:&lt;/p&gt;
&lt;p&gt;prj.config&lt;img alt=" " height="279" src="https://devzone.nordicsemi.com/resized-image/__size/3120x720/__key/communityserver-discussions-components-files/4/udp.png" width="3033" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#
# Copyright (c) 2020 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#

# nRF board library
CONFIG_DK_LIBRARY=y

#CONFIG_OPENTHREAD_NORDIC_LIBRARY_MASTER=y

# Enable CoAP utils and CoAP protocol
#CONFIG_COAP_UTILS=y


# Enable OpenThread CoAP support API
#CONFIG_OPENTHREAD_COAP=y

# Configure sample logging setting
CONFIG_LOG=y
CONFIG_OPENTHREAD_LOG_LEVEL_INFO=y
CONFIG_OPENTHREAD_DEBUG=y

# Adjust log strdup settings
CONFIG_LOG_STRDUP_MAX_STRING=512
CONFIG_LOG_STRDUP_BUF_COUNT=10

# Network shell
CONFIG_SHELL=y
CONFIG_OPENTHREAD_SHELL=y
CONFIG_SHELL_ARGC_MAX=26
CONFIG_SHELL_CMD_BUFF_SIZE=416

# Network sockets
CONFIG_NET_SOCKETS=y
CONFIG_NET_SOCKETS_POSIX_NAMES=y
CONFIG_NET_SOCKETS_POLL_MAX=4
CONFIG_NET_IPV6=y
CONFIG_NET_UDP=y

# Same network Master Key for client and server
CONFIG_OPENTHREAD_NETWORKKEY=&amp;quot;00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff&amp;quot;

# L2 OpenThread enabling
CONFIG_NET_L2_OPENTHREAD=y

# Generic networking options
CONFIG_NETWORKING=y

CONFIG_ASSERT=y
CONFIG_ASSERT_NO_COND_INFO=y
CONFIG_MBEDTLS_SHA1_C=n
CONFIG_FPU=y

CONFIG_SHELL_BACKEND_SERIAL_INIT_PRIORITY=51

CONFIG_UART_LINE_CTRL=y
CONFIG_SHELL_BACKEND_SERIAL_CHECK_DTR=y
CONFIG_USB_CDC_ACM_LOG_LEVEL_OFF=y

CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_MANUFACTURER=&amp;quot;Nordic Semiconductor ASA&amp;quot;
CONFIG_USB_DEVICE_PRODUCT=&amp;quot;Thread&amp;quot;
CONFIG_USB_DEVICE_VID=0x1915
CONFIG_USB_DEVICE_PID=0x0000&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UDP on openthread is not received</title><link>https://devzone.nordicsemi.com/thread/368461?ContentTypeID=1</link><pubDate>Wed, 18 May 2022 17:29:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b3e9e96-7a58-433f-8539-7e7490a2c135</guid><dc:creator>swap007</dc:creator><description>&lt;p&gt;I run same code on both devices posted above.&lt;/p&gt;
&lt;p&gt;No, init_udp() and send_udp() is not printing any error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: UDP on openthread is not received</title><link>https://devzone.nordicsemi.com/thread/368397?ContentTypeID=1</link><pubDate>Wed, 18 May 2022 13:55:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b007e0a8-bc19-41bb-a636-2a4acf84b7d3</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;On the receiver, does any of the function calls in init_udp() return any errors?&lt;/p&gt;
&lt;p&gt;And on the receiver, does any of the function calls in send_udp() return any errors?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>