Sign inSign up

zfields/particle-cli

By zfields

Updated over 6 years ago

The command line interface utility for Particle devices

Image
0

2.7K

zfields/particle-cli repository overview

Particle CLI Container

Preparing the Host Machine
  1. Create a working folder on the host machine.

    mkdir -p ~/.particle/cli
    

    ~/.particle/ is the common working folder required by the command line interface and workbench. It is used to store your configuration and profile data, as well as any and all toolchains required by the Particle Workbench extension for VSCode.

    In order to share files with the container, a new cli folder is added to ~/.particle/. This folder will be later mounted into the container as a working directory. The mounted folder allows you to both share files with and receive generated or downloaded files from the container.

Running Particle CLI (Linux)

docker run --interactive --privileged --rm --tty --volume ~/.particle:/root/.particle --volume ~/.particle/cli:/particle-iot/workdir zfields/particle-cli --version

PROTIP: Add an alias to your host machine to get a native experience!

$ echo "alias particle=\"docker run --interactive --privileged --rm --tty --volume ~/.particle:/root/.particle --volume ~/.particle/cli:/particle-iot/workdir zfields/particle-cli\"" >> ~/.bash_aliases
$ . ~/.bash_aliases
$ particle --version
1.45.0
FAQ

Q: Why can't the CLI find any of my files?
A: Due to the fact the CLI is running in a container, files can only be shared to the CLI via the mounted working folder.

To get the best experience, navigate to the folder you are sharing with the container.

cd ~/.particle/cli

Now, all paths the CLI has access to will be tab completable.

Q: Why does particle serial wifi respond with "Error configuring Wi-Fi: Unable to scan for Wi-Fi networks. Do you have permission to do that on this system?"
A: The container does NOT have access to the host machines Wi-Fi controller.

Do the following to work around this limitation:

  1. Ensure the device is in listening mode (blinking blue)

  2. Use nmcli dev wifi to list the currently available Wi-Fi networks.

    $ nmcli dev wifi
    IN-USE  SSID    MODE   CHAN  RATE        SIGNAL  BARS  SECURITY  
    *       Fields  Infra  6     130 Mbit/s  65      ▂▄▆_  WPA1 WPA2
    
  3. Retry particle serial wifi.

  4. Respond to "? Should I scan for nearby Wi-Fi networks?" with n (No).

  5. Respond to "? SSID" with an SSID (discovered in step 1).

Tag summary

Content type

Image

Digest

Size

86.6 MB

Last updated

over 6 years ago

docker pull zfields/particle-cli