Skip to content

Commit c5888e7

Browse files
committed
update repo and PROFINET firmware
1 parent e7c2a8f commit c5888e7

26 files changed

+6895
-67
lines changed

Dockerfile

+17-13
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
1-
#use latest armv7hf compatible raspbian OS version from group resin.io as base image
2-
FROM balenalib/armv7hf-debian:stretch
1+
#use armv7hf compatible base image
2+
FROM balenalib/armv7hf-debian:buster-20191223
33

4-
#enable building ARM container on x86 machinery on the web (comment out next line if built on Raspberry)
5-
RUN [ "cross-build-start" ]
4+
#dynamic build arguments coming from the /hooks/build file
5+
ARG BUILD_DATE
6+
ARG VCS_REF
7+
8+
#metadata labels
9+
LABEL org.label-schema.build-date=$BUILD_DATE \
10+
org.label-schema.vcs-url="https://github.com/HilscherAutomation/netPI-netx-programming-examples" \
11+
org.label-schema.vcs-ref=$VCS_REF
12+
13+
#version
14+
ENV HILSCHERNETPI_NETX_PROGRAMMING_EXAMPLES_VERSION 1.1.0
615

716
#labeling
817
LABEL maintainer="[email protected]" \
9-
version="V1.0.0" \
18+
version=$HILSCHERNETPI_NETX_PROGRAMMING_EXAMPLES_VERSION \
1019
description="netX real-time ethernet programming examples"
1120

12-
#version
13-
ENV HILSCHERNETPI_NETX_PROGRAMMING_EXAMPLES_VERSION 1.0.0
14-
1521
#install ssh, gcc, create user "pi" and make him sudo
1622
RUN apt-get update \
1723
&& apt-get install -y openssh-server build-essential \
@@ -44,8 +50,9 @@ COPY ./manuals/* manuals/
4450
#copy the firmware packages
4551
COPY ./firmwares/* firmwares/
4652

47-
#copy the netx driver
53+
#copy the netx driver and include files
4854
COPY ./driver/* driver/
55+
COPY ./driver/includes/* /usr/include/cifx/
4956

5057
#copy the include files
5158
COPY examples/includes/EtherCAT/* includes/EtherCAT/
@@ -72,7 +79,7 @@ COPY examples/Makefile ./
7279
COPY examples/sources/* sources/
7380

7481
#install the driver
75-
RUN dpkg -i ./driver/netx-docker-pi-drv-1.1.3.deb
82+
RUN dpkg -i ./driver/netx-docker-pi-drv-2.0.1-r0.deb
7683

7784
#compile the applications
7885
RUN make
@@ -86,6 +93,3 @@ ENTRYPOINT ["/usr/sbin/sshd", "-D"]
8693
#set STOPSGINAL
8794
STOPSIGNAL SIGTERM
8895

89-
#stop processing ARM emulation (comment out next line if built on Raspberry)
90-
RUN [ "cross-build-end" ]
91-

README.md

+79-37
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,101 @@
1-
## netX programming examples
1+
## netX programming
22

3-
Made for [netPI RTE 3](https://www.netiot.com/netpi/), the Raspberry Pi 3B Architecture based industrial suited Open Edge Connectivity Ecosystem
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4+
[![](https://images.microbadger.com/badges/commit/hilschernetpi/netpi-netx-programming-examples.svg)](https://microbadger.com/images/hilschernetpi/netpi-netx-programming-examples "netX programming examples")
5+
[![Docker Registry](https://img.shields.io/docker/pulls/hilschernetpi/netpi-netx-programming-examples.svg)](https://registry.hub.docker.com/r/hilschernetpi/netpi-netx-programming-examples/) 
6+
[![Image last updated](https://img.shields.io/badge/dynamic/json.svg?url=https://api.microbadger.com/v1/images/hilschernetpi/netpi-netx-programming-examples&label=Image%20last%20updated&query=$.LastUpdated&colorB=007ec6)](http://microbadger.com/images/hilschernetpi/netpi-netx-programming-examples "Image last updated") 
47

5-
### netX programming example applications for PROFINET, EtherNet/IP, EtherCAT, POWERLINK and Modbus/TCP
8+
Made for Raspberry Pi 3B architecture based devices and compatibles featuring a netX51 industrial network controller
9+
10+
### Container features
11+
12+
The image provided herunder deploys a container that includes different programming examples for the on-board netX51 industrial network controller.
613

714
Base of this image builds [debian](https://www.balena.io/docs/reference/base-images/base-images/) with enabled [SSH](https://en.wikipedia.org/wiki/Secure_Shell) and created user 'pi'.
815

9-
Additionally the image provides netX programming examples in source code (and as precompiled executables) for
16+
Additionally the image contains netX51 programming examples in source code and as precompiled executables for the following protocols
1017

1118
* PROFINET IO-device
1219
* EtherNet/IP adapter
1320
* EtherCAT slave
1421
* POWERLINK slave
1522
* Modbus/TCP server
1623

17-
#### Container prerequisites
24+
### Container hosts
25+
26+
The container has been successfully tested on the following Docker hosts
27+
28+
* netPI, model RTE 3, product name NIOT-E-NPI3-51-EN-RE
29+
* netIOT Connect, product name NIOT-E-TPI51-EN-RE
30+
* netFIELD Connect, product name NIOT-E-TPI51-EN-RE/NFLD
31+
32+
netPI devices specifically feature a restricted Docker protecting the Docker host system software's integrity by maximum. The restrictions are
1833

19-
##### Port mapping
34+
* privileged mode is not automatically adding all host devices `/dev/` to a container
35+
* volume bind mounts to rootfs is not supported
36+
* the devices `/dev`,`/dev/mem`,`/dev/sd*`,`/dev/dm*`,`/dev/mapper`,`/dev/mmcblk*` cannot be added to a container
37+
38+
### Container setup
39+
40+
#### Port mapping
2041

2142
For enabling remote login to the container across SSH the container's SSH port 22 needs to be exposed to the host.
2243

23-
##### Host device
44+
#### Host device
2445

2546
To grant access to the netX from inside the container the `/dev/spidev0.0` host device needs to be added to the container.
2647

27-
#### Getting started
48+
### Container deployment
49+
50+
Pulling the image may take 10 minutes.
51+
52+
#### netPI example
2853

29-
STEP 1. Open netPI's landing page under `https://<netpi's ip address>`.
54+
STEP 1. Open netPI's web UI in your browser (https).
3055

3156
STEP 2. Click the Docker tile to open the [Portainer.io](http://portainer.io/) Docker management user interface.
3257

33-
STEP 3. Enter the following parameters under **Containers > Add Container**
58+
STEP 3. Enter the following parameters under *Containers > + Add Container*
3459

35-
* **Image**: `hilschernetpi/netpi-netx-programming-examples`
60+
Parameter | Value | Remark
61+
:---------|:------ |:------
62+
*Image* | **hilschernetpi/netpi-netx-programming-examples**
63+
*Port mapping* | *host* **unused port e.g.23** -> *container* **22** |
64+
*Restart policy* | **always**
65+
*Runtime > Devices > +add device* | *Host path* **/dev/spidev0.0** -> *Container path* **/dev/spidev0.0** |
3666

