Installing and starting the runtime system on Raspberry Pi
Previous: Configuring 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 3 hours after starting the runtime system. For a longer operation, it is recommended that you request and install a license.
-
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 leading0
in this output (this copies the serial number into the clipboard).
Example for a serial number:000000003ff12a33
-
Create an e-mail to license@logicals.com.
-
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 the runtime system", if you need information on the features.
You will obtain a license file logirts.lic
from Neuron. This license file is only valid for your Raspberry Pi.
Installing the runtime system on Raspberry Pi
Version for the runtime system to be installed Install the version of Neuron RTS max that is included in the downloaded package. See "Release notes for current version" for information which version of Neuron RTS max is valid for the current version of Neuron Power Engineer. |
-
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
-
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 Neuron Power Engineer. x.y.z is a placeholder for the respective version number.-
Open a command prompt of your operating system.
-
Go to the directory where PSCP (the file pscp.exe) is located.
-
Copy the
logiRTS_Vx.y.z_Raspbian.tar.gz
into this directory. -
In this command prompt, enter the following command:
pscp logiRTS_Vx.y.z_Raspbian.tar.gz <USER>@IP_ADDRESS:/home/USER/logiRTS_Vx.y.z_Raspbian.tar.gz
Example in case of IP-address
192.168.1.225
of a Raspberry Pi and Neuron RTS max version 2.3.602, the user isTTe
:pscp logiRTS_V2.3.602_Raspbian.tar.gz TTe@192.168.1.22:/home/TTe/logiRTS_V2.3.602_Raspbian.tar.gz
-
Enter the password for the user.
-
In this command prompt, enter the following command (replace the relevant data accordingly):
mv /home/USER/logiRTS_Vx.y.z_Raspbian.tar.gz /opt/RTS/
-
-
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. -
Unpack the file. Replace
x.y.z
by the respective version number.tar --no-same-owner -xzf logiRTS_Vx.y.z_Raspbian.tar.gz
-
Check whether the file has been unpacked.
ls -lah
The sub-folders of Neuron RTS max must be listed (e.g. sub-folder
bin
). -
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 Neuron RTS max only if Neuron RTS max has already been installed on the Raspberry Pi.
-
Copy the license file
logirts.lic
into the directory where PSCP (the file pscp.exe) is located. -
In the command prompt still open, enter the following command:
pscp logirts.lic <USER>@IP_ADDRESS:/home/<USER>/logirts.lic
Example in case of IP-address
192.168.1.225
of a Raspberry Pi, the user isTTe
:pscp logirts.lic TTe@192.168.1.225:/home/TTe/logirts.lic
-
Enter the password for the user.
-
In this command prompt, enter the following command (replace the relevant data accordingly):
mv /home/USER/logirts.lic /opt/RTS/
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, Neuron RTS max is operated as a demo version.
Configuring Neuron RTS max: traces in "PLC Logging" view and in syslog
Only necessary if you want to have Neuron RTS max traces displayed in the PLC Logging view of Neuron Power Engineer without a connection to the Raspberry Pi:
-
Define the environment variable
RTS_LOG_UDP
.
You are able to define environment variables by using the commandexport
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
-
As value, first define the IP-address of the computer where Neuron Power Engineer is used, then add
:
and conclude with the port7777
. Hence, the value for a computer with IP-address192.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 Neuron RTS max via systemd
but you want to have Neuron RTS max traces displayed in the →syslog of the Raspberry Pi nevertheless:
Define the environment variable
Effects:
Notes:
|
Starting the runtime system on Raspberry Pi
-
Again within the terminal window of PuTTY: Change into the directory
opt/RTS/bin
of the Raspberry Pi.cd /opt/RTS/bin/
-
Start Neuron RTS max on the Raspberry Pi. Press the Enter-key until the input mask of the terminal window is visible again.
./startPLC &
Starting Neuron RTS max at system start
Add Neuron RTS max to the system start by systemd
or using an init script file. Subsequently, Neuron RTS max will run after each reboot of the Raspberry Pi.
System start by using systemd
Start using "systemd" If you want to use |
Creating a service file
-
Create an empty service file for Neuron RTS max.
nano /lib/systemd/system/logirts.service
-
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
-
Save the changes and exit the editor: Press Ctrl+O (and confirm the file name), then press Ctrl+X.
Activating the new service
|
System start by using init script file
Creating an init script file
-
Create an empty init script file for Neuron RTS max.
nano /etc/init.d/startPLC
-
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 the runtime system
# Description:
### END INIT INFO
case "$1" in
start)
cd /opt/RTS/bin
./startPLC &
echo "Starting the runtime system"
;;
stop)
sudo pkill RTSLoader
echo "Runtime system stopped"
;;
*)
echo "Usage: /etc/init.d/startPLC {start|stop}"
exit 1
;;
esac
exit 0
-
Save the changes and exit the editor: Press Ctrl+O (and confirm the file name), then press Ctrl+X.
-
Change the permissions for the file.
chmod +x /etc/init.d/startPLC
-
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
|
Restarting Raspberry Pi and logging on as user "root"
-
Restart the Raspberry Pi in order to accept all changes made until now.
shutdown now -r
-
Confirm the displayed messages.
-
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.
-
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
-
Check whether Neuron RTS max has 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).