Mistake on this page? Email us


Device discovery and selection

You can list available devices, and select one to use for all subsequent commands:

  1. To list the devices:

    mbl-cli select

    For example:

    $ mbl-cli select
    Discovering devices. This will take up to 30 seconds.
    1: mbed-linux-os-2833: fe80::4f3a:cbef:fe1254d6%enx7c8bca12130a
    Select a device from the list: 1
  2. To select a device, enter its number from the list above.

    For example, to select the device mbed-linux-os-2833, enter 1.

    You can now omit the address argument from subsequent commands.

    The selected device's address is stored in a configuration file (${HOME}/.mbl-dev.json), so the selection will apply to all subsequent runs of MBLC LI by the same user.

  3. To deselect a device: run select again and select a different device.

Remote command execution

To execute commands on the device:

  1. Select a device from the list of available devices using the mbl-cli select command.

  2. Run a command on the device:

    $ mbl-cli [-a address] shell <command>

    The commands are run by the user root. The commands are not executed in a login shell; to execute a remote command in a login shell, prefix it with su -l -c (this is the same behaviour as OpenSSH).

For example, to show the statuses of the active interfaces on a device:

$ mbl-cli -a shell 'su -l -c "ifconfig -a"'
lo        Link encap:Local Loopback  
          inet addr:  Mask:
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:144 errors:0 dropped:0 overruns:0 frame:0
          TX packets:144 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:9648 (9.4 KiB)  TX bytes:9648 (9.4 KiB)

usb0      Link encap:Ethernet  HWaddr 96:F8:52:67:D5:D8  
          inet6 addr: fe80::94f8:52ff:fe67:d5d8/64 Scope:Link
          RX packets:273 errors:0 dropped:0 overruns:0 frame:0
          TX packets:357 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:30202 (29.4 KiB)  TX bytes:82367 (80.4 KiB)

usb0:avahi Link encap:Ethernet  HWaddr 96:F8:52:67:D5:D8  
          inet addr:  Bcast:  Mask:

Get shell access (SSH)

To get shell access over SSH to a device (as the user root), use the shell command:

$ mbl-cli [-a address] shell

For a previously selected device, omit the address:

$ mbl-cli shell
Connecting to mbed-linux-os-2833...

After obtaining shell access, you can set up Wi-Fi on the device (see Setting up a network connection).

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.