37-
* **Port mapping**: `Host "22" (any unused one) -> Container "22"`
67+
STEP 4. Press the button **Actions > Start/Deploy container**
3868

39-
* **Restart policy"** : `always`
69+
#### Docker command line example
4070

41-
* **Runtime > Devices > add device**: `Host "/dev/spidev0.0" -> Container "/dev/spidev0.0"`
71+
`docker run -d --restart=always --device=/dev/spidev0.0:/dev/spidev0.0 -p 23:22/tcp hilschernetpi/netpi-netx-programming-examples`
4272

43-
STEP 4. Press the button **Actions > Start/Deploy container**
73+
#### Docker compose example
74+
75+
A `docker-compose.yml` file could look like this
76+
77+
version: "2"
4478

45-
Pulling the image may take a while (5-10mins). Sometimes it takes so long that a time out is indicated. In this case repeat the **Actions > Start/Deploy container** action.
79+
services:
80+
nodered:
81+
image: hilschernetpi/netpi-netx-programming-examples
82+
restart: always
83+
ports:
84+
- 23:22
85+
devices:
86+
- "/dev/spidev0.0:/dev/spidev0.0"
4687

47-
#### Accessing
88+
### Container access
4889

49-
The container starts the SSH service automatically.
90+
The container starts the SSH server automatically when deployed.
5091

