Quick Start Guide for GOAL on Raspberry Pi

Introduction

This document describes how to start with GOAL and the Raspberry Pi 3.

For a simple start we provide time limited demo binaries for the well-known Raspberry Pi for Profinet and EtherNet/IP. This way you can try the supported features and decide, if GOAL is what you need without editing sourcecode, compiling or other complicate steps.

For a more capable solution we’re also providing time limited, already compiled GOAL Demo Libraries containing the full Communication Stacks and Features. You only have to compile an Application against the Library. This way, you can create your own application.

Required Hardware and Software

Following hardware and software is required for running GOAL on Raspberry Pi:

  • a Raspberry Pi 3 B+ (or later),

  • a power supply for Raspberry Pi,

For using the GOAL Demo Binaries for Profinet or EtherNet/IP, you’ll need:

  • GOAL Demo Binaries for Profinet or EtherNet/IP

For using the provided GOAL Demo library you’ll need:

  • PC with Linux OS

  • GCC and the arm-gcc-linux-eabihf cross compiler (available at APT)

  • GOAL Software package/ release

Optional:

  • Industrial Communication Explorer as Soft-PLC

Preparing the Raspberry Pi

Connect the Raspberry Pi to your local network via Ethernet. To access the device, either connect a monitor, keyboard and mouse via the provide HDMI and USB connectors or connect to the device via SSH after bootup.

Using GOAL Demo Binaries

Download Binaries

Starting the Application

Transfer the desired Binary to your Raspberry Pi - using SCP or an USB Storage. Make the Binary executable and start it with the parameter “-i”, which defines the GOAL accessed network interface.

The Binary must be startet with root rights to access raw sockets.

Profinet Binary

Start the Binary like shown below. The Profinet Demo Application will flush the IP configuration on the passed network interface. The Raspberry Pi is then accessable as a Profinet Device. The Application and it’s purpose is described here.

The Application will create a data dump called “goal_cm_nvs.bin“, which represents the non-volatile storage for GOAL. This data dump contains settings like the IP configuration, Station names et cetera.

pi@raspberry:~ $ sudo ./demo_goal_pnio_01_simple_io_raspberry_pi.bin -i eth0 GOAL Start [I|goal_taskCreate:117] creating task: GOAL Timer [I|goal_tgtTaskCreate:1193] task stack size: 8388608 byte [I|goal_tgtTaskCreate:1235] task scheduler priority: 99 [I|goal_taskCreate:160] Created task GOAL Timer with priority 100/100 and stack 0 byte sucessfully. ... [I|goal_mainDemoStage:583] This is a demo version. It is time limited to 180 min ... [I|IOD_Init:3119] PROFINET stack ready [I|goal_fwInit:92] registered ARP handler [I|goal_fwInit:101] registered UDP/TCP handler [I|appl_setup:153] Initializing device structure [I|appl_setup:201] PROFINET ready [I|goal_memInitDone:152] fixed memory usage: 126776/262144 bytes bytes [I|goal_memInitDone:157] fixed memory usage: (49%)

To test the Raspberry Pi as a Profinet Device, you could use the Industrial Communication Explorer, provided by us. This Tool acts as an Multi-Protocol PLC and is able to configure Profinet Devices and establish AR’s with it.

After Installing and Configuring, you simply start the Industrial Communication Explorer. To find the connected Raspberry Pi and Profinet Device, the Industrial Communication Explorer must be configured to use DCP to search for new devices. Select File [1] → Preferences → Protocols [2] and select “PROFINET” at “Scan for devices” [3]. Apply and Close those settings.

Configuring Industrial Communication Explorer to use Profinet DCP

Please refer to following Knowledge Base Article, to establish an AR using the provided GSD. You may want to try the Raspberry Pi in combination with TIA-Portal or at an industrial environment to test GOAL, the Profinet Stack and all of its features.

EtherNet/IP Binary

The Application creates following objects:

Assembly

Type

Note

Assembly

Type

Note

100

32 Byte Input

  • Read-only

  • first Byte shows Buttonstate, if supported

  • second Byte is mirrored by Assembly 150.

150

32 Byte Output

  • first Byte controls device LED, if supported

151

10 Byte Config

  • Read- and Writeable

154

