Install License Key
3 minute read
This page is applicable for the latest image version mcx-rtos-v.2024.01
. For other mcx-rtos-images checkout: Older versions.
Motorcortex Libraries require a license.lic
([hardwarekey].lic
) file to run in a production environment. This section will explain how to acquire and install license.lic
file. You can always run your Motorcortex application without a license key, but the program will exit after 30 minutes.
Prerequisites
- Laptop
- Motorcortex.io account
- Motorcortex Controller with running a application connected to laptop
Log into the Motorcortex controller from the console using a screen and keyboard or through ssh as described in Remote Access & File Transfer.
Acquire The License File.
For generating a license file the controller Hardware key is needed.
-
Email this hardware key and list of components to
license@vectioneer.com
-
You wil receive a
123456789.lic
file trough E-mail, where the filename corresponds to the Hardware Key.
Installing the license file on the controller.
The license file can be stored in any location on the controller and can have any filename, as long as the “license” tag in the config.json file points to this file.
You can therefore add the license file into the configuration package so you can deploy it through the portal. The drawback is that for every controller hardware, you need to have a separate configuration package. The solution is to install the license in a differnt location than the configuration folder, so it does not get overwritten if you deploy the configuration and the license file stays with the machine.
Preferred method: install the license file in /etc/motorcortex
The license file can be stored in a location that is not affected by deploying a configuration. The license now stays with the controller regardless of the configuration that is deployed. A convenient location for the license is /etc/motorcortex/
, this file directory is not overwritten when deploying a new configuration.
Note
If you upgrade mcx-os this procedure has to be repeated.
-
Inside config.json change license path to:
"License": "/etc/motorcortex/license.lic"
. -
copy the license to the controller via ssh
scp 123456789.lic admin@192.168.2.100:
. This will copy the license to the admin home folder: /home/admin/123456789.lic. -
Log into the controller and move the license file to
/etc/motorcortex/
with following command:
sudo mv /home/admin/123456789.lic /etc/motorcortex/
- To make sure that the target name of the license file in the config.json file is a generic name, like “license.lic”, so you can deploy the configuration to any hardware without having to adjust the name of the license file every time, you can create a symbolic link with that generic name “license.lic”:
cd /etc/motorcortex
ln -s 123456789.lic license.lic
- Confirm if the
symbolic link
is created:
ls -lart
In the output you should see:
license.lic -> 123456789.lic
Now your license
is bound to the controller hardware and will not be overwritten when deploying a configuration.
Installing the license in the configuration package
-
Go to login to your
motorcortex.io
account and openyour project
-
Browse to the configuration package.
-
Place the
123456789.lic
file in the configuration package (if you have to upload the file pressfiles
under theUPLOAD
tab on the right).
-
Open the
config.json
file. -
In
line #10
change “licence.pem” to the name of your123456789.lic
file.
-
Press save and exit the file.
-
Now you can deploy the configuration to the controller and the license should be correctly installed.
Check If The License File Is Valid
A license file is valid
if it matches the controllers Hardware Key
and application: List of Components
and List Of Features
. The status of the license can be seen in the log of the motorcortex application:
mcx-lastlog | grep License
If your license check turns out invalid
: check if your Hardware Key
, List Of Components
and List Of Features
matches your application.