<?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>nef9160 IMEI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73872/nef9160-imei</link><description>Dear Sir, 
 
 Moving to zephyr new installation 1.4.99 
 The code of getting the IMEI number no longer works. 
 Modem firmware is mfw_nrf9160_1.2.3 
 reply_buf_len = at_exec_reply(&amp;quot;AT+CGSN=1&amp;quot;, 9, &amp;amp;reply_buf[0], 30); 
 
 Am I missing something ?. 
 Is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Apr 2021 10:54:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73872/nef9160-imei" /><item><title>RE: nef9160 IMEI</title><link>https://devzone.nordicsemi.com/thread/305259?ContentTypeID=1</link><pubDate>Fri, 16 Apr 2021 10:54:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3803438-17c4-4ae6-831c-00479f04c3f9</guid><dc:creator>ephraim</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;error number tested = -1.&lt;/p&gt;
&lt;p&gt;Do you have any example how to get IMEI .&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nef9160 IMEI</title><link>https://devzone.nordicsemi.com/thread/304867?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 14:00:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4965edfd-673f-41f2-85a7-31fe32a812df</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;A good way to find out a little bit more about why the socket function returns false, is to print errno. Would you mind doing that?&lt;/p&gt;
&lt;p&gt;Otherwise, there are two alternatives to get the IMEI:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;AT command interface library using the function &lt;em&gt;at_cmd_write&lt;/em&gt; instead of &lt;em&gt;socket.&lt;/em&gt; &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/nrf/include/modem/at_cmd.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/nrf/include/modem/at_cmd.html&lt;/a&gt;#&lt;/li&gt;
&lt;li&gt;Modem interface library using the function &lt;em&gt;modem_info_short_get&lt;/em&gt; instead of &lt;em&gt;socket&lt;/em&gt;, for instance.&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/nrf/include/modem/modem_info.html"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.5.0/nrf/include/modem/modem_info.html&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
&lt;p&gt;Markus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nef9160 IMEI</title><link>https://devzone.nordicsemi.com/thread/304693?ContentTypeID=1</link><pubDate>Wed, 14 Apr 2021 05:15:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7edd187-6ae1-4d33-9138-75c61bceab9d</guid><dc:creator>ephraim</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;in Main I issue the command&amp;nbsp;&amp;nbsp;&amp;nbsp;GetIMEI();&lt;/p&gt;
&lt;p&gt;Attached some code&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/at.c"&gt;devzone.nordicsemi.com/.../at.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The line&amp;nbsp;at_sock = socket(AF_LTE, 0, NPROTO_AT);&amp;nbsp; &amp;nbsp;in at.c return false.&lt;/p&gt;
&lt;p&gt;Is there another way to get the IMEI number within the code ?.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Bye.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nef9160 IMEI</title><link>https://devzone.nordicsemi.com/thread/304610?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 14:21:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca24f22d-9edb-4a36-a274-fcae6a2a7bf4</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;Thanks for the code snippet, Ephraim!&lt;/p&gt;
&lt;p&gt;However, I can’t find any information about the function “at_exec_reply”. What does it do?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Markus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nef9160 IMEI</title><link>https://devzone.nordicsemi.com/thread/304417?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 07:33:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8390572d-56e4-4fb5-93f6-704860934f7d</guid><dc:creator>ephraim</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;This is the code&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;void GetIMEI(void)&lt;br /&gt;{&lt;br /&gt; int reply_buf_len;&lt;br /&gt; &lt;br /&gt; reply_buf_len = at_exec_reply(&amp;quot;AT+CGSN=1&amp;quot;, 9, &amp;amp;reply_buf[0], 30);//NTP_GET_CURR_UNIX_TIME_MAX_REPLY_LEN)&lt;/p&gt;
&lt;p&gt;memcpy(&amp;amp;imei_buf[0] , &amp;amp;reply_buf[8] ,15);&lt;br /&gt;// imei_buf[15] = NULL;&lt;br /&gt; imei_buf[15] = 0x2f;&lt;br /&gt; imei_buf[16] = 0x53;&lt;br /&gt; imei_buf[17] = 0x54;&lt;br /&gt; imei_buf[18] = NULL;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;It worked before .&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Now I get the error&amp;nbsp; &amp;nbsp;[at_exec_reply:59] ERROR: AT commands socket error.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please Advise&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nef9160 IMEI</title><link>https://devzone.nordicsemi.com/thread/304414?ContentTypeID=1</link><pubDate>Tue, 13 Apr 2021 06:55:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65a5665c-d3e3-4d1c-9fba-ef2329f9d294</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;Hello Ephraim,&lt;/p&gt;
&lt;p&gt;I assume that you are using Zephyr 2.4.99.&lt;/p&gt;
&lt;p&gt;Function “&lt;span&gt;&lt;span&gt;&lt;span&gt;at_exec_reply&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;”, is that something you wrote yourself?&lt;/p&gt;
&lt;p&gt;Can you elaborate “no longer works”? Does the application still compile?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Markus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>