Skip to content

First Time Running

Install Python Version 13.1

NOTE The HCC2 Docker environment uses Python 3.13-Bullseye

Install Dependencies

cd path/to/this/folder
pip install -r "requirements.txt"

Warning

Python 3.13.x or later is required, as the code will not work as intended with any earlier version. Also, if any earlier version is installed, ensure it is on the PATH before installing this version.

Modify Application Configuration File

Start by renaming the application name and function_name to your own within the [config.json] file.

NOTE The application function name must be in camel case. Ex. myApp, application, app2

NOTE For the first time setup, leave the unmarked json value as is it is if you are not familiar with it.

{
  "app": {
    "name": "Sample Python HCC2 Application", <-- Rename.
    "function_name": "samplePythonApp", <-- Rename (MUST BE CAMEL CASE).
    "version": {
      "major": 1,
      "minor": 0,
      "micro": 0
    },
  "log_level": "info"
  },
  "registration": {
    "static_enabled": true,
    "targz": "./resources/configs/static/first_time_setup.tar.gz", <-- A simple TAR.GZ with 3 config and 1 general data point
    "dynamic_general_enable": false,
    "dynamic_config_enable": false
  },
  "heartbeat": {
    "interval": 30
  },
  "provisioning": {
    "complex": false <-- Leave as false for first time setup (Simple Provisoning)
  },
  "network": {
    "rest_ip_override": "172.17.2.100",
    "app_ip_override": "172.17.2.75"
  },
  "rest_api": {
    "port": 7071,
    "version": 1
  }
}

Configure Unity Network Settings

Select any of the following methods to connect your development PC to the HCC2.

Ethernet 1 Port (DHCP)

The HCC2 ETH-1 port uses DHCP by default and will be assigned an IP address according to the leasing rules of your router. Local Image

{
  "network": {
    "rest_ip_override": "192.168.0.10", <-- Assigned by your Router.
    "app_ip_override": "192.168.0.11" <-- Assigned by your Router / Set to a static IP on HCC2 subnet.
  },
}

Ethernet 2 Port (Static)

The HCC2 ETH-2 port is static at IP 192.168.1.41 by default. Local Image

{
  "network": {
    "rest_ip_override": "192.168.1.41",
    "app_ip_override": "192.168.1.100" <-- Set to your development PC IP on the same subnet.
  },
}

USB (Static)

No Unity network configuration is needed if connecting through the top panel USB-C port.

{
  "network": {
    "rest_ip_override": "169.254.1.1",
    "app_ip_override": "169.254.1.100" <-- Set to your development PC IP on the same subnet.
  },
}

Configure Unity Firewall Settings

Make sure the port 7071 is open on the HCC2 Ethernet port connected to your development PC. Below is an example of REST API port enabled on available endpoints. Local Image Local Image

Run and Verify Registration

The application comes with example code to dynamically register a number of different General and Config data points.

cd path/to/this/folder
python run.py
The output logs should look similar to this. Here the script has static registration enabled and has used first_time_setup.tar.gz, which contains 1 config and 1 general data point. It has no dynamic tags defined in [app.py] so the dynamic registration section is blank.

The application is now waiting for provisioning. Without provisioning the tasks will not run unless run_without_provisioning is set to True in [config.json].

