/
Action.Net on Linux

Action.Net on Linux

The article shows you how to install and use some of the features of Action.Net on linux, starting with preparing the environment to running product modules. This article is based on the use of a Debian i386 virtual machine. However, all of the steps described can be used in other linux distributions on both virtual and physical machines and Raspberry Pi devices.

Warning: The installation commands presented in this document may vary depending on the Linux distribution used because each distribution uses a specific package manager. For example, Debian and Ubuntu use the apt, in Arch and Manjaro is used the pacmac and in Fedora the dnf.

Warning: This article is based on testing on linux virtual machines, using the Oracle VM VirtualBox as a virtualizer. Although you can use Microsoft Hyper-V and VmWare Workstation, all images in this article refer to VirtualBox. To apply specific settings applied here, in other virtualizers, refer to the user manual of the same.

 

Initial concepts

The Linux environment is different from other operating systems like Windows or Mac OS. It is necessary to understand some concepts to be able to configure the Action.Net in this operating system. In this item, we will cover some of these concepts. Feel free to skip this item and return only when you have any questions.

Here are some concepts:

Linux - Operating system that uses the Linux Kernel, created by Linus Torvald.

Distributions- They are different implementations of the system running on top of the Linux kernel. We have Major distributions which are more stable distributions, with a good development team behind them, as well as Ubuntu, Debian, Slackware, Fedora (formerly Red Hat), OpenSuse, CentOs, Arch, Alpine, Mint, Gentoo and FreeBsd. We also have Minor distributions that may have smaller development teams behind them and that derive from the major distributions. For example, Kubuntu and Neon derive from Ubuntu, Manjaro derives from Arch, among others.

Graphical user interface- Each distribution, when developed, can use one or another variation of graphical interfaces, which are developed in a modular way to suit the distributions. Among the most successful and available graphical interfaces are KDE and Gnome. KDE is a more Windows-like interface and Gnome is a more recently created interface with different visual elements. Among other interfaces, we can mention Unity (used by Ubuntu), Mate, Cinnamon, Xfce, among others.

Command terminal - The Linux command terminal is a powerful tool and widely used by users. Both newbies and experts in the operating system end up using this tool for all their needs. In searches for questions related to the use of distros, the vast majority of solutions involve the use of the terminal. In addition, there are many applications that use only the Linux terminal and do not even install a graphical interface. This is a tool that will be used a lot in this article.

sudo - Refers to the super user (administrator) of the operating system. This one has unlimited permissions within the system. Numerous Linux distributions add users to the operating system without permissions during system installation.

Package Management - On Linux, the installation of new applications or system modules is done, most of the time, from a system package manager. Each distribution uses a specific package manager. For example, Debian and Ubuntu use the apt, in Arch and Manjaro is used the pacmac and in Fedora the dnf.

There are already numerous visual package managers, pre-installed by distributions. However, the most common is to use the terminal to install and update packages.

Setting up the environment

Virtual machine creation

Initially, it is necessary to download an ISO image of some Linux distribution and create a virtual machine using this image. It is possible to create linux VMs on any hyper-virtualizer capable of running the operating system such as VirtualBox, Hyper-V, VmWare, ProxMox, Zen Server, etc...

After downloading the image, configure a new VM according to your virtualizer's user manual. For this specific article, we created a Debian virtual machine, i386 platform, with 8Gb of memory, 4 virtual processors and 100Gb of storage (dynamically allotable). Other tests were also carried out using Linux Ubuntu, x64 platform and with the same previous feature specifications and with identical results.

Assign permissions to the user

Many Linux distributions, by default, add a user for system access without the administration permissions required to install and update software and system packages. This is a security policy used by these operating systems.

To add a new user to the administration group sudo, open your Linux command terminal.

To log in to the terminal with the superuser, run the command:

Then run the following command to assign the created user super user privileges, replacing the entry <user> with the name of the user created in the installation:

Then, restart the operating system for the settings to be applied.

Operating system upgrade

As a best practice, it is necessary to update the operating system and its modules before installing a new package, such as Mono or Net-Tools.

Run the following commands in sequence and confirm the update if the terminal asks for confirmation (by typing "Y").

If Linux prompts you to restart the system, restart it and then perform the next steps.

Net-tools Installation

The net-tools package installs the command ifconfig to view the IP address of the machine, among other commands.

Run the following command to install net-tools

If Linux prompts you to restart the system, restart it and then perform the next steps.

Mono Installation

What is Mono?

The mono package is the package that runs .Net applications on multiple platforms.

To better explain what Mono is and what its participation within the ecosystem of the .Net platform, it is best to differentiate between it and the other implementations of the .Net Standard. The .Net Standard is an open source standard created by Microsoft to implement the functionalities of the .Net platform. Any developer (or team of developers) can implement this standard. Among the initiatives that have already had this work, we have the .Net Framework, Mono and .Net Core.

The .Net Framework is Microsoft's own implementation of the entire .Net Standard that provides a wide variety of functionality for operation in Windows environments on Workstations, Server, and in the cloud. It is the original implementation of .Net.

Mono is an open source, cross-platform implementation of .Net Standard with only the essentials to run .Net applications on different operating systems such as Android, IOS and with good acceptance for Linux. It is an older implementation compared to .Net Core.

