Skip to content
Snippets Groups Projects
Select Git revision
  • fb0880146df3bbfa604eefa325c6defa1475431a
  • master default protected
  • L2SS-2374
  • dither_on_off_disabled
  • yocto
  • pypcc2
  • pypcc3
  • 2020-12-07-the_only_working_copy
  • v2.0
  • v1.0
  • v0.9
  • Working-RCU_ADC,ID
  • 2020-12-11-Holiday_Season_release
13 results

pypcc

  • Open with
  • Download source code
  • Your workspaces

      A workspace is a virtual sandbox environment for your code in GitLab.

      No agents available to create workspaces. Please consult Workspaces documentation for troubleshooting.

  • kruger's avatar
    Paulus Kruger authored
    fb088014
    History

    PyPCC

    Python OPC-UA server to control the I2C devices in the LTS.

    • pypcc2.py: OPC-UA server that expose (visible) variables and methods.

    Prerequisites

    Requirements

    This Python3 code uses other Python3 modules:

    • opcua
    • recordclass
    • numpy

    We recommend to install a virtual environment and then install the dependencies there. For convenience we have added the relevant modules to the file requirements.txt that can be used to install them with pip3: python3 -m pip install -r requirements.txt

    Below are step-by-step instructions that show how to install the dependencies neatly in a Python3 virtual environment.

    # Create a Python3 virtual environment with the name "env"
    python3 -m venv env
    # Activate the virtual environment
    . env/bin/activate
    # Update the already installed modules in the virtual environment since they are usually outdated
    python3 -m pip install --upgrade pip wheel
    # Deactivate the virtual environment and start it again
    deactivate
    . env/bin/activate
    # And finally install the module dependencies
    python3 -m pip install -r requirements.txt

    Execute it

    The software can be simply executed with Python3: python3 pypcc2.py -c RCY,CLK,UNB2

    Optional parameters are explained when the -h or --help parameter is supplied:

    python3 pypcc2.py --help
    cryptography is not installed, use of crypto disabled
    cryptography is not installed, use of crypto disabled
    usage: pypcc2.py [-h] [-s] [--no-lib-hack] [-p PORT]
    
    optional arguments:
      -h, --help            show this help message and exit
      -s, --simulator       Do not connect to I2c, but simulate behaviour.
      -p PORT, --port PORT  Port number to listen on [4842].
      -c ..
      -t ...