<?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>Illustration of sending data over UDP with the Thingy:91/nRF9160-dk&amp;#39;s modem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75853/illustration-of-sending-data-over-udp-with-the-thingy-91-nrf9160-dk-s-modem</link><description>Would it be possible to illustrate what AT commands would be required to set up and send a UDP packet for the nRF9160, including configuring the modem, turning the modem on, connecting to LTE etc? As a newcomer to the modem, it is tricky to understand</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 02 Jun 2021 20:57:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75853/illustration-of-sending-data-over-udp-with-the-thingy-91-nrf9160-dk-s-modem" /><item><title>RE: Illustration of sending data over UDP with the Thingy:91/nRF9160-dk's modem</title><link>https://devzone.nordicsemi.com/thread/313219?ContentTypeID=1</link><pubDate>Wed, 02 Jun 2021 20:57:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2645ec2e-c7bb-4308-aea2-673b15ce71db</guid><dc:creator>Christopher Hunt</dc:creator><description>&lt;p&gt;Perfect! Thanks! I shall give it a spin.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Illustration of sending data over UDP with the Thingy:91/nRF9160-dk's modem</title><link>https://devzone.nordicsemi.com/thread/313169?ContentTypeID=1</link><pubDate>Wed, 02 Jun 2021 14:34:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc971616-b1f5-422f-a4ca-55744bfd52cb</guid><dc:creator>Heidi</dc:creator><description>&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Of course!&amp;nbsp;To use AT commands for this you will need to be running the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/README.html"&gt;Serial LTE Modem application&lt;/a&gt; available in NCS, which has support for proprietary AT commands like UDP AT commands.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;AT+CFUN=1 //to turn on the modem&lt;/p&gt;
&lt;p&gt;AT+CFUN? //to confirm that the modem is turned on&lt;/p&gt;
&lt;p&gt;AT+CEREG=5 //to enable unsolicited notfiications&lt;/p&gt;
&lt;p&gt;//wait for a connection, +CEREG: 5&amp;nbsp;&lt;/p&gt;
&lt;p&gt;AT#&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.1/nrf/applications/serial_lte_modem/doc/TCPIP_AT_commands.html#socket-xsocket"&gt;XSOCKET&lt;/a&gt;=1,2,1 //open a UDP socket with role = server&amp;nbsp;&lt;/p&gt;
&lt;p&gt;(or&amp;nbsp;&lt;span&gt;AT#XSOCKET=1,2,0 //open a UDP socket with role = client)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Then you can use AT#&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.1/nrf/applications/serial_lte_modem/doc/TCPIP_AT_commands.html#socket-options-xsocketopt"&gt;XSOCKETOPT &lt;/a&gt;to set socket options&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;AT#&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.1/nrf/applications/serial_lte_modem/doc/TCPIP_AT_commands.html#udp-send-data-xsendto"&gt;XSENDTO&lt;/a&gt;=&amp;lt;url&amp;gt;,&amp;lt;port&amp;gt;,&amp;lt;datatype&amp;gt;,&amp;lt;data&amp;gt; //to send data&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Let me know if there&amp;#39;s anything else you need!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Heidi&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>