Contents

GigEConfig Tool

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

Note

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

  • In this document, you will find labels of ‘Edge Insights for Industrial (EII)’ for file names, paths, code snippets, and so on. Consider the references of EII as Open Edge Insights for Industrial (Open EII). This is due to the product name change of EII as Open EII.

Generating PFS (Pylon Feature Stream) File

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

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

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

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

    sudo <PATH>/pylon5/bin/PylonViewerApp
    
  3. Using the Pylon Viewer application follow below steps to gererate 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

In case one needs to configure the camera using Pylon Viewer make sure 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 make sure following steps are executed:-

  1. Refer GenICam GigE Camera([WORK_DIR]/IEdgeInsights/VideoIngestion#genicam-gige-or-usb3-camera) and follow the pre-requisities required to work with Basler GenICam GigE cameras and make sure provisioning is done by referring 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. Details on setting up and using python virtual environment can be found here: https://www.geeksforgeeks.org/python-virtual-environment/

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

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

    Note: This step is required everytime provisioning is done. Caution: This step will make the certs insecure. Please 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 pipeline according to user requirement

optional arguments:

-h, --help

show this help message and exit

—pfs_file PFS_FILE, -f PFS_FILE To process pfs file genrated by PylonViwerApp (default: None)

--etcd, -e

Set for updating etcd config (default: False)

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

–root_key ROOT_KEY, -r_k ROOT_KEY

Provide path of root_client_key.pem (default: None)

—root_cert ROOT_CERT, -r_c ROOT_CERT Provide 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 host IP (default: localhost)

–port PORT, -port PORT

Etcd host port (default: 2379)


config.json([WORK_DIR]/IEdgeInsights/tools/GigEConfig/config.json) consist 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 following elements:-

  • pipeline_constant: Specify the constant gstreamer element of pipeline.

  • plugin_name: The name of the gstreamer source plugin used

  • device_serial_number: Serial number of the device to which the plugin needs to connect to:

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


Execution of GigEConfig

The tool can be executed in following manner :-

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

  3. In case etcd configuration needs to 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 please change the permissions of the certificates i.e :-

    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. In case only pipeline needs to be printed.

    python3 GigEConfig.py --pfs_file <path to pylon's pfs file>
    
  5. In case 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 please change the permissions of the certificates i.e :

    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>