[0][2025-03-12T18:31:28.040354Z][samplePythonApp][INFO] ---------------------------------------------
[0][2025-03-12T18:31:28.040882Z][samplePythonApp][INFO] Sample Python HCC2 Application (v1.0.0)
[0][2025-03-12T18:31:28.041242Z][samplePythonApp][INFO] ---------------------------------------------
[0][2025-03-12T18:31:28.042033Z][samplePythonApp][INFO] Supported REST Container Version 0.1.0-r20250219.3
[0][2025-03-12T18:31:28.042488Z][samplePythonApp][INFO] Supported REST API Definition V1
[0][2025-03-12T18:31:28.042874Z][samplePythonApp][INFO] Waiting For REST Server...
[0][2025-03-12T18:31:28.043184Z][samplePythonApp][INFO] Delaying 10 Seconds : Waiting For Rest Server
[0][2025-03-12T18:31:45.906219Z][samplePythonApp][INFO] REST Server IP: 172.17.2.100
[0][2025-03-12T18:31:45.907110Z][samplePythonApp][INFO] Sample Python HCC2 Application IP: 172.17.2.75
[0][2025-03-12T18:31:45.936824Z][samplePythonApp][INFO] REST Server Found
[0][2025-03-12T18:31:45.937522Z][samplePythonApp][INFO] ---------------------------------------------
[0][2025-03-12T18:31:45.937836Z][samplePythonApp][INFO] Registration
[0][2025-03-12T18:31:45.938193Z][samplePythonApp][INFO] ---------------------------------------------
[0][2025-03-12T18:31:45.938651Z][samplePythonApp][INFO] Static : True
[0][2025-03-12T18:31:45.939100Z][samplePythonApp][INFO] Dynamic General : False
[0][2025-03-12T18:31:45.939557Z][samplePythonApp][INFO] Dynamic Config : False
[0][2025-03-12T18:31:45.947858Z][samplePythonApp][INFO] Registering Existing TAR.GZ ./resources/configs/static/first_time_setup.tar.gz
[0][2025-03-12T18:31:46.016000Z][samplePythonApp][INFO] App Config Loaded samplePythonApp
[0][2025-03-12T18:31:46.034782Z][samplePythonApp][INFO] --------------------------------
[0][2025-03-12T18:31:46.035258Z][samplePythonApp][INFO] Static Data Points
[0][2025-03-12T18:31:46.035750Z][samplePythonApp][INFO] --------------------------------
[0][2025-03-12T18:31:46.036124Z][samplePythonApp][INFO] General:
[0][2025-03-12T18:31:46.036606Z][samplePythonApp][INFO]  - liveValue.production.this.samplePythonApp.0.sampleGeneral.
[0][2025-03-12T18:31:46.037030Z][samplePythonApp][INFO] Config:
[0][2025-03-12T18:31:46.037323Z][samplePythonApp][INFO]  - liveValue.postvalidConfig.this.samplePythonApp.0.sampleConfig.
[0][2025-03-12T18:31:46.037547Z][samplePythonApp][INFO] --------------------------------
[0][2025-03-12T18:31:46.037802Z][samplePythonApp][INFO] Dynamic Data Points
[0][2025-03-12T18:31:46.038011Z][samplePythonApp][INFO] --------------------------------
[0][2025-03-12T18:31:46.364546Z][samplePythonApp][INFO] --------------------------------
[0][2025-03-12T18:31:46.365563Z][samplePythonApp][INFO] Registration complete
[0][2025-03-12T18:31:46.366330Z][samplePythonApp][INFO] Delaying 5 Seconds : Core Application Registration
[0][2025-03-12T18:31:51.370063Z][samplePythonApp][INFO] Delaying 5 Seconds : First Provisioning
[0][2025-03-12T18:31:56.372210Z][samplePythonApp][INFO] ---------------------------------------------
[0][2025-03-12T18:31:56.373175Z][samplePythonApp][INFO] Starting Application samplePythonApp
[0][2025-03-12T18:31:56.374417Z][samplePythonApp][INFO] ---------------------------------------------
[0][2025-03-12T18:31:56.375161Z][samplePythonApp][INFO] ---------------------------------------------
[0][2025-03-12T18:31:56.375715Z][samplePythonApp][INFO] Waiting On Provisioning Data
[0][2025-03-12T18:31:56.376265Z][samplePythonApp][INFO] ---------------------------------------------
[0][2025-03-12T18:31:56.377355Z][samplePythonApp][INFO] Task Heartbeat Task starting
[0][2025-03-12T18:31:56.377907Z][samplePythonApp][INFO] Task Heartbeat Task : unprovisioned
[0][2025-03-12T18:31:56.386967Z][samplePythonApp][INFO] Task Main starting
[0][2025-03-12T18:31:56.402276Z][samplePythonApp][INFO] Task Main : unprovisioned

App Configuration Page

The config page contains all defined Config datapoints.

If no static or dynamic configuration data points are defined, the application will NOT have a config page in the Deploy tab.

Local Image

App Monitoring Page

The monitoring page contains all defined General datapoints.

If no static or dynamic general data points are defined the application will NOT have a operate page in the Operate tab.

Local Image

Deploy Application

Deploy the HCC2. You should see your application name appear in the list of applications.

NOTE Make sure the previous Network and Firewall configurations are still present. Port 7071 must be open on the interface your application is connecting to the HCC2 over.

NOTE If your application has complex provisioning enabled, it must validate provisioning data and respond with 15 seconds of an HCC2 deployment. If you do not POST a response to the REST API within this period the deployment will fail. See the Provisioning section below for details.

Local Image

Finally, your application's postvalidConfig and up tags should now appear in the Unity Live Data table. Filter by your application functionality name in the top left search bar.

NOTE General tags will not appear in Live Data until they are first written to.

Local Image