SCADA on Raspberry: myth or reality?

SCADA on Raspberry: myth or reality?
Winter Is Coming. Programmable logic controllers (PLCs) are gradually being replaced by embedded personal computers. This is due to the fact that the power of computers allows one device to incorporate the functionality of a programmable controller, a server, and (if the device has an HDMI output) an operator workstation. Total: Web-server, OPC-part, database and workstation in a single package, and all this at the cost of one PLC.

In the article, we consider the possibility of using such embedded computers in industry. Let's take a Raspberry Pi-based device as a basis, step by step describe the process of installing an open free Open Source SCADA system of Russian development - Rapid SCADA on it, and also develop an abstract compressor station project in it, the tasks of which will include remote control of a compressor and three valves, as well as visualization of the technological process of compressed air production.

Immediately make a reservation that the problem can be solved in two ways. Fundamentally, they do not differ from each other in any way, the question is only in the aesthetic and practical component. So, we need:

1.1 The first option implies the presence of the Raspberry Pi 2/3/4 itself, as well as the presence of a USB converter to RS485 (the so-called “whistle”, which can be ordered from Alliexpress).

SCADA on Raspberry: myth or reality?
Figure 1 - Raspberry Pi 2 and USB to RS485 converter

1.2 The second option includes any ready-made solution based on Raspberry, recommended for installations in industrial environments with built-in RS485 ports. For example, such as in Figure 2, based on the Raspberry CM3 + module.
SCADA on Raspberry: myth or reality?
Figure 2 - AntexGate device

2. Modbus device with multiple control registers;

3. Windows PC for project configuration.

Development stages:

  1. Part I. Installing Rapid SCADA on Raspberry;
  2. Part II. Installing Rapid SCADA on Windows;
  3. Part III. Development of the project and its loading on the device;
  4. Conclusions.

Part I. Installing Rapid SCADA on Raspberry

1. We fill in form on the Rapid Scada website to get the distribution and download the latest version for Linux.

2. Unzip the downloaded files and copy the "scada" folder to the directory / Opt device.

3. Put three scripts from the "daemons" folder into the directory / Etc / init.d

4. We give full access to the three folders of the application:

sudo chmod -R ugo+rwx /opt/scada/ScadaWeb/config
sudo chmod -R ugo+rwx /opt/scada/ScadaWeb/log
sudo chmod -R ugo+rwx /opt/scada/ScadaWeb/storage

⠀5. Making scripts executable:

sudo chmod +x /opt/scada/make_executable.sh
sudo /opt/scada/make_executable.sh

⠀6. Adding a repository:

sudo apt install apt-transport-https dirmngr gnupg ca-certificates
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/debian stable-stretch main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update

⠀7. Install Mono .NET Framework:

sudo apt-get install mono-complete

⠀8. Install Apache HTTP Server:

sudo apt-get install apache2

⠀9. Install additional modules:

sudo apt-get install libapache2-mod-mono mono-apache-server4

⠀10. Create a link to the Web application:

sudo ln -s /opt/scada/ScadaWeb /var/www/html/scada

⠀11. From the downloaded archive in the "apache" folder, copy the file scada.conf to directory / etc / apache2 / sites-available

sudo a2ensite scada.conf

⠀12. Let's walk this path sudo nano /etc/apache2/apache2.conf and add the following to the end of the file:

<Directory /var/www/html/scada/>
  <FilesMatch ".(xml|log|bak)$">
    Require all denied
  </FilesMatch>
</Directory>

⠀13. Executing the script:

sudo /opt/scada/svc_install.sh

⠀14. Reboot Raspberry:

sudo reboot

⠀15. Opening the website:

http://IP-адрес устройства/scada

⠀16. In the window that opens, enter the login "Admin" and password «12345».

Part II. Installing Rapid SCADA on Windows

Installing Rapid SCADA on Windows will be required for Raspberry setup and project configuration. In theory, you can do this on raspberry itself, but technical support advised us to use the development environment on Windows, since it works more correctly here than on Linux.

So, let's start:

  1. Update Microsoft .NET Framework to the latest version;
  2. Download the distribution kit Rapid SCADA for Windows and install offline;
  3. Launch the Administrator application. In it we will develop the project itself.

When developing, you need to pay attention to some points:

1. The numbering of registers in this SCADA system starts from 1 address, so we had to increase the numbering of our registers by one. In our case, this is: 512+1 and so on:

