====== Mervis RT licencing ====== Every controller running Mervis has to be, since **Mervis IDE 2.3.0**, licenced in order tu run without any limitation. The license is provided free of charge for each [[https://www.unipi.technology/patron-c44|Patron]] and [[https://www.unipi.technology/neuron-c2|Neuron]] controller. ;;# Patron \\ Neuron \\ Gate \\ Unipi 1.1 \\ Axon ;;# Prerequisites: * Unipi controller running **Mervis OS v2.3.0** * **Mervis IDE v2.3.0** * [[en:sw:01-mervis:updating-a-runtime-hidden|Updating runtime (RT)]] * 24 V⎓ power supply * Internet connection (only from the PC running Mervis IDE, not the PLC) * Valid registration at [[https://www.unipi.technology/|Unipi]] * Valid Mervis RT licence ===== Why the PLC be has to licenced? ===== If the PLC is not licenced, it will run in **demo mode**. The demo mode does not limit the functionality, but the program will run only for **20 minutes**. After that time, the program will stop running and RUN LEDs will start blinking in a 2-second interval (on/off). ===== How to obtain the licence? ===== To obtain the licence please follow [[en:sw:01-mervis:getting-mervis-licence-hidden|this tutorial]]. **The code on the "Licence request" card is not a licence** for the Mervis RT and serves for obtaining the licence itself by entering it in your customer account on the [[https://www.unipi.technology/getmervis|Unipi technology]] web.
===== How can I find out if the PLC is licenced? ===== The licence status of the PLC is displayed in the "**[[en:sw:01-mervis:creating-new-project-hidden#attaching_to_the_controller|Attach PLC]]**" dialog. \\ The current licencing status of the given PLC is displayed in the **Licence** column.
---- Another way to check the license status is to connect to the controller in a debug mode. \\ Click **Start Debugging** on the upper ribbon.
Then select the **System Status** window in the middle part of the Mervis IDE, where you will find the item **License status**, on the first line, marked according to the controller name.
==== There are several possible PLC states: ==== Unknown \\ The PLC runs an older Mervis RT that does not support licencing. You need to update the RT, or load a new OS image into the PLC. Not licenced \\ Mervis RT supports licencing, but no licence is detected. The PLC runs in the DEMO mode. OK \\ The PLC is properly licenced and the program is running without any limitation. Wrong HW \\ The licence loaded into the PLC does not correspond to the given hardware. This situation will occur if: * Neuron - the SD card has been changed from a already licenced PLC to a different one * Unipi 1.1. and Unipi lite - the Raspberry Pi has been changed * Axon - licenced PLC has been backed up and the restored to a different Axon unit In this case it is neccesarry to put the setup into the original state or use a new licence. In case of [[https://www.unipi.technology/return|repair (warranty or post-warranty)]], the same licence can be used again, but the whole licencing procedure has to be done again. See more: [[#licensing_after_a_repair_warranty_or_post-warranty_of_the_controller|Licensing after a repair (warranty or post-warranty) of the controller]] Wrong product \\ The reason is the same as with the Wrong HW error, but in this case, the SD card from a licenced controlled was used in a different product line (ie. a SD card from Neuron is used in Unipi 1.1, or a card from Unipi 1.1 transferred to Unipi 1.1 Lite). ===== How to licence a Unipi PLC? ===== Open Mervis IDE and create a new project, or open an already existing one. **[[en:sw:01-mervis:creating-new-project-hidden#attaching_to_the_controller|Attach a PLC]]**.
Right-click on the PLC and select //"PLC Operations -> Licencing"//.
A new **Licencing** window will open. Click on **Download** to download all information about the PLC necessary for licencing.
A successful download is indicated by a green-coloured //"Hardware Description downloaded"// message.
Enter the licence number obtained from your customer account and your e-mail address. We recommend entering the same e-mail you used for registration on the Unipi e-shop. Then click on **Activate**.
Mervis IDE will now connect to a licencing server to check validity of the entered licence. If the activation is successful, a green-coloured //"Success"// message will appear. All you need to do now is to just click on **Upload** to upload the licence into the PLC.
If a green-coloured //"Activated Licence uploaded"// message will appear, the process was successful and the PLC will automatically reboot.
After restarting the controller, wait at least one minute for the controller to start. To verify licensing, run the **[[en:sw:01-mervis:creating-new-project-hidden#attaching_to_the_controller|Attach PLC]]** dialog, or enter debug mode and check the license status in **System Status**. Each time you **Attach PLC**, you will see the controller with a valid and active license, as shown on the picture below. The running time of the program is no longer limited.
The licencing procedure can also be done remotely using Mervis Proxy. The last important step is to write [[https://www.unipi.technology/getmervis|licence notes]]. We always recommend stating at least: **model, serial number and location/placing of the controller**.
===== How is the license bound to the PLC? ===== Each Mervis RT (RunTime) license can be used only once and just one controller can be licensed. Once you use a license it cannot be used again on another controller. Unipi Patron, Axon, Gate \\ After activation, the license is bound to the controller. After flashing OS in the controller ([[en:hw:007-patron:image|Patron]], [[en:hw:025-gate:image|Gate]], [[en:hw:01-axon:image|Axon]]) it is necessary to upload the license from Mervis IDE, see: [[#licensing_mervis_rt_after_flashing_os|Licensing Mervis RT after flashing OS]]. Unipi Neuron \\ After activation, the license is bound to the controller (not to the SD card). After replacing the SD card or [[en:hw:02-neuron:image|fleshing OS]] on the card, it is necessary to upload the license from Mervis IDE, see: [[#licensing_mervis_rt_after_flashing_os|Licensing Mervis RT after flashing OS]]. Unipi 1.1 & Unipi 1.1 Lite \\ After activation the license is bound to the given Raspberry Pi and Unipi 1.1 set (not to the SD card). The activated license can no longer be used on another combination of Raspberry Pi and Unipi 1.1. After replacing the SD card, or [[en: hw: 03-unipi11: image|flashing OS]] on the card, it is necessary to reactivate licence in the Mervis IDE, see: [[#licensing_mervis_rt_after_flashing_os|Licensing Mervis RT after flashing OS]]. ==== Licensing Mervis RT after re-flashing OS ==== If you have already licensed the controller once and have now flashed OS on the controller ([[en:hw:007-patron:image|Patron]], [[en:hw:025-gate:image|Gate]], [[en:hw:01-axon:image|Axon]]), or you have replaced the SD card or flashed OS on it ([[en:hw:02-neuron:image|Neuron]] / [[en:hw: 03-unipi11:image|Unipi 1.1]]), the process [[#how_to_licence_a_unipi_plc|Upload license to PLC]] must be completed again. The request for the confirmation "**License cannot be activated. Do you want to use the result of the last successful activation?**" dialog by clicking **OK** is the only difference: {{ :en:sw:01-mervis:license_last-activation_en.png?nolink |}} If you click the **Cancel** button instead of the **OK** button, licensing will end with an error message. ==== Licensing after a repair (warranty or post-warranty) of the controller ==== If the HW in the controller has been replaced or the Unipi 1.1 board has been replaced due to a complaint or service, reactivation is allowed for the given license and it is therefore necessary to perform the process [[#how_to_licence_a_unipi_plc|license activation]] again. **Before licensing it is NECESSARY** to check whether the serial number in the project corresponds to the current controller and if not, it is necessary to **[[en:sw:01-mervis:creating-new-project-hidden#attaching_to_the_controller|Attach PLC]]** again. Furthermore, it is **NECESSARY** to download the HW description again, even if the license dialog displays a green marked message //"Hardware Description downloaded"//. If you are unable to activate the controller with the original license, do not hesitate to contact our [[en:contact:00-start|technical support]]. Be sure to include the **license code** Mervis Runtime you want to use, as well as the exact **controller model, including the serial number.**