How to access the Raspberry Pi industrial PLC through SSH

Raspberry Pi PLC controller Access on Linux and Windows using SSH
August 26, 2020 by
How to access the Raspberry Pi industrial PLC through SSH
Boot & Work Corp. S.L., Marti Guillem Cura

Index

Introduction

The open source PLC Raspberry PI is the industrial controller solution with the original Raspberry Pi board. It provides some of the most common communications with up to 36 digital inputs and 16 analog inputs. To use it, the first steps to follow are connecting to it and configuring all its settings. In this blog, we will show you how to connect to the industrial Raspberry PLC for both Windows and Linux users.

PLC RASPBERRY PI

How to access the Raspberry industrial PLC

Raspberry PLC Access

In order to facilitate the connection to the industrial Raspberry Pi PLC, our company has set a default IP for it. For the first time it is used, an Ethernet connection between the Raspberry PLC and a PC will be required. The Raspberry is given with the local IP address 10.10.10.20/24, the default user is pi and the password is raspberry.  To connect to it, you must change your local address to be in the same local network as Raspberry.

After the first connection, you can add users or change the password of each user at any time. To find out if the Raspberry is connected and the Ethernet connection is running, a ping command can be executed in the terminal (for Windows users, enter cnm in the windows searching tab to open it).

The steps to follow for both Linux and Windows are explained below:

Linux

Setting the connection for Linux users

In order to access the Raspberry Pi based PLC, Linux users have to enter through the SSH protocol, which should have been installed by the user first. As has been said, the Raspberry is given a local IP address by default to make it easier for the customer to get in.

So, first of all, we have to check if our local Ethernet Network is set with the same local IP address as our raspberrian device. In case you do not know how to set it, check it in the following blog: How to change the IP in Windows and Linux. As mentioned before, you can use the ping command with the address 10.10.10.20 as an option:

$ping 10.10.10.20

If the pin works successfully, it means that our connection is ready. If not, take a look at our blog or contact our customer service. 

To access the Raspberry PLC we will execute the ssh command shown below:

$ssh [email protected]


The connection will start, but first, the password provided above will be required. If the username and password are correct, you can start the SSH session.

                                                                        How to access the Raspberry industrial PLC
                                                                        When an SSH connection is made for the first time, the server delivers the public key of the server to the SSH client. The system will alert you to this and offer you the option to accept the key or reject it. You have to accept the key, as it will be stored in the registry and used to check it against the one sent by the server at each connection. If for some reason the key changes, a new warning will be generated in which the authenticity of the received key will be considered since someone could be impersonating the server to which we want to connect.

                                                                        Once connected, it will be full access to the Raspberry PLC and the user will be able to control it and set the necessary functions. Also, new users or the password could be changed as the IP of the device. The commands to go through the Raspberry are the same as those of the Linux terminal.

                                                                        The most useful are the following:

                                                                        • cd: to browse Linux files and directories.
                                                                        • ls: used to view the contents of a directory.
                                                                        • cat: used to list the contents of a file on the standard output.
                                                                        • mkdir: use mkdir command to make a new directory
                                                                        • rm: used to delete directories and their contents.
                                                                        • touch: used to create a blank new file.

                                                                        In order to log out and close the connection, just type exit in the Raspberry terminal.

                                                                        Windows

                                                                        Setting the connection for Windows users

                                                                        For Windows users, we recommend using the open-source terminal emulator PuTTy ssh client. The latest release of PuTTY can be downloaded from the official web which contains download links for the latest released version of PuTTY.

                                                                        PuTTy download link

                                                                        How to access the Raspberry industrial PLC

                                                                        To connect to it, you must change your local address to be in the same local network as the Raspberry. You can use the ping command with the address 10.10.10.20 as an option in the Windows terminal. The Windows terminal can be found typing cnm on the windows search bar.

                                                                        After having installed PuTTY, run the program and the following window should be opened. If it is not the same, click on the Session option in the upper left corner.

                                                                        To set up PuTTY, you should enter the Raspberry IP in the HostName field and make sure that port 22 is being used and the SSH option is selected on the Connection Type. After all the settings have been done, click the Open button to run the program. For a faster start in subsequent sessions, before running the program, enter a name on Saved Sessions and click on the Save button (a double click on the named setting will run the program with the saved settings). 

                                                                        When you start the connection, the terminal window will open. Enter your username pi and press Enter, then enter your raspberry password. If the username and password are correct, you can log in to SSH.

                                                                        How to access the Raspberry industrial PLC

                                                                        When an SSH connection is made for the first time, the server delivers the public key of the server to the SSH client. PuTTy will notify you of this and offer you the option to accept the key or reject it. You have to accept the key, as it will be stored in the registry and used to check against the one sent by the server on each connection. If for any reason the key changes, PuTTy will generate a new warning in which the authenticity of the received key will be raised, since someone could be posing as the server we want to connect to.

                                                                        Once connected, it will be complete access to the Raspberry PLC and the user will be able to control it and set the necessary functions. Also, new users or the password could be changed as the IP of the device. The commands to go through the Raspberry are the same as those of the Linux terminal. The most useful ones are the following:

                                                                        • cd: to browse the Linux files and directories.
                                                                        • ls: used to view the contents of a directory.
                                                                        • cat: used to list the content of a file on the standard output.
                                                                        • mkdir: use mkdir command to make a new directory
                                                                        • rm: used to delete directories and their contents.
                                                                        • touch: used to create a new blank file.

                                                                        In order to log out and close the connection, just type exit in the Raspberry Pi automation terminal.


                                                                        Do you want to keep learning about our open source based devices?

                                                                        Follow our blog and be aware of all our posts. 


                                                                        ​Search in our Blog

                                                                        How to access the Raspberry Pi industrial PLC through SSH
                                                                        Boot & Work Corp. S.L., Marti Guillem Cura August 26, 2020

                                                                        Looking for your ideal Programmable Logic Controller?

                                                                        Take a look at this product comparison with other industrial controllers Arduino-based. 

                                                                        We are comparing inputs, outputs, communications and other features with the ones of the relevant brands.


                                                                        Industrial PLC comparison >>>