Mistake on this page? Email us

Installing FCU

A note on the use of pip and Python commands:

If you have an activated virtual environment, you can use the commands provided in the instructions below. If you do not activate your virtual environment, you must use the full or relative path for pip and Python commands.

The following example demonstrates how to run the same command in a virtual environment and on your physical machine:

  • On your physical machine or if you activate your virtual environment:

    pip install fcu -f c:\extracted-fcu-archive\fcu --upgrade

  • Using a virtual environment that is not activated:

    • In Windows:

      [your Python installation path]\Scripts\pip install fcu -f c:\extracted-fcu-archive\fcu --upgrade

    • In Linux:

      [your Python installation path]/bin/pip install fcu -f ~/extracted-fcu-archive/fcu --upgrade

  • NOTE! FCU does not currently work with Python3.10.

    • If your distribution has Python 3.10 as the default one - we recommend installing pyenv with virtualenv support and installing for example latest Python 3.8.x with and using that.
    • A virtualenv alone will not fix the Python 3.10 API breakages.

  1. Download the FCU archive:

    1. Select Device identity > Factory from the Device Management Portal side menu.
    2. Click Download.
  2. Set up a virtual environment. Working in a virtual environment is optional, but it is the recommended procedure.

  3. Extract the FCU archive into a directory of your choice. The examples below use extracted-fcu-archive.

  4. Install the FCU Python package from the .whl file.

    • In Windows, run:
       pip install fcu -f c:\extracted-fcu-archive\fcu --upgrade
    • In Linux, run:
       pip install fcu -f ~/extracted-fcu-archive/fcu --upgrade
  5. Alternatively, if you make changes to the source files, you can install the FCU Python package based on the FCU source files.

    • In Windows, run:

      pip install -e c:\extracted-fcu-archive\fcu\sources --upgrade
    • In Linux, run:

      pip install fcu -e ~/extracted-fcu-archive/fcu/sources --upgrade

    Note: Use the --upgrade flag to override an existing FCU installation. After installing, you can verify the FCU version using the pip list command, which prints all installed Python libraries under the FCU entry.

    Tip: If an internet connection is available, running the command installs the FCU package and its required Python libraries at the same time. If an internet connection is not available, you must install the Python libraries yourself before running the FCU installation.

After installing FCU, you must integrate FCU with your factory tool and configure FCU.

Note: If you intend to use FCU as a certificate authority, you must set it up manually. You can do this at any time, but we describe how to do this as part of the installation process in the next section.

Setting up a virtual environment for FCU

We recommend installing FCU on an isolated virtual environment, probably the same one your factory tool uses, to avoid conflicts with any other Python packages installed on your system.

Tip: For more details on virtual environments, see virtualenv.

Note: The process of setting up a virtual environment, described below, involves downloading and installing software from the internet. Be sure to carefully examine downloaded content and scan it for malware or viruses.

To create a new virtual environment for FCU:

  1. Download Python version 3.5-3.7:

  2. Extract the downloaded archive to a location of your choice.

    We will assume:

    • C:\extracted-fcu-archive\fcu for Windows.
    • ~/extracted-fcu-archive/fcu for Linux.
  3. Create a virtual environment in a location of your choice. The examples below use c:\extracted-fcu-archive\fcu for Windows and ~/extracted-fcu-archive/fcu for Linux.

    • In Windows, run:

      py -3 -m virtualenv C:\extracted-fcu-archive\fcu-venv
    • In Linux, run:

      python3 -m virtualenv ~/extracted-fcu-archive/fcu-venv
  4. Activate your virtual environment:

    Navigate to the virtual environment directory you created and run the activate command:

    • In Windows, run:

    • In Linux, run:

      ~/extracted-fcu-archive/fcu-venv/source bin/activate