SCADA on Raspberry: myth or reality?
Figure 3 - Numbering of registers in Rapid SCADA (the picture is clickable)

2. To reconfigure the directories and correctly deploy the project on the Linux operating system, in the settings you need to go to "Server" -> "General settings" and click the "For Linux" button:

SCADA on Raspberry: myth or reality?
Figure 4 - Reconfiguring directories in Rapid SCADA (the picture is clickable)

3. Define the polling port for Modbus RTU in the way it is defined in the Linux system of the device. In our case, this / dev / ttyUSB0

SCADA on Raspberry: myth or reality?
Figure 5 - Reconfiguring directories in Rapid SCADA (the picture is clickable)

If you have any questions, all additional installation instructions can be obtained at website or on their youtube channel.

Part III. Development of the project and its download to the device

Development and visualization of the project is created directly in the browser itself. This is not quite common after desktop SCADA systems, but it is quite the place to be.

Separately, I would like to note a limited set of visualization elements (Figure 6). From the built-in components, there is an LED, a button, a toggle switch, a link and a pointer. However, a big plus is that this SCADA system supports dynamic images and text. With minimal knowledge of graphic editors (Corel, Adobe Photoshop, etc.), you can create your own libraries of images, elements and textures, and support for GIF elements will allow you to add animation to the visualization of the process.

SCADA on Raspberry: myth or reality?
Figure 6 - Schematic editor tools in Rapid SCADA

Within the framework of this article, it was not the goal to describe the process of graphical creation of a project in Rapid SCADA in stages. Therefore, we will not dwell on this point in detail. In the developer environment, our simple project “Compressed air supply systems” of a compressor station looks like this (Figure 7):

SCADA on Raspberry: myth or reality?
Figure 7 - Scheme editor in Rapid SCADA (clickable image)

Next, upload our project to the device. To do this, we specify the IP address of the device for transferring the project not to localhost, but to our embedded computer:

SCADA on Raspberry: myth or reality?
Figure 8 - Downloading the project to the device in Rapid SCADA (the picture is clickable)

As a result, we got something similar (Figure 9). On the left side of the screen there are LEDs that reflect the status of the entire system (compressor), as well as the status of the valves (open or closed), and in the central part of the screen there is a visualization of the process with the ability to control devices using toggle switches. When a valve is opened, the color changes from gray to green both for the valve itself and for the line corresponding to it.

SCADA on Raspberry: myth or reality?
Figure 9 — Compressor station project (GIF-animation is clickable)

Here you can download the file of this project for review.

Figure 10 shows what we have done in general.

SCADA on Raspberry: myth or reality?
Figure 10 - SCADA system on Raspberry

Conclusions

The emergence of powerful embedded industrial computers makes it possible to expand and supplement the functionality of programmable logic controllers. Installing such SCADA systems on them can cover the tasks of a small production or technological process. For larger tasks with a large number of users or increased security requirements, most likely, you will have to install full-fledged servers, automation cabinets and familiar PLCs. However, for points of medium and small automation, such as small industrial buildings, boiler rooms, pump rooms or smart homes, such a solution seems appropriate. According to our calculations, such devices are suitable for tasks up to 500 data I / O points.

If you have experience in drawing in various graphic editors and you are not embarrassed by the fact that you have to create mnemonic diagram elements yourself, then the option with Rapid SCADA for Raspberry is very optimal. Its functionality as a ready-made solution is somewhat limited, since it is Open Source, however, it also allows you to cover the tasks of a small production building. Therefore, if you prepare visualization templates for yourself, then it is quite possible to use this solution to integrate, if not all, then some part of your projects.

Thus, in order to understand how useful such a solution on Raspberry can be for you and how your projects can be replaced by Open Source SCADA systems on Linux, a reasonable question arises: what SCADA systems do you use most often?

Only registered users can participate in the survey. Sign in, you are welcome.

What SCADA systems do you use the most?

  • 35.2%SIMATIC WinCC (TIA Portal)18

  • 7.8%Intouch Wonderware4

  • 5.8%trace mode3

  • 15.6%CodeSys8

  • 0%genesis0

  • 3.9%PCVue Solutions2

  • 3.9%Vijeo Citect2

  • 17.6%Master SCADA9

  • 3.9%iRidium mobile2

  • 3.9%Simple Scada2

  • 7.8%Rapid SCADA4

  • 1.9%AggreGate SCADA1

  • 39.2%Another option (answer in comment)20

Voted by 51 users. 33 users abstained.

Source: habr.com

Add a comment