Problem with accessing Shell Commands through SMP from Android Device Manager app

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 on the UART over the USB link, and custom commands can be added to them.  How do I get shell commands to attach over the SMP link?  looking at the .C code it says that options that are set will work on SMP.  Is there a way to get both the SMP link and USB Uart shells to work?

The nRF Device manager app also has a Chat interface that echoes back a string you send.  Where is the way to have an application hook into this service/command on the device side and perform custom operations?   The service does work, so the code must be somewhere.

Parents
  • Hi Christopher 

    I will look into your questions. 

    Shell commands do work on the UART over the USB link, and custom commands can be added to them.  How do I get shell commands to attach over the SMP link?

    I would start by looking at the smp server sample 

    Is there a way to get both the SMP link and USB Uart shells to work?

    I will need to check, 

    The nRF Device manager app also has a Chat interface that echoes back a string you send.  Where is the way to have an application hook into this service/command on the device side and perform custom operations?   The service does work, so the code must be somewhere.

    I'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

    Regards

    Runar

  • if you look at the nRF Device Manager android app, the first tab after connection has an "echo" interface that looks like messaging (text bubbles) that echoes text strings you put into it.  My idea is to understand how this is implemented in case a similar communication message link would be useful in application code.

    The SMP server sample has no visible code under the src tree for shell command handling.  The nRF Device Manager shell tab returns an error (8) undefined command for all of them.  This is true for both the SMP server sample and my application based on it.

    The SMP also has a file transfer protocol that tested out OK with the sample and the application we are making.  In the documentation there is mention that for security you might want to add code to keep the file transfer open only to "trusted" apps.  Where is the handle/API to do this?  SMP server sample has no visible code adding hooks/handlers to the interface.  Where would this be done?

    Alternatively if there is some other sample that shows tweaking of the full SMP interface more directly by all means point me at that.

  • 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'm looking into that. 

    Regards

    Runar

  • Do you have any answer for the second question about adding handlers for authorization over SMP?  Or about how to hook into the "Echo" demo communication link?  

  • I have one question regarding "In the documentation there is mention that for security you might want to add code to keep the file transfer open only to "trusted" apps.  Where is the handle/API to do this?  SMP server sample has no visible code adding hooks/handlers to the interface.  Where would this be done?" 
    Do you expect there to be some users who will be allowed to do for example DFU and some who wont?  I have gotten a question from some coworkers regarding the motivation for the implementation. 

    Runar

  • I think it would be more in the line of restricting DFUs to our app as opposed to your public one.  Our app has cybersecurity concerns.  But at this point I don't even know what the security enable you put up above is handled if turned on.

  • I would check out the following: 

    There is a settings access MCUmgr callback available (see MCUmgr Callbacks 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 CONFIG_MCUMGR_GRP_SETTINGS_ACCESS_HOOK, registered with the event MGMT_EVT_OP_SETTINGS_MGMT_ACCESS, whereby the supplied callback data is settings_mgmt_access.

    You would still need to define in your application what the application is supposed to do if this happens. 
    Regards
    Runar
Reply Children
No Data
Related