# Customize C# Tutorial
The C# tutorials can be customized and built to investigate how customer Edge modules work with the ABB Ability™ Edge. They can run as they are to debug the existing code or modified to explore how modifications of the code work. The following steps explain this process.
# Prerequisites
- Valid login to Ubuntu 18.04 LTS Server or Desktop installation, including the Ability SDK VM. Desktop version should be used if you want to debug new code locally. If Desktop version is not available, code can still be modified and built from command line editors like vi and Nano.
- Putty, RDP, or equivalent method to login
- Install .NET Core SDK
- Install Docker
- Set up valid RSA keys to access codebits or VSTS
- Verify setup for ABB proxy if on the ABB network
# Steps
- Log in to the machine.
- Look up the SSH path for the C# tutorial in either codebits or VSTS.
- Clone the latest code for the Ability Platform Release you have been assigned.
# codebits.abb.com
git clone -b 20.10 git@codebits.abb.com:ABB-Ability-Client-Success-Team/tutorials/edge-modules-csharp.git
# or VSTS
git clone -b 20.10 Abilityplatform@vs-ssh.visualstudio.com:v3/Abilityplatform/Ability%20Client%20Success%20Team/Edge.SDK.Tutorial.csharp
- Copy the example.access.json to access.json. Update the file to reflect the released versions of the edge_proxy and edge_broker.
# codebits.abb.com
cd ~/edge-modules-csharp
cp example.access.json access.json
# or VSTS
cd ~/Edge.SDK.Tutorial.csharp
cp example.access.json access.json
- Edit the
access.json
and set the Instanceenvironment
and location of the InstanceApp Utility, either the codebits or VSTS version.
{
"environment": "none",
"vsApp": "/home/must-update/Edge.SDK.InstanceApp",
"cbApp": "/home/must-update/instance-app",
"proxy": "abbability.azurecr.io/edge/proxy:2.4.15",
"broker": "abbability.azurecr.io/edge/broker:1.6.12-4"
}
The machine is now set up to build and deploy a custom version of one of the C#
tutorials. There are seven tutorials. In this example, 01-send-telemetry
is
built and deployed. The process is similar for all the tutorials. Where there
are differences, they will be noted.
# codebits.abb.com
cd ~/edge-modules-csharp
# or VSTS
cd ~/Edge.SDK.Tutorial.csharp
# list the projects
ll -d 0*
drwxr-xr-x 3 edge edge 4096 Oct 24 17:51 01-send-telemetry/
drwxr-xr-x 6 edge edge 4096 Oct 24 17:54 02-events-alarms/
drwxr-xr-x 3 edge edge 4096 Oct 24 17:51 03-remote-commands/
drwxr-xr-x 3 edge edge 4096 Oct 24 17:51 04-configurable/
drwxr-xr-x 6 edge edge 4096 Oct 24 17:51 05-inter-module-communication/
drwxr-xr-x 3 edge edge 4096 Oct 24 17:51 06-file-storage/
drwxr-xr-x 4 edge edge 4096 Oct 24 17:51 07-update-object-model/
In this example, the custom suffix for the related edge type definitions is
mylab01. The following steps will create a custom set of types in the
typesmylab01
folder, build the module, create the docker container, and load
the types into the environment specified in access.json
.
cd 01-send-telemetry
./custom-module.sh mylab01
./build-module.sh
./docker-mylab01.sh
NOTE
The process is slightly different for 05-inter-module-communication. Two docker containers must be built. If the custom name was the same, replace the ./docker-mylab01.sh with:
cd Aggregator
./docker-mylab01.sh
cd ../Telemetry
./docker-mylab01.sh
cd ..
The deploy.sh
script will load the types using the InstanceApp Utility.
cd typesmylab01
./deploy.sh
Once the types are loaded into the Instance, the type can be used with any Edge Installation