Linux Support Package
|
Before you start, do the general preparation and setup from the article Running models on target hardware. It describes the general steps for running models on target hardware: environment preparation, connection, generation/assembly, and basic startup verification. |
The Linux target allows you to run the generated C model on a Linux device. The device is managed using OpenSSH: the model project is generated locally and copied to the Linux device via scp, is collected on the device via make and it starts as a separate process.
To configure the connection, use the block EDM-Target-Linux.
Required software
To run the model on the target hardware on the user’s computer (running the Client Program), the following utilities are required:
-
scp— a utility for copying generated code from a model Engee for target equipment; -
ssh— a utility for executing commands to compile and run models.
On the target Linux device used to run the models, the following must be available:
-
/bin/shor compatibleshell— for executing commands; -
make— for compiling and running models; -
pidof— to control the execution of models; -
OpenSSH server— SSH server configured to connect using a private key.
SSH Pre-configuration
If the client computer and the target Linux device are not configured to connect via SSH without a password, then use the utilities ssh-keygen and ssh-copy-id This can be achieved by following the instructions below.
On an SSH server (Linux)
-
Make sure that in
/etc/ssh/sshd_configkey authentication is enabled:PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys
-
Restart the SSH service:
sudo systemctl restart sshd # или sudo systemctl restart ssh
On the client (host) computer
-
Create a key pair (same for bash Linux/PowerShell Windows):
ssh-keygen -t ed25519 -C "<имя пользователя на целевом устройстве>@<адрес устройства>"
Will be created:
-
the private key:
id_ed25519; -
public key:
id_ed25519.pub.
-
-
Transfer the public key to the server:
-
Linux:
ssh-copy-id -i ~/.ssh/id_ed25519.pub user@serverIf
ssh-copy-idabsent:cat ~/.ssh/id_ed25519.pub | ssh user@server "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys" -
Windows:
Add the public key of the client computer to the file
authorized_keysto the server:type $env:USERPROFILE\.ssh\id_rsa.pub | ssh user@host "cat >> .ssh/authorized_keys"
-
Supported modes
For more information about the operating modes of Target Hardware, see the article Running models on target hardware.
|
When running the model interactively with configurable parameters, it is necessary in the model settings panel on the tab «Code generation» set for the parameter Default parameter behaviour meaning |
|
When running the model in interactive mode, there must be recorded at least one model signal. |