32 Byte Explicit

  • Read- and Writeable

Start the Binary like shown below. The EtherNet/IP Demo Application will control the passed network interface. The Raspberry Pi is then accessable as an EtherNet/IP Device.

The Application will create a data dump called “goal_cm_nvs.bin“, which represents the non-volatile storage for GOAL. This data dump contains settings like the IP configuration, Station names et cetera.

pi@raspberry:~ $ sudo ./demo_goal_eip_01_simple_io_raspberry_pi.bin -i eth0 GOAL Start [I|goal_taskCreate:117] creating task: GOAL Timer [I|goal_tgtTaskCreate:1193] task stack size: 8388608 byte [I|goal_tgtTaskCreate:1235] task scheduler priority: 99 [I|goal_taskCreate:160] Created task GOAL Timer with priority 100/100 and stack 0 byte sucessfully. ... [I|goal_mainDemoStage:583] This is a demo version. It is time limited to 180 min ... [I|IApp_InitImpl:191] Ethernet/IP 2.13.0 initialized [I|goal_memInitDone:152] fixed memory usage: 109300/262144 bytes bytes [I|goal_memInitDone:157] fixed memory usage: (42%) [I|goal_netIpSet:1445] ip address: 192.168.0.50 [I|goal_netIpSet:1449] netmask: 255.255.255.0 [I|goal_netIpSet:1453] gateway: 0.0.0.0 [I|goal_netIpSet:1457] IP valid flag: false [I|goal_netIpSet:1472] successfully updated IP configuration [I|IApp_CreateUDPSocket:1688] opened UDP sock 0xc3244 [I|opener_NWHinit:764] UDPListener opened: 0xc3244

To test the Raspberry Pi as an EtherNet/IP Device, you could use the Industrial Communication Explorer, provided by us. This Tool acts as an Multi-Protocol PLC and is able to configure EtherNet/IP Devices and establish IO connections with it.

After Installing and Configuring, you simply start the Industrial Communication Explorer. To find the connected Raspberry Pi and EtherNet/IP Device, the Industrial Communication Explorer must be configured to use the protocol to search for new devices. Select File [1] → Preferences → Protocols [2] and select “EtherNet/IP” at “Scan for devices” [3]. Apply and Close those settings.

Configuring Industrial Communication Explorer to scan for EtherNet/IP Devices

Please refer to following Knowledge Base Article, to establish an IO connection. You may want to try the Raspberry Pi in combination with a Hardware PLC or at an industrial environment to test GOAL, the EtherNet/IP Stack and all of its features.

Using precompiled GOAL Demo Libraries

Building and downloading applications

Navigate into the gcc subdirectory of one of the provided projects and run command make. On first run, you have to choose the platform. Enter the displayed ID for raspberry_pi.

maz@maz-VirtualBox:~/goal/projects/00410_goal/template/gcc$ make No platform selected, choose a platform - OR - press <CTRL+c> and set the PLATFORM environment variable. Choose platform: [ 1] linux_x86 (gcc) [ 2] linux_x86_clang (gcc) [ 3] raspberry_pi (gcc) Choice [1-3]:

Build process is executed afterwards automatically. The created binary is placed in the GCC subdirectory build/raspberry_pi/goal_raspberry_pi.bin.

Downloading the binary can be realized by scp for example. If the Raspberry Pi is already connected to the local network and its {IP} it is available, run the following command to copy the binary file into the home directory of the {user}

The GOAL protocol software is available as a 3h time limited demo release. In this case, the projects of protocol stacks are only available as library projects. These projects are marked by file ending _lib. Building and downloading the demo application is similar to the description above, but additionally, the library libgoal_raspberry_pi.so has to be copied to the Raspberry Pi too. The file is available in the 00_lib directory for each protocol stack.

Starting applications

After downloading the binary file, the application can be executed. Please not, that you need root access to start the program. Changing to to super user by sudo su is recommended.

Subsequently, navigate into the directory where the application file is located.

If you are using the Demo version of GOAL, please set the LD_LIBRARY_PATH to the directory, where the libgoal_raspberry_pi.so is located like shown below.

Starting the GOAL application is done by simply executing the binary file. If your application requires a network interface, please use the argument -i to pass the interface name to your application.

See following example for a running a GOAL demo.