# InstanceApp Utility

The InstanceApp is a utility that will allow edge developers to load Edge types into an Ability Instance. Once loaded, Edge software can be installed and configured to connect to the Instance. After the Edge is running, the InstanceApp can invoke methods on devices.

The InstanceApp has been created with Visual Studio 2019 using .NET Core 3.1. The program can be run on Windows or Linux as needed. This document explains how to get the source code, configure the program to access your Ability Instance, and use the program.

# Building the Program for Windows

# Prerequisites

  • Windows Installation with Visual Studio 2019. This can only be an ABB BCE environment or an Azure VM in the same Azure Region as the Ability Platform.
  • Access to codebits or VSTS
  • Install the Google Chrome Browser

# Build steps

  1. Use Visual Studio to connect to codebits or VSTS to fetch the source for the InstanceApp. If VSTS access is not available, download the codebits version as a zip file and transfer it to the Azure Virtual Machine.
  2. Open the solution and build the application.

# Building the Program for Linux

# Prerequisites

  • Valid login to Ubuntu 18.04 LTS Desktop installation. Use this procedure to install an Azure Linux VM.
  • Install .NET Core SDK. This step will also install Visual Studio Code and Google Chrome.
  • Set up valid RSA keys to access VSTS. If VSTS access is not avaiable, use codebits from an ABB BCE environment on the ABB network to download the source to a zip file to transfer to the Azure environment.

# Build Steps

  1. Log in to the Linux Desktop.
  2. Look up the SSH path for the C# tutorial in either codebits or VSTS.
  3. Clone the latest code for the InstanceApp.
# codebits.abb.com
git clone git@codebits.abb.com:ABB-Ability-Client-Success-Team/Tools/instance-app.git
# or VSTS
git clone Abilityplatform@vs-ssh.visualstudio.com:v3/Abilityplatform/Ability%20Client%20Success%20Team/Edge.SDK.InstanceApp

TIP

codebits.abb.com is not available outside the ABB network. If the machine is located in Azure, the software must be downloaded as a zip or tar file, transferred to the Azure machine, and unpacked.

  1. The application should build without error.
# codebits.abb.com
cd instance-app
dotnet build 
# or VSTS
cd Edge.SDK.InstanceApp
dotnet build 

# Configure appSettings.json

The appSettings.json file must be updated to match the Ability Instance assigned with the correct solution and tenant login information. Follow this process.

# Program Usage

The InstanceApp functionality will facilitate the setup and deployment of Edge nodes. The functionality will be expanded in future updates to include other features.

The program is a command line program and can be run on Windows and Linux environments.

In Windows, a command prompt can be used, and the repo should be located in

c:\Users\<windows user>\source\repos

In Linux, a terminal window can be used, and the repo is located in the home folder. dotnet must be run from the solution folder.

# codebits.abb.com
cd instance-app
# or VSTS
cd Edge.SDK.InstanceApp

# Show help
dotnet run -Z

# Test Connection

To verify the tenant information is properly updated in the appSettings.json, the program can request abb.ability.device model. The program will use the configured default authorization to get a bearer token and then use that token to request the model.

dotnet run -i <name of environment> -N abb.ability.device

# Upload Type

Types can be loaded one file at a time or they can be all located in a folder. When in a folder, the files will be loaded in alphabetical order. It is common to use number prefixes on the files to load files in order, 01-file.json, 02-file.json, etc.. The default output will show terse output. If there are errors, additional information can be printed by adding the -X 5 option to the command line.

dotnet run -i <name of environment> -N PATH:<path to folder with json type files>
# OR
dotnet run -i <name of environment> -N FILE:<full path of json file to load> 

# Send Methods to Devices

The InstanceApp can also send commands to devices. It also supports methods that accept parameters.

dotnet run -i <name of environment> -C <method name>:<guid of device>
# OR
dotnet run -i <name of environment> -C <method name>:<guid of device> -J <json of parameters>
Last updated: 1/5/2022, 1:30:04 PM
Feedback