Installing and starting logi.RTS on Raspberry Pi

Requesting a license (incl. determining the serial number of the Raspberry Pi)

Without activated license, you can operate the runtime system as demo version only – as a full version for 1 hour after starting the runtime system . For a longer operation, it is recommended that you request and install a license.

  1. Again within the terminal window of PuTTY: Determine the serial number of your Raspberry Pi.

    cat /proc/cpuinfo

    Result: The serial number is displayed in the output, next to Serial. Preferably, select the serial number incl. all leading 0 in this output (this copies the serial number into the clipboard).
    Example for a serial number: 000000003ff12a33

  2. Create an e-mail to license@logicals.com.

  3. Enter the following data (as text) and send the mail.
    (Preferably, paste the copied serial number from the clipboard into the mail.)

    Name:
    Name of company:
    Address:
    Serial number of the Raspberry Pis:
    Target platform: Raspbian/ARM11
    Features: (Add a "x" for each requested feature.)
    [x] RTS
    [ ] MODBUS 

    See FAQ-article "Which features are provided for logi.RTS", if you need information on the features.

You will obtain a license file logirts.lic from logi.cals. This license file is only valid for your Raspberry Pi.

Installing logi.RTS on Raspberry Pi

Version for logi.RTS to be installed

Install the version of logi.RTS that is included in the downloaded package. See "Release notes for current version" for information which version of logi.RTS is valid for the current version of logi.CAD 3.
But mind the following: If you are using versions < 2.3.602 of logi.RTS, there might be unexpected terminations of the licensed logi.RTS version on the Raspberry Pi.

  1. Again within the terminal window of PuTTY: Create the directory /opt/RTS on the Raspberry Pi and change into this directory.

    mkdir –p /opt/RTS
    cd /opt/RTS
  2. Transfer the file logiRTS_Vx.y.z_Raspbian.tar.gz onto the Raspberry Pi. The tar.gz-file is included in the delivery range of logi.CAD 3. x.y.z is a placeholder for the respective version number.

    1. Open a command prompt of your operating system.

    2. Go to the directory where PSCP (the file pscp.exe) is located.

    3. Copy the logiRTS_Vx.y.z_Raspbian.tar.gz into this directory.

    4. In this command prompt, enter the following command:

      pscp logiRTS_Vx.y.z_Raspbian.tar.gz root@IP_ADDRESS:/opt/RTS/logiRTS_Vx.y.z_Raspbian.tar.gz

      Example in case of IP-address 192.168.1.225 of a Raspberry Pi and logi.RTS version 2.3.602:

      pscp logiRTS_V2.3.602_Raspbian.tar.gz root@192.168.1.225:/opt/RTS/logiRTS_V2.3.602_Raspbian.tar.gz
    5. Enter the password for user root.

  3. Again within the terminal window of PuTTY: Check whether the file has been transferred.

    ls -lah

    The file logiRTS_Vx.y.z_Raspbian.tar.gz must be listed.

  4. Unpack the file. Replace x.y.z by the respective version number.

    tar --no-same-owner -xzf logiRTS_Vx.y.z_Raspbian.tar.gz
  5. Check whether the file has been unpacked.

    ls -lah

    The sub-folders of logi.RTS must be listed (e.g. sub-folder bin).

  6. Delete the file logiRTS_Vx.y.z_Raspbian.tar.gz on the Raspberry Pi. Again, replace x.y.z by the respective version number.

    rm logiRTS_Vx.y.z_Raspbian.tar.gz

Installing the license

Install the license for logi.RTS only, if logi.RTS has already been installed on the Raspberry Pi.

  1. Copy the license file logirts.lic into the directory where PSCP (the file pscp.exe) is located.

  2. In the command prompt still open, enter the following command:

    pscp logirts.lic root@IP_ADDRESS:/opt/RTS/logirts.lic

    Example in case of IP-address 192.168.1.225 of a Raspberry Pi:

    pscp logirts.lic root@192.168.1.225:/opt/RTS/logirts.lic
  3. Enter the password for user root.

Of course, it is possible to install the license later on: Just transfer the license file logirts.lic into the directory opt/RTS on the Raspberry Pi. Until you have done so, logi.RTS is operated as a demo version.

Configuring logi.RTS: traces in "PLC Logging" view and in syslog

Only necessary, if you want to have logi.RTS traces displayed in the PLC Logging view of logi.CAD 3 without a connection to the Raspberry Pi:

  1. Define the environment variable RTS_LOG_UDP.
    You are able to define environment variables by using the command export e.g. in a terminal window of PuTTY. If in doubt, ask an administrator for support.
    Example for defining the environment variable:

    export RTS_LOG_UDP=192.168.1.239:7777
  2. As value, first define the IP-address of the computer where logi.CAD 3 is used, then add : and conclude with the port 7777. Hence, the value for a computer with IP-address 192.168.1.239 is: 192.168.1.239:7777
    If you do not know the IP-address, ask your administrator for this piece of information.

