Contents

GigEConfig Tool

The GigEConfig tool can be used to read the Basler Camera properties from the Pylon Feature Stream (PFS) file and construct a gstreamer pipeline with the required camera features. The gstreamer pipeline that is generated by the tool can either be printed on the console or be used to update the config manager storage.

Note

This tool has been verified with the Basler camera only as the PFS file, which is a pre-requisite to this tool, is specific to the Basler Pylon Camera Software Suite.

Generating PFS (Pylon Feature Stream) File

In order to execute this tool, the user must provide a PFS file as a prerequisite. The PFS file can be generated using the Pylon Viewer application for the respective Basler camera by the following steps:

  1. Refer the following link to install and get an overview of the Pylon Viewer application:-

    https://docs.baslerweb.com/overview-of-the-pylon-viewer

  2. Execute the following steps to run the Pylon Viewer application:

    sudo <PATH>/pylon5/bin/PylonViewerApp
    
  3. Using the Pylon Viewer application, the following are the steps to generate a PFS file for the required camera:

    • Select the required camera and open it

    • Configure the camera with the required settings if required

    • On the application toolbar, select Camera tab-> Save Features

    • Close the camera

Note

If one needs to configure the camera using Pylon Viewer, ensure the device is not used by another application, as it can be controlled by only one application at a time.

Running GigEConfig Tool

Before executing the tool, execute the following steps:

  1. Refer to GenICam GigE Camera and follow the prerequisities required to work with Basler GenICam GigE cameras and ensure provisioning is completed by referring to Configmgr Readme

  2. Source build/.env to get all the required ENVs

    set -a
    source [WORKDIR]/IEdgeInsights/build/.env
    set +a
    
  3. Install the dependencies

    Note: It is highly recommended that you use a Python virtual environment to install the Python packages so that the system Python installation doesn’t get altered. For details on setting up and using the Python virtual environment, refer https://www.geeksforgeeks.org/python-virtual-environment/

    cd [WORKDIR]/IEdgeInsights/tools/GigEConfig
    pip3 install -r requirements.txt
    
  4. If using the GigE tool in PROD mode, make sure to set the required permissions on the certificates.

    sudo chmod -R 755 [WORKDIR]/IEdgeInsights/build/Certificates
    

    Note: This step is required every time provisioning is done. Caution: This step will make the certificates insecure, so do not do it on a production machine.

Usage of GigEConfig Tool

Script usage:

python3 GigEConfig.py --help



python3 GigEConfig.py [-h] --pfs_file PFS_FILE [--etcd] [--ca_cert CA_CERT]
                      [--root_key ROOT_KEY] [--root_cert ROOT_CERT]
                      [--app_name APP_NAME] [-host HOSTNAME] [-port PORT]

Tool for updating pipelines based on user input.

optional arguments:

-h, --help

show this help message and exit

—pfs_file PFS_FILE, -f PFS_FILE To process PFS file generated by PylonViewerApp (default: None)

--etcd, -e

Set for updating ETCD config (default: False)

—ca_cert CA_CERT, -c CA_CERT Provides path of ca_certificate.pem (default: None)

–root_key ROOT_KEY, -r_k ROOT_KEY

Provides path of root_client_key.pem (default: None)

—root_cert ROOT_CERT, -r_c ROOT_CERT Provides path of root_client_certificate.pem (default: None)

--app_name APP_NAME, -a APP_NAME

For providing appname of VideoIngestion instance (default: VideoIngestion)

—hostname HOSTNAME, -host HOSTNAME Etcd hsst IP (default: localhost)

–port PORT, -port PORT

Etcd host port (default: 2379)


config.json([WORK_DIR]/IEdgeInsights/tools/GigEConfig/config.json) consists of mapping between the PFS file elements and the camera properties. The pipeline constructed will only consist of the elements specified in it.

The user needs to provide the following elements:-

  • pipeline_constant:Specify the constant gstreamer element of the pipeline.

  • plugin_name:The name of the gstreamer source plugin used.

  • device_serial_number:The serial number of the device to which the plugin needs to connect to.

  • plugin_properties: Properties to be integrated into the pipeline. The keys in here are mapped to respective gstreamer properties.


Execution of GigEConfig

The tool can be executed in the following manner:

  1. cd [WORKDIR]/IEdgeInsights/tools/GigEConfig
    
  2. Modify config.json([WORK_DIR]/IEdgeInsights/tools/GigEConfig/config.json) based on the requirements

  3. If the ETCD configuration must be updated,

    1. For DEV Mode:

    python3 GigEConfig.py --pfs_file <path to pylon's pfs file> -e
    
    1. For PROD Mode:

    Before running in PROD mode, change the permissions of the certificates:

    sudo chmod 755 -R [WORDK_DIR]/IEdgeInsights/build/Certificates
    
    python3 GigEConfig.py -f <path to pylon's pfs file> -c [WORK_DIR]/IEdgeInsights/build/Certificates/rootca/cacert.pem -r_k [WORK_DIR]/IEdgeInsights/build/Certificates/root/root_client_key.pem -r_c [WORK_DIR]/IEdgeInsights/build/Certificates/root/root_client_certificate.pem -e
    
  4. If only the pipeline needs to be printed.

    python3 GigEConfig.py --pfs_file <path to pylon's pfs file>
    
  5. If a host or port is needed to be specified for ETCD.

    1. For DEV Mode:

    python3 GigEConfig.py --pfs_file <path to pylon's pfs file> -e -host <etcd_host> -port <etcd_port>
    
    1. For PROD Mode:

    Before running in PROD mode, change the permissions of the certificates:

    sudo chmod 755 -R [WORDK_DIR]/IEdgeInsights/build/Certificates
    
    python3 GigEConfig.py -f <path to pylon's pfs file> -c [WORK_DIR]/IEdgeInsights/build/Certificates/rootca/cacert.pem -r_k [WORK_DIR]/IEdgeInsights/build/Certificates/root/root_client_key.pem -r_c [WORK_DIR]/IEdgeInsights/build/Certificates/root/root_client_certificate.pem -e -host <etcd_host> -port <etcd_port>