<?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>Problem with accessing Shell Commands through SMP from Android Device Manager app</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/110627/problem-with-accessing-shell-commands-through-smp-from-android-device-manager-app</link><description>I am developing an app using DFU and that part is going well using the nRF Device Manager app. However, the features using shell to send commands do not work, all say Command not implemented. This was based on the SMP Server app. 
 Shell commands do work</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 May 2024 12:07:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/110627/problem-with-accessing-shell-commands-through-smp-from-android-device-manager-app" /><item><title>RE: Problem with accessing Shell Commands through SMP from Android Device Manager app</title><link>https://devzone.nordicsemi.com/thread/482785?ContentTypeID=1</link><pubDate>Fri, 10 May 2024 12:07:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac338b8a-613a-4d10-85eb-bfd492daf842</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;I would check out the following:&amp;nbsp;&lt;/p&gt;
&lt;div dir="ltr"&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;p&gt;There is a settings access MCUmgr callback available (see&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/device_mgmt/mcumgr_callbacks.html#mcumgr-callbacks"&gt;&lt;span&gt;MCUmgr Callbacks&lt;/span&gt;&lt;/a&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;for details on callbacks) which allows for applications/modules to know when settings management commands are used and, optionally, block access (for example through the use of a security mechanism). This callback can be enabled with&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a title="(in Kconfig reference v&amp;amp;nbsp;)" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/kconfig/index.html#CONFIG_MCUMGR_GRP_SETTINGS_ACCESS_HOOK"&gt;&lt;code&gt;&lt;span&gt;CONFIG_MCUMGR_GRP_SETTINGS_ACCESS_HOOK&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;, registered with the event&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a title="MGMT_EVT_OP_SETTINGS_MGMT_ACCESS" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/device_mgmt/mcumgr_callbacks.html#c.settings_mgmt_group_events.MGMT_EVT_OP_SETTINGS_MGMT_ACCESS"&gt;&lt;code&gt;&lt;span&gt;MGMT_EVT_OP_SETTINGS_MGMT_ACCESS&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;, whereby the supplied callback data is&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;a title="settings_mgmt_access" href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/services/device_mgmt/mcumgr_callbacks.html#c.settings_mgmt_access"&gt;&lt;code&gt;&lt;span&gt;settings_mgmt_access&lt;/span&gt;&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;You would still need to define in your application what the application is supposed to do if this happens.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;Regards&lt;/div&gt;
&lt;div&gt;Runar&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with accessing Shell Commands through SMP from Android Device Manager app</title><link>https://devzone.nordicsemi.com/thread/482368?ContentTypeID=1</link><pubDate>Tue, 07 May 2024 17:40:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:448955e3-b1e6-4a0b-9864-43dfcda74706</guid><dc:creator>Christopher Smith</dc:creator><description>&lt;p&gt;I think it would be more in the line of restricting DFUs to our app as opposed to your public one.&amp;nbsp; Our app has cybersecurity concerns.&amp;nbsp; But at this point I don&amp;#39;t even know what the security enable you put up above is handled if turned on.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with accessing Shell Commands through SMP from Android Device Manager app</title><link>https://devzone.nordicsemi.com/thread/482350?ContentTypeID=1</link><pubDate>Tue, 07 May 2024 15:58:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:801308fc-7e00-42d2-913d-3b2272e05697</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;I have one question regarding &amp;quot;&lt;span&gt;In the documentation there is mention that for security you might want to add code to keep the file transfer open only to &amp;quot;trusted&amp;quot; apps.&amp;nbsp; Where is the handle/API to do this?&amp;nbsp; SMP server sample has no visible code adding hooks/handlers to the interface.&amp;nbsp; Where would this be done?&amp;quot;&amp;nbsp;&lt;br /&gt;Do you expect there to be some users who will be allowed to do for example DFU and some who wont?&amp;nbsp; I have gotten a question from some coworkers regarding the motivation for the implementation.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Runar&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with accessing Shell Commands through SMP from Android Device Manager app</title><link>https://devzone.nordicsemi.com/thread/481853?ContentTypeID=1</link><pubDate>Fri, 03 May 2024 17:15:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26062ba4-0eb1-44e7-a5a5-ce16596f2c09</guid><dc:creator>Christopher Smith</dc:creator><description>&lt;p&gt;Do you have any answer for the second question about adding handlers for authorization over SMP?&amp;nbsp; Or about how to hook into the &amp;quot;Echo&amp;quot; demo communication link?&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with accessing Shell Commands through SMP from Android Device Manager app</title><link>https://devzone.nordicsemi.com/thread/481752?ContentTypeID=1</link><pubDate>Fri, 03 May 2024 10:54:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f33cbf78-2d5e-44f9-aa03-8064d7de1d83</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Just a quick update. I have run into the same issue as you regarding it works over USB but not over any other interface, so i&amp;#39;m looking into that.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with accessing Shell Commands through SMP from Android Device Manager app</title><link>https://devzone.nordicsemi.com/thread/481337?ContentTypeID=1</link><pubDate>Tue, 30 Apr 2024 17:36:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98f7b819-746c-45ec-8083-cd03bd3476c8</guid><dc:creator>Christopher Smith</dc:creator><description>&lt;p&gt;I have already added custom commands to the shell in my app, based on the shell example.&amp;nbsp; These commands do work in the USB interface in the IDE.&amp;nbsp; They do not work, none of them, in the SMP shell in the Android Device Manager app.&lt;/p&gt;
&lt;p&gt;I do have the line&amp;nbsp;CONFIG_SHELL_BACKEND_SERIAL=y in my prj.conf which might be why the USB shell works.&amp;nbsp; The list of supported backends mentions SMP but there isn&amp;#39;t a CONFIG for it that I found.&amp;nbsp; Is there a CONFIG to enable this, or a working sample that does shell commands from the Device Manager Android App?&lt;/p&gt;
&lt;p&gt;As to the second part, that setting does seem to enable SMP authorization.&amp;nbsp; How do I hook into that process to do verification?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with accessing Shell Commands through SMP from Android Device Manager app</title><link>https://devzone.nordicsemi.com/thread/481278?ContentTypeID=1</link><pubDate>Tue, 30 Apr 2024 12:33:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7bc815e-1d2c-4e74-b368-c4f467218a01</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;I have a chat with a few coworkers regarding our questions&lt;/p&gt;
[quote user="Christopher Smith"]&lt;p&gt;The SMP server sample has no visible code under the src tree for shell command handling.&amp;nbsp; The nRF Device Manager shell tab returns an error (8) undefined command for all of them.&amp;nbsp; This is true for both the SMP server sample and my application based on it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;This &lt;a href="https://github.com/martelmy/NCS_examples/tree/main/custom_shell"&gt;example &lt;/a&gt;shows how to add custom commands to the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/services/shell/index.html#c.shell"&gt;zephyr shell&lt;/a&gt;. The smp_svr samples forwards the Zephyr shell so it should be possible to add new commands to it. You can add functionality from different modules by including them in prj.conf&lt;/p&gt;
&lt;p&gt;But as a start you&amp;nbsp;will &amp;nbsp;need the following&lt;/p&gt;
&lt;p&gt;CONFIG_SHELL&lt;/p&gt;
&lt;p&gt;CONFIG_BT_SHELL&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
[quote user="Christopher Smith"]&lt;p&gt;The SMP also has a file transfer protocol that tested out OK with the sample and the application we are making.&amp;nbsp; In the documentation there is mention that for security you might want to add code to keep the file transfer open only to &amp;quot;trusted&amp;quot; apps.&amp;nbsp; Where is the handle/API to do this?&amp;nbsp; SMP server sample has no visible code adding hooks/handlers to the interface.&amp;nbsp; Where would this be done?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;My teams DFU/MCUMGR specialist is currently out of office, but from what I can find, it looks like you need to have enable &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html#CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN"&gt;CONFIG_MCUMGR_TRANSPORT_BT_AUTHEN&lt;/a&gt;.&amp;nbsp;The SMP charcareristic permission levels get set at&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/bdda11bdb687157e55b44e3053bb0966ecf75d4f/subsys/mgmt/mcumgr/transport/src/smp_bt.c#L370"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/bdda11bdb687157e55b44e3053bb0966ecf75d4f/subsys/mgmt/mcumgr/transport/src/smp_bt.c#L370&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with accessing Shell Commands through SMP from Android Device Manager app</title><link>https://devzone.nordicsemi.com/thread/480936?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2024 17:07:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b1930d3e-9d70-4c01-a860-ca5bce4a0442</guid><dc:creator>Christopher Smith</dc:creator><description>&lt;p&gt;if you look at the nRF Device Manager android app, the first tab after connection has an &amp;quot;echo&amp;quot; interface that looks like messaging (text bubbles) that echoes text strings you put into it.&amp;nbsp; My idea is to understand how this is implemented in case a similar communication message link would be useful in application code.&lt;/p&gt;
&lt;p&gt;The SMP server sample has no visible code under the src tree for shell command handling.&amp;nbsp; The nRF Device Manager shell tab returns an error (8) undefined command for all of them.&amp;nbsp; This is true for both the SMP server sample and my application based on it.&lt;/p&gt;
&lt;p&gt;The SMP also has a file transfer protocol that tested out OK with the sample and the application we are making.&amp;nbsp; In the documentation there is mention that for security you might want to add code to keep the file transfer open only to &amp;quot;trusted&amp;quot; apps.&amp;nbsp; Where is the handle/API to do this?&amp;nbsp; SMP server sample has no visible code adding hooks/handlers to the interface.&amp;nbsp; Where would this be done?&lt;/p&gt;
&lt;p&gt;Alternatively if there is some other sample that shows tweaking of the full SMP interface more directly by all means point me at that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem with accessing Shell Commands through SMP from Android Device Manager app</title><link>https://devzone.nordicsemi.com/thread/480880?ContentTypeID=1</link><pubDate>Fri, 26 Apr 2024 12:07:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7551ddb-c791-43dd-a4ab-d50d574d422e</guid><dc:creator>runsiv</dc:creator><description>&lt;p&gt;Hi Christopher&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I will look into your questions.&amp;nbsp;&lt;/p&gt;
[quote user=""]Shell commands do work on the UART over the USB link, and custom commands can be added to them.&amp;nbsp; How do I get shell commands to attach over the SMP link?[/quote]
&lt;p&gt;I would start by looking at the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/README.html"&gt;smp server sample&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]&lt;p&gt;Is there a way to get both the SMP link and USB Uart shells to work?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;[/quote]
&lt;p&gt;I will need to check,&amp;nbsp;&lt;/p&gt;
[quote user=""]&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The nRF Device manager app also has a Chat interface that echoes back a string you send.&amp;nbsp; Where is the way to have an application hook into this service/command on the device side and perform custom operations?&amp;nbsp; &amp;nbsp;The service does work, so the code must be somewhere.&lt;/p&gt;[/quote]
&lt;p&gt;I&amp;#39;m a bit unsure what you mean here. You can use the shell interface in the device manager app to communicate with smp over shell&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;
&lt;p&gt;Runar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>