Licensing tool
Each node (implementing MiraOS, MiraMesh, or Border Gateway radio) needs a unique license from a license generator.
Every license is unique to the device, and cannot be copied from one device to another.
mira_license is a python script used to work with licenses and license dongles.
Instructions for installation of it is in the README.md file in the libmira/tools directory.
The first argument to the script says what sub-command to run.
To see the available sub-commands, run:
To see the available arguments to a sub-command, in this example the "report" sub-command, run:
Reading a status report from a License Generator¶
Use the mira_license.py
tool.
Where /dev/ttyXXXXX
is the device name for the License Generator UART interface.
The command generates a license report and either writes it the given filename or it is shown as output from the program.
The report shows the number of generated licenses, as well as the number of allowed licenses for this license dongle.
Reading the device ID of a connected device¶
To read the device ID of an NRF device, use:
To read the device ID of an mkw41z device, use:
NNNNN
is the serial number of the programmer, which can be retrieved using
nrfjprog --ids
. If -s NNNNN
is not provided, one of the connected device's
serial numbers are used.
The device ID is printed on the command line interface.
Signing a connected device¶
To sign an NRF device, when the license dongle is connected to the computer, run:
To sign an mkw41z device, use:
Where /dev/ttyXXXXX
is the device name for the License Generator UART interface.
NNNNN
is the serial number of the programmer, which can be retrieved using
nrfjprog --ids
.
AAAAA
is the origin of the 'FACTORY_CONFIG' area in the .ld script of the target.
LLLLL
is the length of the 'FACTORY_CONFIG' area in the .ld script of the target.
Generating license for a remote device¶
To generate licenses remotely the device ID must be specified. The device ID can be read out by this tool, is printed by MiraOS upon startup, and can be supplied at runtime via the Mira API, see API documentation. The license will be saved to a file.
Where/dev/ttyXXXXX
is the device name for the License Generator UART interface.IIIII
is the device ID of the target.FILE
is the name of the file created. The file is in text format, and the license
is in Base64.
The license can also be saved in Intel HEX format. In that case address and length must be specified.
Signing a device with remotely generated license¶
Where PROG
is the programmer.
AAAAA
is the origin of the 'FACTORY_CONFIG' area in the .ld script of the target.
LLLLL
is the length of the 'FACTORY_CONFIG' area in the .ld script of the target.
FILE
is the name of the license file. Must be a textfile generated with
generate
and -f
arguments.
Signing a gateway¶
Put the created NNNNN.lic file in thelicenses
sub-directory.
Where /dev/ttyXXXXX
is the device name for the License Generator UART interface.
NNNNN
is the device id of the gateway's radio. The gateway will write
the device name in its logs when the license is missing.
Using a custom linkscript¶
When using a custom linkscript one must ensure that the address (-a
) and length (-l
)
matches the origin address and length of the 'FACTORY_CONFIG' area in the custom linkscript.
API¶
To check license validity at runtime, see API documentation