.Net Core is a recent implementation (as of 2014) of the .Net Standard. It's open source and cross-platform just like Mono. Built for the Cloud era and with greater compatibility with .Net. It is supported on different operating systems like Linux, MacOs and Windows.

Installing mono on Debian

The following will show how to install Mono on the Debian distribution. However, Mono is compatible with several distributions Major such as Ubuntu, Fedora, Raspbian and CentOs. For information on how to install mono for these distributions, as well as more information about this package, click the link below to visit the Mono project page.

Download - Stable | Mono

To install mono on debian, you initially need to add your repository to the operating system. Run the following command:

After the repository is added, you can install the package by running the following command:

After installation, you can verify that Mono was actually installed with the Mono version check command:

This command should bring up the newly installed version of mono. Otherwise, try installing again by following the walkthrough of the mono project website from the link above.

Network Configuration

In the case of using virtual machines, it is important to use network switches in Bridge mode. Otherwise, some errors occur when using the Action.Net on some specific ports.

In VirtualBox, shut down the virtual machine, click the machine settings button, and in the Network section, make sure that the network adapter you are using is connected to the network card in Bridge mode.

Virtual machine network settings

Then, start the virtual machine again.

OpenSSH Installation

You must install OpenSSH on Linux to transfer files from Windows Action.Net to Linux.

Run the following command to install OpenSSH:

Copy files from Action.Net

Compress IoT folder

Initially, you need to create a file type .zip containing the IoT folder of the desired version of the Action.Net. This folder is located in the product installation folder in Windows (typically C:\Program Files (x86)\SPIN\Action.NET).

On a Windows machine that has Action.Net installed, open the File Manager, browse to the IoT folder and compress it into a file type .zip. If you want, copy the file to any other folder you want.

Copy compressed file to Linux

Then open the windows terminal, navigate to the folder where the file is .zip created and run the following command to copy the file from Windows to Linux, overriding the parameters described below:

Where:

  • <username> - Linux user with super permissions;

  • <ip> - IP of the Linux machine; and

  • <folder> - folder on Linux where the file will be copied.

 

Example:

Moving files on Linux

If you need to move a file on Linux, you can use the mv sourceFile DestinyFile.

Example:

Unzip files on Linux

Next, you need to unzip the copied file. To perform this operation on Linux, use the following command iot unzip.zip.

Running Action.Net applications on Linux

To run any project on Linux, you must first create a Linux-type project on the Action.Net that is installed on Windows, and then copy it.

On the Action.Net home screen, click New Project to open the Project Creation Wizard. As soon as the wizard opens, choose a name and select the option Linux / Mono in Target Framework.

After you create the project and make all the necessary configurations in the new project, you need to copy it to Linux. The Action.net makes this copy natively, however, it is necessary to run tProjectServer on Linux.

TProjectServer.exe

To run TProjectServer from the Linux terminal, first navigate into the "Iot/ProjectServer" directory with the command cd IoT/ProjectServer from the user's home folder.

Next, run the mono command to initialize TProjectServer using super user permissions:

After running the command, the ProjectServer for Linux screen is shown and the message "ProjectServer: Waiting client connections..." is shown in the terminal.

Licensing Action.Net on linux

To run Action.Net applications on linux, you also need to license it.

From the Project Server Running on Linux, click the Get located at the bottom of the application on the left, to generate the Sitecode.

The process of generating the licensekey is the same for the installation of Action.Net. For questions regarding this process, please contact SPIN support by email from SPIN support.

To apply the license key you received, you can do it in two ways:

1- Downloading the file on linux by clicking the button Apply, located next to the Get mentioned earlier and selecting the license file; or

2- From the home screen of the Action.Net on the Windows machine, open the tab Server and inform the linux IP. Then open the tab License and click the Load License key. The Action.Net will apply the license to the remote linux machine.

Copying projects to Linux

The Action.Net has a functionality of copying files and projects to the native linux of the tool. This functionality can be accessed from the Server from the product's home screen.

Enter in the field Remote the IP address of the Linux machine and click the Connect.

After connecting, the screen displays the buttons Update and Upload Project.

The button Update copies files from the folder C:/InstallFolder/Action.Net/an-x.x/Iot/ for Linux. It is used to update product files between Windows and Linux.

The button Upload Project copies projects (.tproj) to Linux. After clicking this button, select the project you want to submit. Then, the copy location confirmation screen is shown. Confirm the location and the Action.net will copy the project to the folder.

Running projects

It is possible to run projects sent to linux from the ProjectServer for linux.

Initially, click the Projects... and select the desired project. The selected project is shown in the Project Startup Settings.

Then run the project by clicking the Run. Or ProjectServer will run the tStartup and tServer and run all modules configured for project execution.

 

Other processes

TMQTTBroker.exe

To run Mqtt Broker, in the Linux terminal, navigate into the IoT/Runtime directory and run TMQTTBroker.exe with mono using the following command:

 

 

On this page:

 

Related content

Action.Net no Linux
Action.Net no Linux
More like this
Deploying Action.NET
More like this
Networked architectures
Networked architectures
More like this
The Action.NET platform
The Action.NET platform
More like this
ActionNet - Implementação de Relatórios DEC e FEC
ActionNet - Implementação de Relatórios DEC e FEC
More like this