<?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>nrf9160dk How to add custom at command</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/111452/nrf9160dk-how-to-add-custom-at-command</link><description>I want to add a custom at command in the SLM example . I follow the https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.6.1/nrf/libraries/modem/at_cmd_custom.html , enable CONFIG_AT_CMD_CUSTOM in prj.conf, add at_cmd_custom.h to the main.c, and the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 May 2024 02:13:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/111452/nrf9160dk-how-to-add-custom-at-command" /><item><title>RE: nrf9160dk How to add custom at command</title><link>https://devzone.nordicsemi.com/thread/486067?ContentTypeID=1</link><pubDate>Tue, 28 May 2024 02:13:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3258c21d-6652-4ff9-b5ef-16564a547e43</guid><dc:creator>llly</dc:creator><description>&lt;p&gt;ok, thank you for your patient answer&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160dk How to add custom at command</title><link>https://devzone.nordicsemi.com/thread/486046?ContentTypeID=1</link><pubDate>Mon, 27 May 2024 13:57:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8fe08a0e-df4a-4a0e-85b1-9d1d447c1bfc</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Illy,&lt;/p&gt;
[quote user="llly"]One is that in the at client, the end needs to be set to CR and LF to recognize commands properly, but in SLM, keeping the default CR end can recognize commands properly.[/quote]
&lt;p&gt;I think this is not an issue. SLM and AT Client use&amp;nbsp;&lt;span&gt;CONFIG_CR_LF_TERMINATION=y and CONFIG_CR_TERMINATION=y by default respectively, you can just change to what you want at building time. The&amp;nbsp;Serial Terminal also has Line Ending option allows you to set up the termination method.&lt;/span&gt;&lt;/p&gt;
[quote user="llly"]Another issue is that custom commands in SLM can be case insensitive, and even mixed case is fine. However, in at client, commands can only be executed in all uppercase, otherwise an error will be returned (custom commands in both projects are all uppercase).[/quote]
&lt;p&gt;&lt;span&gt;It seems AT Client support case-insensitive for modem AT commands but not custom commands. I think this depends on the at commands processing in MFW. For a custom AT command, it will match exactly what you provide.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v3.5.99-ncs1-1-4-ga681edb8d456 ***
The AT host sample started
Ready
&amp;gt; at+CFUN?
+CFUN: 0
OK
&amp;gt; at+cfun?
+CFUN: 0
OK
&amp;gt; at+mycommand=?
at+mycommand=?
&amp;gt; AT+MYCOMMAND=?
+MYCOMMAND: (0, 1)
OK&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Charlie&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160dk How to add custom at command</title><link>https://devzone.nordicsemi.com/thread/486045?ContentTypeID=1</link><pubDate>Mon, 27 May 2024 13:57:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c29a7d2-dd6b-4a9d-8e83-cb110fa35fed</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Illy,&lt;/p&gt;
[quote user="llly"]One is that in the at client, the end needs to be set to CR and LF to recognize commands properly, but in SLM, keeping the default CR end can recognize commands properly.[/quote]
&lt;p&gt;I think this is not an issue. SLM and AT Client use&amp;nbsp;&lt;span&gt;CONFIG_CR_LF_TERMINATION=y and CONFIG_CR_TERMINATION=y by default respectively, you can just change to what you want at building time. The&amp;nbsp;Serial Terminal also has Line Ending option allows you to set up the termination method.&lt;/span&gt;&lt;/p&gt;
[quote user="llly"]Another issue is that custom commands in SLM can be case insensitive, and even mixed case is fine. However, in at client, commands can only be executed in all uppercase, otherwise an error will be returned (custom commands in both projects are all uppercase).[/quote]
&lt;p&gt;&lt;span&gt;It seems AT Client support case-insensitive for modem AT commands but not custom commands. I think this depends on the at commands processing in MFW. For a custom AT command, it will match exactly what you provide.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting nRF Connect SDK v3.5.99-ncs1-1-4-ga681edb8d456 ***
The AT host sample started
Ready
&amp;gt; at+CFUN?
+CFUN: 0
OK
&amp;gt; at+cfun?
+CFUN: 0
OK
&amp;gt; at+mycommand=?
at+mycommand=?
&amp;gt; AT+MYCOMMAND=?
+MYCOMMAND: (0, 1)
OK&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;span&gt;Charlie&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160dk How to add custom at command</title><link>https://devzone.nordicsemi.com/thread/485898?ContentTypeID=1</link><pubDate>Sat, 25 May 2024 01:37:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a884a901-e117-41fe-a0b8-61538a0a0a72</guid><dc:creator>llly</dc:creator><description>&lt;p&gt;Thank you so much，It is indeed a problem with CR and LF at the end of commands. The default setting is to end with a&amp;nbsp;CR.&amp;nbsp;But now there are two other small issues.&lt;/p&gt;
&lt;p&gt;One is that in the at client, the end needs to be set to CR and LF to recognize commands properly, but in SLM, keeping the default CR end can recognize commands properly.&lt;/p&gt;
&lt;p&gt;Another issue is that custom commands in SLM can be case insensitive, and even mixed case is fine. However, in at client, commands can only be executed in all uppercase, otherwise an error will be returned (custom commands in both projects are all uppercase).&lt;/p&gt;
&lt;p&gt;Can you help me check again what caused these two problems? Thank you again&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160dk How to add custom at command</title><link>https://devzone.nordicsemi.com/thread/485865?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 14:10:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0eb7869-9ce5-4dca-80d0-6c5ca0964bea</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Illy,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Try to set CONFIG_CR_LF_TERMINATION=y.&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;Charlie&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160dk How to add custom at command</title><link>https://devzone.nordicsemi.com/thread/485730?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 07:31:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:820036f4-bac1-4294-b686-5895cd14f6af</guid><dc:creator>llly</dc:creator><description>&lt;p&gt;nrf\samples\cellular\at_client&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160dk How to add custom at command</title><link>https://devzone.nordicsemi.com/thread/485723?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 07:08:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77277be3-0f5b-448a-b0fa-ed94560398d6</guid><dc:creator>Charlie</dc:creator><description>[quote user="llly"]The current issue is that custom commands added using the same method in other sample level projects[/quote]
&lt;p&gt;&amp;quot;other sample level projects&amp;quot; Which sample have you tested with? I can have a try.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160dk How to add custom at command</title><link>https://devzone.nordicsemi.com/thread/485703?ContentTypeID=1</link><pubDate>Fri, 24 May 2024 02:16:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3374f2b2-6e82-4e93-a006-e584e25c03f7</guid><dc:creator>llly</dc:creator><description>&lt;p&gt;hi&amp;nbsp;&lt;span&gt;Charlie,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;thank you for your help. I have successfully added custom commands to SLM and they are working properly. I compared my SLM with the SLM you sent me, and the custom command section is consistent. The current issue is that custom commands added using the same method in other sample level projects will only return normally when the first command is entered, and will return an error when entered again later, as shown in the above figure&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160dk How to add custom at command</title><link>https://devzone.nordicsemi.com/thread/485631?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 12:28:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb9f6ad5-ddef-4f5a-81cf-1984c629f6d8</guid><dc:creator>Charlie</dc:creator><description>&lt;p&gt;Hi Illy,&lt;/p&gt;
&lt;p&gt;I did a quick check by modifying SLM application in NCS v2.6.1. It works as expected.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/AT_5F00_Custom_5F00_Command.png" /&gt;&lt;/p&gt;
&lt;p&gt;Here are the project and hex file. You can check the difference compared with your modification.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ncs261_5F00_slm_5F00_customATcommands.zip"&gt;devzone.nordicsemi.com/.../ncs261_5F00_slm_5F00_customATcommands.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ncs261_5F00_slm_5F00_customATcommands.hex"&gt;devzone.nordicsemi.com/.../ncs261_5F00_slm_5F00_customATcommands.hex&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I suggest you refer to this page if you want &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/applications/serial_lte_modem/doc/slm_extending.html"&gt;Extending the application — nRF Connect SDK 2.6.99 documentation (nordicsemi.com)&lt;/a&gt;&amp;nbsp;in SLM application.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf9160dk How to add custom at command</title><link>https://devzone.nordicsemi.com/thread/485550?ContentTypeID=1</link><pubDate>Thu, 23 May 2024 07:57:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc288a08-0ec5-471a-bf07-3982835dbb5e</guid><dc:creator>llly</dc:creator><description>&lt;p&gt;Now it has been implemented to add custom commands in the SLM example, but I used the same method to add custom commands to a hello world project. Custom commands only return OK when sent the first time, and error when sent the second time or after, The built-in commands in the modem, such as+cfun or+cereg, do not have this issue&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/35185.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>