Software Installation
IDE Installation
In Linux
Installing VS Code
For Linux, use the VS Code IDE, for which the latest source can be found at: https://code.visualstudio.com/download
-
If using Ubuntu, select the .deb format, or APT
$ sudo apt update $ sudo apt install software-properties-common apt-transport-https wget # (on WSL2, you can stop here. Vs code can be installed now, with `code .`) $ wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add - $ sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" $ sudo apt install code
-
Run VS Code, and from the Extensions side bar (CTRL+SHIFT+X OR Menu View > Extensions)
-
Run the following installations:
- Nuget Package Manager
- C# (Base Language support)
- C# .Net 6.0 SDK for Linux (see below)
.Net 6.0, For C# development
Note
The HCC2 software is currently using Microsoft .NET SDK version 6.0 internally, so please download .NET 6.0 of the C# SDK.
By matching .NET versions, you can apply the installed .NET libraries to your application, reducing the application's Docker container size.
This may change in the future.
The C# SDK can be installed with this command:
sudo apt install dotnet-sdk-6.0
To install manually:
-
Download the appropriate installer for C# .NET from the following location: .Net Download
-
Run the installer (assuming the .NET package is located in
$HOME/Downloads
)mkdir -p $HOME/dotnet && tar zxf Downloads/dotnet-sdk-6.0.418-linux-x64.tar.gz -C $HOME/dotnet
-
Edit your shell profile file (
$HOME/.profile
if using Ubuntu) and add the following lines at the end of the file:export PATH=$PATH/usr/share/dotnet export DOTNET_ROOT=/usr/share/dotnet
-
Execute the following commands:
The correct version of dotnet should be indicated.source $HOME/.profile dotnet --version
-
Restart VS Code
Installing Nuget Package Manager
- Open VS Code.
- Press
Ctrl-Shift-X
. - In the top textbox (left) write
NuGet Package Manager
. Find it in the list (should be the first). - Press Install.
In Windows
Installing VS Code
-
If you are using the VS Code IDE, navigate to https://code.visualstudio.com/download and select the appropriate Windows installer to install Visual Studio Code.
-
Start VS Code, press
CTRL+SHIFT+X
or choose Menu View > Extensions to display the Extensions sidebar, and run the following installations:- Nuget Package Manager
- C# (Base Language support)
- C# .Net 6.0 SDK for Linux (see below)
-
Install C# tools for Visual Studio Code from Visual Studio Marketplace
Installing Development Tools
Installing Python
-
Install python3 (it is already installed in ubuntu 20.04). Follow the instructions found here: Installing Python3.
-
Install PIP tool (if not already installed):
sudo apt install python-3-pip
-
Install pymodbus python package. Run the following commands:
If you receive an error in WSL2 involving "externally-managed-environment", then you may need to enable a virtual environment (venv) to install pymodbus. Typically you will needcd $HOME pip install pymodbus==3.6.2
sudo apt install python3.11-venv && python3 -m venv .venv && source .venv/bin/activate && pip install pymodbus==3.6.2
. Thereafter, each time you want to run the python application you will need tosource .venv/bin/activate
.
Installing Git
The "Git" version control system is used throughout this document and should be installed from git-scm.com.
To use apt
run the following command:
sudo apt-get -y install git
Installing Docker
-
Go to page: Install Docker Engine on Ubuntu. There you’ll find the exact instructions to install Docker in Ubuntu 22.04.
-
Add your user to the Docker group. Run the following command:
sudo groupadd docker sudo usermod -aG docker $USER
If you are running a Windows/WSL environment, Docker Desktop is available from Docker.com.
Installing Mender
-
Install mender-artifact by following the instructions at doc.mender.io. Select Linux platform.
-
Once downloaded (assuming it is in
$HOME/Downloads
), run the following commands:sudo chmod +x $HOME/Downloads/mender-artifact sudo cp $HOME/Downloads/mender-artifact /usr/local/bin/
Note
If mender-artifact is not owned by ‘root’ then enter the following command:
sudo chown root mender-artifact
-
To check mender-artifact is correctly installed, type:
mender-artifact
You may get this error:
mender-artifact: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory.
In this case, you can download the installer for this missing library file from: nz2.archive.ubuntu.com
Look for the file:
libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb
.Please see details below:
-
Install the previously downloaded file, using the Software Install utility (in ubuntu 20.04) or using the following command:
sudo dpkg -i $HOME/Downloads/libssl1.1_1.1.1f-1ubuntu2.20_amd64.deb
-
Check the version of mender-artifact by running the following command:
You should see the following output:mender-artifact –version
mender-artifact version 3.11.0