51-
Login to it with an SSH client such as [putty](http://www.putty.org/) using netPI's IP address at your mapped port. Use the credentials `pi` as user and `raspberry` as password when asked and you are logged in as non-root user `pi`.
92+
For an SSH terminal session use an SSH client such as [putty](http://www.putty.org/) with the Docker host IP address (@port number mapped e.g.23).
5293

53-
##### Files and folders
94+
Use the credentials `pi` as user and `raspberry` as password when asked and you are logged in as non-root user `pi`.
95+
96+
Continue to use [Linux commands](https://www.raspberrypi.org/documentation/linux/usage/commands.md) in the terminal as usual.
97+
98+
#### Container files and folders
5499

55100
The login directs you to the pi user home directory /home/pi with following structure
56101

@@ -75,7 +120,7 @@ The login directs you to the pi user home directory /home/pi with following stru
75120

76121
To install the netX SPI driver package move to the `driver` folder and call
77122

78-
`dpkg -i netx-docker-pi-drv-1.1.3.deb`
123+
`dpkg -i netx-docker-pi-drv-2.0.1-r0.deb`
79124

80125
The driver will be installed into the folder `/opt/cifx`.
81126

@@ -87,15 +132,15 @@ Basic include files needed for the compilation process will be installed into fo
87132

88133
To install a firmware package move to the folder `firmwares` and call
89134

90-
* `dpkg -i netx-docker-pi-pns-3.12.0.2.deb` for PROFINET IO device firmware or
135+
* `dpkg -i netx-docker-pi-pns-3.14.0.5.deb` for PROFINET IO device firmware or
91136
* `dpkg -i netx-docker-pi-eis-2.12.5.0.deb` for EtherNet/IP adapter firmware or
92-
* `dpkg -i netx-docker-pi-ecs-4.7.0.2.deb` for EtherCAT slave firmware
93-
* `dpkg -i netx-docker-pi-pls-3.3.0.0.deb` for POWERLINK slave firmware
137+
* `dpkg -i netx-docker-pi-ecs-4.7.0.2.deb` for EtherCAT slave firmware or
138+
* `dpkg -i netx-docker-pi-pls-3.3.0.0.deb` for POWERLINK slave firmware or
94139
* `dpkg -i netx-docker-pi-omb-2.6.0.6.deb` for Modbus/TCP server firmware
95140

96141
Any firmware package extracts its firmware into the folder `/opt/cifx/deviceconfig/FW/channel0`.
97142

98-
The firmware will be loaded by the driver into netX network controller the first time the driver is accessed using the `cifXDriverInit()` command.
143+
The firmware will be automatically loaded by the driver into the netX network controller when the driver is accesed by an application the first time using the `cifXDriverInit()` function.
99144

100145
There can be only one installed netX firmware package at a time. An existing package will be automatically uninstalled during the installation procedure.
101146

@@ -125,17 +170,17 @@ If a different IO length is required you have to adjust the length in the file `
125170

126171
Afterwards recompile and start the new examples to become effective. Make sure you also modify the device description files and reload them into the master/contoller engineering software to sychronize the project with the new physical setup.
127172

128-
##### Starting the executables
173+
##### Starting the pre-compiled executables
129174

130-
To start the compiled examples call the following executeables in the pi home directory
175+
To start the pre-compiled examples call the following executeables in the pi home directory
131176

132177
* `sudo ./PNS_simpleConfig` for the PROFINET IO device example
133178
* `sudo ./EIS_simpleConfig` for the EtherNet/IP adapter example
134179
* `sudo ./ECS_simpleConfig` for the EtherCAT slave example
135180
* `sudo ./PLS_simpleConfig` for the POWERLINK slave example
136181
* `sudo ./OMB_simpleConfig` for the Modbus/TCP server example
137182

138-
Each example checks if its corresponding firmware package has been installed properly and loaded into netX, else it will install and load it automatically.
183+
Each example checks if the related firmware package has been installed properly. It not it installs the package prior operation.
139184

140185
##### Electronic Data Sheets
141186

@@ -155,7 +200,7 @@ To link the cifX driver library to own applications just add the option `-lcifx`
155200

156201
The cifX driver's function application interfaace (API) is described in the manual
157202

158-
`cifX_API_PR_04_EN.pdf`
203+
`cifX_API_PR_08_EN.pdf`
159204

160205
located in the `manuals` folder. These call functions provide you a simple interface between your application and netX network controller.
161206

@@ -165,23 +210,20 @@ A netX firmware has a common part that is behaving the same for all firmwares an
165210

166211
The protocol specific dependencies are described in the manuals
167212

168-
* `PROFINET_IO-Device_V3.12_Protocol_API_17_EN.pdf` for PROFINET IO device
213+
* `PROFINET IO-Device V3.14 Protocol API 19 EN.pdf` for PROFINET IO device
169214
* `EtherNetIP_Adapter_Protocol_API_19_EN.pdf` for EtherNet/IP adapter
170215
* `EtherCAT Slave V4 Protocol API 09 EN.pdf` for EtherCAT slave
171216
* `POWERLINK Slave V4 Protocol API 09 EN.pdf` for POWERLINK slave
172217
* `OpenModbusTCP Protocol API 10 EN.pdf` for Modbus TCP server
173218

174219
located in the `manuals` folder.
175220

176-
#### Automated build
177-
178-
The project complies with the scripting based [Dockerfile](https://docs.docker.com/engine/reference/builder/) method to build the image output file. Using this method is a precondition for an [automated](https://docs.docker.com/docker-hub/builds/) web based build process on DockerHub platform.
179-
180-
DockerHub web platform is x86 CPU based, but an ARM CPU coded output file is needed for Raspberry systems. This is why the Dockerfile includes the [balena](https://balena.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/) steps.
221+
### License
181222

182-
#### License
223+
Copyright (c) Hilscher Gesellschaft fuer Systemautomation mbH. All rights reserved.
224+
Licensed under the LISENSE.txt file information stored in the project's source code repository.
183225

184-
View the license information for the software in the project. As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
226+
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
185227
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.
186228

187229
[![N|Solid](http://www.hilscher.com/fileadmin/templates/doctima_2013/resources/Images/logo_hilscher.png)](http://www.hilscher.com) Hilscher Gesellschaft fuer Systemautomation mbH www.hilscher.com

0 commit comments

Comments
 (0)