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.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 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.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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.

1 2 3 4 5 6 7 8 9 10 11 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}

1 cp build/raspberry_pi/goal_raspberry_pi.bin {user}@{IP}:/home/{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.

Logging is always enabled in the libraries.

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.

1 2 root@maz-raspi:/home/pi# LD_LIBRARY_PATH=/home/pi/ root@maz-raspi:/home/pi# export LD_LIBRARY_PATH

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.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 root@maz-raspi:/home/pi# ./goal_raspberry_pi.bin -i eth0 GOAL Start [I|goal_taskCreate:117] creating task: GOAL Timer [I|goal_tgtTaskCreate:1210] task stack size: 8388608 byte [I|goal_tgtTaskCreate:1252] task scheduler priority: 99 [I|goal_taskCreate:159] Created task GOAL Timer with priority 100/100 and stack 0 byte sucessfully. [I|goal_cmInit:220] Calculated config size of 4052 in 7 modules modules [I|goal_cmLoad:807] Checksums 2618002105 and 2618002105 match! match! [I|goal_queueCmVarsInit:266] Use config manager variables for buffer number and sizes instead of default value defines [I|goal_taskCreate:117] creating task: GOAL Eth TX [I|goal_tgtTaskCreate:1210] task stack size: 8388608 byte [I|goal_tgtTaskCreate:1252] task scheduler priority: 98 [I|goal_taskCreate:159] Created task GOAL Eth TX with priority 50/100 and stack 0 byte sucessfully. [I|goal_netIpSet:1514] ip address: 192.168.1.23 [I|goal_netIpSet:1518] netmask: 255.255.255.0 [I|goal_netIpSet:1522] gateway: 0.0.0.0 [I|goal_netIpSet:1526] IP valid flag: false [I|goal_netIpSet:1534] successfully updated IP configuration [I|goal_miNetOpen:267] ip address: 192.168.1.23 [I|goal_miNetOpen:271] netmask: 255.255.255.0 [I|goal_taskCreate:117] creating task: GOAL Eth RX [I|goal_tgtTaskCreate:1210] task stack size: 8388608 byte [I|goal_tgtTaskCreate:1252] task scheduler priority: 97 [I|goal_taskCreate:159] Created task GOAL Eth RX with priority 50/100 and stack 0 byte sucessfully. [I|goal_drvEthLinuxNativeRawInit:607] started RAW Ethernet receive thread [I|PN_netInit:84] clearing IP configuration [I|goal_netIpSet:1514] ip address: 0.0.0.0 [I|goal_netIpSet:1518] netmask: 0.0.0.0 [I|goal_netIpSet:1522] gateway: 0.0.0.0 [I|goal_netIpSet:1526] IP valid flag: false [I|goal_netIpSet:1534] successfully updated IP configuration [I|PN_netCbIpSet:370] IP: 0.0.0.0 [I|PN_netCbIpSet:371] Netmask: 0.0.0.0 [I|PN_netCbIpSet:372] Gateway: 0.0.0.0 [I|PN_netCbIpSet:373] Remanence: temporary [I|PN_netCbIpSet:381] Update reason: 0 [I|goal_miEthMcastDel:1678] removed multicast address: 01:80:c2:00:00:0e [I|goal_miEthMcastDel:1678] removed multicast address: 01:0e:cf:00:00:00 [I|PN_lldpMgmtAddr:1092] management address: 0.0.0.0 [I|goal_miEthMcastAdd:1636] added multicast address: 01:0e:cf:00:00:00 [I|goal_miEthMcastAdd:1636] added multicast address: 01:80:c2:00:00:0e [I|IOD_Init:2930] PROFINET Stack Version 2.22.1 [I|IOD_Init:2938] PROFINET standard ver: V2.4 [I|IOD_Init:2939] Test specification ver: V2.4a March 2019 [I|IOD_Init:2940] Testcase ver: Bundle July 2019 [I|IOD_Init:2941] ART ver: V2.4.1.3 [I|IOD_Init:2942] SL1 Test ver: V2.40.0 V1.2 [I|IOD_Init:2943] PROFINET ver: 2.4 [I|IOD_Init:2944] GSD ver: 2.35 [I|IOD_Init:2946] Compiler Info: GCC C/C++ V9.3.0 [I|PN_devSetOrderId:604] new order ID: 00210 [I|PN_devSetSerialNr:629] new serial nr: 20074 [I|PN_devSetHwRev:506] new hw rev: 0x0001 [I|PN_devSetSwRev:532] new rev prefix: P [I|PN_devSetSwRev:533] new rev enh: 0x50 [I|PN_devSetSwRev:534] new rev bugfix: 0x03 [I|PN_devSetSwRev:535] new rev int chg: 0x18 [I|PN_devSetSwRev:536] new rev cnt: 0x0000 [I|PN_dcpInit:289] Vendor ID: 0x028c [I|PN_dcpInit:290] Device ID: 0x0001 [I|PN_dcpInit:324] name of station: 'dut' [I|PN_devSetVendorName:2193] new vendor name: 'port GmbH' [I|RPC_init:265] opened RPC UDP port: 34964 [I|RPC_init:274] opened RPC UDP port: 49152 [I|PN_recPDPortDataSync:3818] set MAU type: driver default speed and duplex [I|OAL_ethMAUTypeSet:238] setting link speed on interface 0 to 0 [I|goal_tgtEthIfaceSpeed:1605] auto-negotiation enabled, skipping speed reset [I|OAL_ethMAUTypeSet:245] setting duplex on interface 0 to 0 [I|goal_tgtEthIfaceDuplex:1204] auto-negotiation enabled, skipping duplex reset [I|OAL_ethMAUTypeSet:253] enabling auto-negotiation on interface 0 [I|OAL_ethMAUTypeSet:268] setting MDI mode to auto on interface 0 [I|PN_recPDPortDataSync:3840] set link state: driver default [I|OAL_ethPortStateSet:375] setting port state on interface 0 to default [I|locPortTable_init:64] Initialized lldpLocPortTable [I|locManAddrTable_init:54] Initialized lldpLocManAddrTable [I|configManAddrTable_init:54] Initialized lldpConfigManAddrTable [I|remTable_init:54] Initialized lldpRemTable [I|xPnoLocTable_init:64] Initialized lldpXPnoLocTable [I|xPnoRemTable_init:64] Initialized lldpXPnoRemTable [I|xDot3LocPortTable_init:62] Initialized lldpXDot3LocPortTable [I|goal_lldpSnmpMibInit:398] Initialized LLDP MIBs. [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:147] Initializing device structure [I|appl_setup:195] PROFINET ready [I|goal_memInitDone:152] fixed memory usage: 131708/262144 bytes bytes [I|goal_memInitDone:157] fixed memory usage: (51%)