
RaspberryPI Runtime Getting started – Rev. 2 [email protected] G CP_R31_006_ COPA-DATA France, All Rights Reserved The information contained in this document is the property of COPA-DATA France. The distribution and/or reproduction of all or part of this document in any form whatsoever is authorized only with the written authorization of COPA-DATA France. The technical data are used only for the description of the product and do not constitute a guarantee of quality in the legal sense of the term. We reserve the right to make technical changes. 2 Content 1. PREREQUISITES ................................................................................................................................... 4 2. INSTALLATION AND CONFIGURATION OF THE RASPBERRY PI ............................................ 4 2.1. Download and installation of Raspberry PI OS ...................................................................... 4 2.2. Configuration of Raspberry PI OS ............................................................................................... 5 3. INSTALLATION AND CONFIGURATION OF THE STRATON RUNTIME ................................. 6 3.1. Download the straton Runtime .................................................................................................... 6 3.2. Installation of the T5 runtime ........................................................................................................ 6 4. DOWNLOAD AN APPLICATION ...................................................................................................... 8 5. CONFIGURE THE RASPBERRY’S IOS ............................................................................................ 10 6. PARTICULAR CAUTION WITH GPIO ............................................................................................ 13 6.1. Inputs ................................................................................................................................................... 13 6.2. Outputs ................................................................................................................................................ 13 7. INSTALL I2C DRIVER ON RASPBERRY ......................................................................................... 14 8. CONFIGURE I2C PORT ..................................................................................................................... 15 9. CONFIGURE THE USAGE OF A PIFACE 2 IO BOARD ................................................................ 16 9.1. Enabling the PIFace 2 interfacing .............................................................................................. 16 9.2. Configuration in straton ................................................................................................................ 17 10. USE THE DATASERVER ON THE RASPBERRY ............................................................................ 19 10.1. Prerequisites ...................................................................................................................................... 19 10.2. Create the configuration in straton Editor ............................................................................. 20 10.3. Put the HTML5 page on the Raspberry ................................................................................... 22 11. FREQUENTLY ASKED QUESTIONS ............................................................................................... 23 3 Prerequisites 1. Prerequisites This user guide has been developed using a Raspberry Pi 4 device and a PiFace 2 IO board. 2. Installation and configuration of the Raspberry PI 2.1. Download and installation of Raspberry PI OS Download the latest Raspberry PI OS from: https://www.raspberrypi.org/software/ Format your SD card with default settings: 4 | 24 Installation and configuration of the Raspberry PI Extract and write the image of the Raspberry PI OS on your SD card. Plug the SD card in your Raspberry, also connect a screen, a mouse and a keyboard. Start the Raspberry and follow the installation steps. 2.2. Configuration of Raspberry PI OS Once the installation is finished, access the terminal. Use the following command to access the configuration page: Access the configuration menu: ▪ sudo raspi-config Enable SSH connections The Raspberry is now ready to be used from your own computer using SSH connexions. Reboot the Raspberry: ▪ sudo reboot Connect it to the network using its Ethernet port. To obtain the IP and MAC addresses, enter this command line in the terminal: ▪ ifconfig 5 | 24 Installation and configuration of the straton Runtime 3. Installation and configuration of the straton Runtime 3.1. Download the straton Runtime Download the straton Runtime for the Raspberry from https://straton-plc.com/en/downloads/ 3.2. Installation of the T5 runtime Unzip the file downloaded from the COPA-DATA website in the previous step. Using an FTP client (FileZilla in this case): Connect to the Raspberry (Card IP address, port 22, name and password) * Drag and drop the Runtime file (“t5pi94” in our case) in /home/pi folder Using an SSH Client (PuTTY in our case), connect to the Raspberry (IP address + port 22) * Configure the runtime file to be executable ▪ chmod +x Runtime_file (t5pi94 in our case) 6 | 24 Installation and configuration of the straton Runtime Start the runtime with admin rights ▪ sudo ./Runtime_file If you plan to use IEC61850, create a Custom folder: “sudo mkdir Custom” in the same directory as the runtime, then start the runtime with ▪ sudo ./Runtime_file /path850=Custom/ By default, communications with the workbench is on port 1100. *By default the user name and password is pi / raspberry If not activated straton Runtime runs for 2 hours. The license needs to be installed in the K5License.ini file in the same folder as t5runtime. In order to get a straton runtime license, you need to send the Raspberry physical/MAC address of one of its Ethernet card to COPA-DATA. You will shortly receive your license number; it can only be used for the MAC address you sent. In order to activate the license, type in a console, in the same directory as the Runtime: ▪ echo “License number” > K5License.ini Or create the K5License.ini file manually and put the license number inside it. Be careful, this is case sensitive! If the license number is not OK, a message will warn you when starting the start of the straton runtime. License number follows this syntax MacAddress.0.0.abcd.efgh 7 | 24 Download an application 4. Download an application In order to execute an application, the user needs to start a straton runtime on a platform, download the application to the runtime and start it if not started automatically after download. Open the straton IDE and select FBDDemo project (Menu File > \xxx\DEMO.W5L) If the FBDDemo project is not in the recent projects, in the menu choose Help > About, and click on the […] button ( ). The folder where straton data are installed opens. Open the Samples folder, then drag and drop the DEMO.W5L project list in the straton IDE. The project list opens, right-click on the FBDDemo project and set it as startup project, so it will be this project that will be built and downloaded on the runtime. Download the application to the straton runtime: Select the communication parameters in menu Tools/Communication Parameters Establish the connection through menu Project/Online ( ) 8 | 24 Download an application RESULT IS: The download is successful and application starts correctly. The runtime is not started or communication parameters are wrong. The application is not yet downloaded or an error occurs during startup. More detail can be found in the output view. 9 | 24 Configure the Raspberry’s IOs 5. Configure the Raspberry’s IOs The configuration of the Raspberry’s I/Os is done directly from the Editor (need straton Workbench 8.6 or higher) Right click on your project > Shortcuts > Fieldbus Configurations. In the fieldbus configuration ( ), click on “Insert Configuration” button: Choose “GPIO Generic Device” Then click on the “Insert Mater / Port” button: and “OK”. Click on the “Insert Slave / Data block” button: In the Board window that just opens, select the Type of the Raspberry. (In case of problems to determine its version refer to the section 11 at the end of this document) 10 | 24 Configure the Raspberry’s IOs Right click on the Slave/Data block and click on the “Create variables” button: Then, associate a symbol to each GPIO, and set, for each of them, if it is an Input or an Output: Check “Declare variables in database” in order to declare variables in straton. The configuration tree must look like this: 11 | 24 Configure the Raspberry’s IOs The pin map shown on the left and in the configurator has to be read when the Raspberry is oriented in the same way as the one on the picture on the right. 12 | 24 Particular caution with GPIO 6. Particular caution with GPIO 6.1. Inputs Unlike most of today’s I/Os, inputs on the raspberry are not connected to a pull-down or a pull-up circuit. It means that a floating (not connected) input can either be TRUE or FALSE, in an unpredictable way. So, in order to connect a switch, a pull-down (or pull-up) circuit is needed: Inputs cannot sink more than 3.3V and 16mA, and there is no protection. An inappropriate voltage or current on a GPIO can damage the Raspberry. 6.2. Outputs Outputs can source 3.3V and max. 16 mA. As inputs, they are not protected and sensitive to over-voltage, etc. 13 | 24 Install I2C Driver on Raspberry
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages24 Page
-
File Size-