Only necessary, if you do not start logi.RTS via systemd but you want to have logi.RTS traces displayed in the →syslog of the Raspberry Pi nevertheless:

  • Define the environment variable RTS_LOG_SYSLOG.
    You are able to define environment variables by using the command export e.g. in a terminal window of PuTTY. If in doubt, ask an administrator for support.
    Example for defining the environment variable:

    export RTS_LOG_SYSLOG=1

    images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg Effects:

    • The following output is filed according to the system logging configuration of the target system:

      • log messages of the runtime system

      • log messages of the Trace block within the PLC-programs

      • all log messages of →vendor blocks when using the RT_TRACE() macro or the rt_trace() functions

    • By default, traces of the runtime system are filed in a file within the directory /var/log of the target system. Usually this file is:

      • /var/log/messages in case of systems that are using SysV-Init and the "syslog" service (usually, these are older systems)

      • /var/log/syslog in case of systems that are using the "SystemD" service (current Linux distributions, such as Ubuntu 18)

    • In order to change the filing location, adjust the configuration in the system files (/etc/syslog.conf, /etc/syslog.d/, /etc/rsyslog.conf/, /etc/rsyslog.d/). See the following websites for more information:

    • images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg Logging of the traces of the runtime system to syslog influences the behavior of the runtime system.

    • images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/warning.svg In case of SystemD based systems without installed Syslog service, it might be necessary to use journactl in order to display the output. The reason for this is because the above-mentioned files do not exist.

    Notes:

    • If the runtime system is started as SystemD service, it is not necessary to activate the logging via the syslog mechanism. The output is automatically saved in the SystemD journals. It is possible to display them by using the system-specific logging viewer (e.g. by journalctl --unit=logirts).

Starting logi.RTS on Raspberry Pi

  1. Again within the terminal window of PuTTY: Change into the directory opt/RTS/bin of the Raspberry Pi.

    cd /opt/RTS/bin/
  2. Start logi.RTS on the Raspberry Pi. Press the Enter-key until the input mask of the terminal window is visible again.

    ./startPLC &

Starting logi.RTS at system start

Add logi.RTS to the system start by systemd or using an init script file. Subsequently, logi.RTS will run after each reboot of the Raspberry Pi.

System start by using systemd

Start using "systemd"

If you want to use systemd for starting logi.RTS and you need details on the procedure, c ontact the support team of logi.cals for more information . .
See https://freedesktop.org/wiki/Software/systemd/ for information on systemd.

Creating a service file

  1. Create an empty service file for logi.RTS.

    nano /lib/systemd/system/logirts.service
  2. Copy the following lines into this file (observe that there are no empty lines inserted by mistake at the beginning of the file):

    [Unit]
    Description=RTS
    # uncomment the following line if your system needs a codemeter stick for the licence
    #Requires=codemeter.service
    After=multi-user.target
     
    [Service]
    Type=simple
    WorkingDirectory=/opt/RTS
     
    Environment="LD_LIBRARY_PATH=/opt/RTS/lib"
    # enter the ip address of your development system in the next line, if you want to see RTS traces in the development environment
    Environment=RTS_LOG_UDP=127.0.0.1:7777
    ExecStart=/opt/RTS/bin/RTSLoader -b /opt/RTS/PLC
    Restart=on-failure
    RestartSec=1
     
    [Install]
    WantedBy=multi-user.target
  3. Save the changes and exit the editor: Press Ctrl+O (and confirm the file name), then press Ctrl+X.

Activating the new service

systemctl daemon-reload
systemctl enable logirts.service

System start by using init script file

Creating an init script file

  1. Create an empty init script file for logi.RTS.

    nano /etc/init.d/startPLC
  2. Copy the following lines into this file (observe that there are no empty lines inserted by mistake at the beginning of the file):

    #!/bin/sh
    ### BEGIN INIT INFO
    # Provides: RTSLoader
    # Required-Start:
    # Required-Stop:
    # Default-Start: 5
    # Default-Stop: 0 1 2 3 4 6
    # Short-Description: Starts RTS
    # Description:
    ### END INIT INFO
     
    case "$1" in
    start)
    cd /opt/RTS/bin
    ./startPLC &
    echo "Starting logi.RTS"
    ;;
    stop)
    sudo pkill RTSLoader
    echo "logi.RTS stopped"
    ;;
    *)
    echo "Usage: /etc/init.d/startPLC {start|stop}"
    exit 1
    ;;
    esac
    exit 0
  3. Save the changes and exit the editor: Press Ctrl+O (and confirm the file name), then press Ctrl+X.

  4. Change the permissions for the file.

    chmod +x /etc/init.d/startPLC
  5. Convert the file to Unix (so that possibly problematic Windows characters are removed).

    dos2unix /etc/init.d/startPLC

Adding init script file to the system start

update-rc.d startPLC defaults

Restarting Raspberry Pi and logging on as user "root"

  1. Restart the Raspberry Pi in order to accept all changes made until now.

    shutdown now -r
  2. Confirm the displayed messages.

  3. Wait for about 1 minute. Then in PuTTY, re-connect to the Raspberry Pi: Open the system menu of PuTTY (by clicking the system icon in the title bar) and select command Restart Session.

  4. Log on as user root with the password.

    login as: root
    root@192.168.1.225's password: _password for root_

    The text for the password is not displayed in the terminal window

  5. Check whether logi.RTS are really started.

    ps aux | grep RTS

    The listed processes must include RTSLoader.

Closing PuTTY and command promt

As there are no more steps to be done directly on the Raspberry Pi while following this tutorial, close PuTTY and the command prompt (double-click on the system icon in the title bar).