Welcome, Guest
You have to register before you can post on our site.



Search Forums

(Advanced Search)

Forum Statistics
» Members: 394
» Latest member: Peter2020
» Forum threads: 396
» Forum posts: 2,005

Full Statistics

Latest Threads
SD card full
Forum: Software
Last Post: Peter2020
5 hours ago
» Replies: 3
» Views: 12
Realtime clock
Forum: Software
Last Post: tad
Yesterday, 10:30 AM
» Replies: 4
» Views: 23
REACH directive
Forum: Hardware
Last Post: Armin@netPI
Yesterday, 06:18 AM
» Replies: 1
» Views: 25
User Management
Forum: Software
Last Post: Armin@netPI
September-16th-2020, 11:33 AM
» Replies: 3
» Views: 34
32 vs 64 bit OS
Forum: Software
Last Post: Armin@netPI
September-15th-2020, 12:35 PM
» Replies: 5
» Views: 166
Customising landing page
Forum: Software
Last Post: Armin@netPI
September-15th-2020, 09:34 AM
» Replies: 3
» Views: 262
Forum: Software
Last Post: Armin@netPI
September-14th-2020, 07:06 PM
» Replies: 12
» Views: 340
HilscherAutomation / netP...
Forum: Software
Last Post: bbaskii
September-14th-2020, 04:42 PM
» Replies: 6
» Views: 146
5 x NL 50-Mpi and Node R...
Forum: Software
Last Post: Armin@netPI
September-14th-2020, 01:59 PM
» Replies: 4
» Views: 42
Data logger
Forum: Software
Last Post: Jan
September-11th-2020, 02:14 PM
» Replies: 6
» Views: 123

  Node-Red "http in"-Node not working
Posted by: DWxPro - June-18th-2020, 12:45 PM - Forum: Software - Replies (8)

Dear Armin,

i am trying to build a little webservice witch can recive XML data from clients using the "http in"-Node and the POST methode. On my normal Raspberry Pi the flow is doing its job but when it transfer it on my netPi i can not recive any messages. 

[{"id":"8a45d1e1.5db92","type":"http response","z":"e69b5c9f.49237","name":"","statusCode":"200","headers":{},"x":560,"y":120,"wires":[]},{"id":"85a4eae3.9ec5a8","type":"debug","z":"e69b5c9f.49237","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":550,"y":80,"wires":[]},{"id":"94321f38.1215a","type":"xml","z":"e69b5c9f.49237","name":"xml to obj","property":"payload","attr":"","chr":"","x":280,"y":80,"wires":[["85a4eae3.9ec5a8","7655a6d0.106238"]]},{"id":"7655a6d0.106238","type":"change","z":"e69b5c9f.49237","name":"empty","rules":[{"t":"set","p":"payload","pt":"msg","to":"\"\"","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":430,"y":120,"wires":[["8a45d1e1.5db92"]]},{"id":"1e25b534.f6a0cb","type":"http in","z":"e69b5c9f.49237","name":"","url":"/test","method":"post","upload":false,"swaggerDoc":"","x":120,"y":80,"wires":[["94321f38.1215a"]]}]

Dose that maybe have something to do with a missing certificate?

kind regards,

  NetHAT SPI configuration
Posted by: thp9 - June-10th-2020, 01:46 PM - Forum: Software - Replies (1)


I want to use the NetHAT via a non linux embedded environment. I'm using the M4 processor of the STM32MP157C-DK2 board.
I didn't think it would be too difficult knowing that the netShield which uses the same netX52 works with stm32 nucleo boards
The netHAT has EtherCAT firmware already loaded from linux
For the SPI configuration I used the exact same code from one of the samples along with cifxToolkit taken from "STM32CubeExpansion_netX_F7_F4_V1.3.0.1" file on your website for the netShield

SpiHandle.Instance               = SPIx;
SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;
SpiHandle.Init.Direction         = SPI_DIRECTION_2LINES;
SpiHandle.Init.CLKPhase          = SPI_PHASE_2EDGE;
SpiHandle.Init.CLKPolarity       = SPI_POLARITY_HIGH;
SpiHandle.Init.DataSize          = SPI_DATASIZE_8BIT;
SpiHandle.Init.FirstBit          = SPI_FIRSTBIT_MSB;
SpiHandle.Init.TIMode            = SPI_TIMODE_DISABLE;
SpiHandle.Init.CRCCalculation    = SPI_CRCCALCULATION_DISABLE;
SpiHandle.Init.CRCPolynomial     = 7;
SpiHandle.Init.NSS               = SPI_NSS_SOFT;
SpiHandle.Init.Mode              = SPI_MODE_MASTER;

With this configuration I'm receiving bytes backward, and shifted one bit and with 0xFF between each byte.
When I set CLKPhase to SPI_PHASE_1EDGE, I'm receiving the bytes, shifted one bit to left and 0xFF between each byte
Here is a picture that illustrates the problem:
[Image: 9YfCYNH.png]
The spi is configured to 50mhz.
I have tried all combinations of CLKPhase and CLKPolarity and none works as it should.
Does the netHat have a different configuration for SPI than the netShield ? Because the configuration from the sample you provided for the netShield doesn't seem to work on the netHat
Can I get more information about how the netHat spi is configured and how should I configure my master spi correctly ?

Thank you

  Application developed with commercial Raspberry Pi
Posted by: tad - June-10th-2020, 07:10 AM - Forum: Software - Replies (4)

Dear Armin,

I think this information likely explained somewhere but could you please let me know again?

Can I run an application developed with commercial (standard) Raspberry Pi, on netPI without changing it at all?
If so, I would like to know its procedure, please.

If my application is made in Python, I guess that I should install Docker on the Rapsberry Pi, create a container where the Python program runs, and load this image onto netPI.
But, I am not 100% sure, which procedure is a normal way.
I guess it may be a normal procedure to use a bare metal model of netPI and copy all Raspberry's environment to netPI.

Moreover, if I want to use the DI/DO extension (NIOT-E-NPIX-4DI4DO) for my own container, I can't imagine how to develop it.

Thank you very much for your information.
Best regards,

  netpi-desktop-hdmi with setting network=bridge
Posted by: tad - June-10th-2020, 06:45 AM - Forum: Software - Replies (13)

Dear Armin,

I have created an application that displays an html screen using Node-RED.
This application works fine, but an external computer is required to view the html screen.
I just need a monitor instead of the computer.

Therefore, I deployed a new container (https://hub.docker.com/r/hilschernetpi/n...sktop-hdmi) on the same netPI.
At this time, I set Network=bridge mode even though this site explains below:
>The container needs to run in host network mode.
I then can see the html screen from a web browser via a monitor directly connected to netPI.

VNCViewer and SSH terminal cannot access to the hdmi container, but it is fine for me. 
I don't need to access it from any external devices.
(I understand a Node-RED container is the host mode and this container is prohibited to be access from the port 22.)

Therefore, the hdmi container can be set to bridge mode?
(Is there any fetal problem?)

Thank you very much for your advice.
Best regards,

  VPN tunnel to netPI and local network in 10 minutes
Posted by: Armin@netPI - June-5th-2020, 05:40 PM - Forum: Software - No Replies

Here is how to install, setup and operate a containerized OpenVPN server on a netPI.

Physically you need:

  • an Internet router supporting dynamic DNS and port forwarding
  • an Internet connection with this Internet router
  • a netPI RTE 3 or CORE 3 connected to the Internet router over Ethernet either with a static or dynamic IP address
  • a dynDNS service provider like https://account.dyn.com/ and that is providing you a constant Internet DNS hostname for your Internet router
  • dynDNS service enabled on your Internet router with your personal credentials received from the dynDNS provider
  • activated port forwarding for the external Internet port 1194 forwarded to your netPI port 1194 on your Internet router
  • a Windows computer with installed SSH client tool putty and a TFTP client tool WinSCP
1. Install Raspbian OS container on your netPI
    The Raspbian container image is located here https://hub.docker.com/r/hilschernetpi/netpi-raspbian/
    Since the OpenVPN functionality needs extended access to netPI's networking services the container needs to be deployed as follows:
    Network Mode: bridge
    Port mapping: host 1194 -> Container 1194
                         host 22 -> Container 22
    Privileged Mode: on
    Device Map: Host "/dev/tun" -> Container "/dev/tun"
    Restart Policy: always
    Capabilities: NET_ADMIN switch set to on

2. Login over an SSH connection to the Raspbian OS container
    Open Putty, enter netPIs IP address in the Hostname field, use   port 22 (default) and click login. When asked enter user 'pi' and the password 'raspberry'.
    Then call the two following Linux commands one after the other:
sudo sed -i 's@debian@Raspbian@g' -i /usr/lib/os-release
curl -L https://raw.githubusercontent.com/pivpn/pivpn/master/auto_install/install.sh | bash

3. Fill out the questions during installation:
   Question "DHCP reservation" : IP Address, Gateway select yes
   Question "Choose a user" : select (*) pi
   Question "Installation mode" : select (*) OpenVPN
   Question "Protocol": select (*) TCP
   Question "Default openvpn Port": replace 443 with 1194
   Question "DNS Provider" : select Google
   Question "Custom Search Domain" : no
   Question "Public IP or DNS" : select (*) DNS Entry
   Question "Public DNS name": insert your personal domain name received from your DynDNS provider
   Question "ECDSA certificate size": select  (*) 256  Use a 256-bit certificate (recommended level)  
   Question "Unattended Upgraded": select no
   Question "Reboot": select no

4. Create a OpenVPN Client configuration file for a user
    Supposing you choose the user "armin" and the passphrase "12345678" call the command (example, replace with your own credentials)

sudo pivpn add -n armin -p 12345678
After that a new file will be generated under /home/pi/ovpns my as armin.opvn.

5. Configure the container to start relevant services whenever it is started
   Setup the OpenVPN server to start.
   Also configure proper routing so that netPI's local network connected to eth0 shall get available through the VPN tunnel also.
   Call the following command to edit the container's start script:

sudo nano /etc/init.d/entrypoint.sh

In the third line (or later) of the script insert the 3 additional code lines

sudo iptables -t nat -F POSTROUTING
sudo iptables -t nat -A POSTROUTING -o eth0 -s -j MASQUERADE
[b]sudo service openvpn start[/b]

The file at the beginning will then look like

#!/bin/bash +e
# catch signals as PID 1 in a container
[b]sudo iptables -t nat -F POSTROUTING
sudo iptables -t nat -A POSTROUTING -o eth0 -s -j MASQUERADE

[b]sudo service openvpn start[/b]
# SIGNAL-handler

Save you edits and confirm with <yes>

6. Download your created *.ovpn file to your Windows computer using program WinSCP
    Login to the netPI with WinSCP as with Putty in step 2. and the same credentials.
    Move the WinSCP explorer to the netPI folder /home/pi/ovpns/.
    Locate your file (my was armin.ovpn) and copy it to your Windows machine

7. Reboot your netPI now

8. While rebooting install a OpenVPN client like Windows OpenVPN Client
    Click the (+) to add a new server.
    Choose the option "IMPORT FROM FILE".
    Click "BROWSE" and locate your *.ovpn file on your Windows and let it load

9. Establish an OpenVPN connection switching the slider to position "on"
    The OpenVPN client will connect the Internet using the configured dynDNS name in the *.ovpn file.
    The name will be turned by DNS resolver into your Internet router's IP address.
    The Open VPN client will then get in touch with the router over its IP address at port 1194
    The Internet router forwards the port 1194 to netPI.
    The OpenVPN server is configured to listen to port 1194 and establishes a bidirectional connection to the OpenVPN client
    You should see the slider getting green in the OpenVPN client

10. Access to any local IP address connected to eth0 interface of netPI


  Siemens PLC -Uploading and downloading using netPI & VPN
Posted by: SAhire@hilscher.local - June-5th-2020, 09:18 AM - Forum: Software - Replies (22)

Dear Sir,

Our Customers want to access the Siemens S-7 PLC (Site Location ) to Remote Location PC for Uploading and downloading PLC projects using PLC software.

This application netPI/netConnect Gateway with VPN work?

Please send the details.


I try to check with open VPN.
Please find the attached document for your reference.

Attached Files Thumbnail(s)

.pdf   Project 4_Install OpenVPN for Raspbian.pdf (Size: 239.62 KB / Downloads: 4)

  cifX drivers EtherCAT read/write performance with NetHat over STM32
Posted by: thp9 - June-2nd-2020, 01:15 PM - Forum: Software - Replies (21)


I've started experimenting with EtherCAT and NetHAT over STM32MP157C-DK2 board. I measured the xChannelIORead and xChannelIOWrite performances and I'm obtaining results more than 2ms for each, between 4-5ms for both with a large amount of jitter. My embedded Linux is patched with PREEMPT_RT and the measurements were done inside a high priority RT thread.
I was expecting to get latencies < 1 ms for real time with EtherCAT and I was wondering if these measurements are expected on the NetHAT.

This is the function I used for measuring time:

uint64_t getTimeNanoseconds() {
    struct timespec ts;
    clock_gettime(CLOCK_MONOTONIC, &ts);
    return (uint64_t)(ts.tv_sec) * 1000000000 + (uint64_t)(ts.tv_nsec);

How the measurement is done:

    while(counter < 10000)
        while( CIFX_DEV_NO_COM_FLAG == (lRet = xChannelBusState( hChannel, CIFX_BUS_STATE_ON, &ulState, 10))){
           printf("Waiting for Bus communication!\r\n");

        abSendData[1] = !abSendData[1];    

        startTime = getTimeNanoseconds();
        if(CIFX_NO_ERROR == (lRet = xChannelIORead(hChannel, 0, 0, sizeof(abRecvData), abRecvData, 10))){
            tr_r = getTimeNanoseconds() - startTime;
            sum_r += tr_r;
            rTimes[counter] = tr_r;
        else {
            printf("Error reading \n");
            return NULL;

        startTime = getTimeNanoseconds();

        if(CIFX_NO_ERROR == (lRet = xChannelIOWrite(hChannel, 0, 0, sizeof(abSendData), abSendData, 10))){
            tr_wr = getTimeNanoseconds() - startTime;
            sum_wr += tr_wr;
            wTimes[counter] = tr_wr;
        else {
            printf("Error writing \n");
            return NULL;


        printf("R | Time : %llu Average : %llu | W | Time : %llu Average : %llu |\n", tr_r, sum_r / counter, tr_wr, sum_wr / counter);    


I obtain different performances depending on "cycleTime" - time between each read/write call -  I have much more jitter with cycle time < 1ms than for example 10ms. I also have different performances depending on when I execute, I can execute same code twice and get different average latencies. 

The cycle time of the master is 200us for sending/receiving process data.

I'm not quite familiar with real time protocol programming and I would like to know if these measurements are expected if not I'm curious to know the cause of these latencies.

 Thank you,

  netPI-netx-programming-examples update
Posted by: slos - May-27th-2020, 02:36 PM - Forum: Software - Replies (12)

Hello there,

Could you please consider updating :

Thanks a lot for your kind support.


  Profinet communication between plc and pc
Posted by: leehc - May-26th-2020, 08:57 AM - Forum: Software - Replies (1)

Dear all experts,

Currently, I want to build window-based software to communicate with Siemense S7 PLC through PROFINET.
Because there are no detail information and protocol stacks about PROFINET, I tried to use exisiting libraries or tools.

I have CIFX 50-RE (1250.100) PCI card, and I found the materials from Hilscher.
However, in the hilscher's materials, there are only example about PROFINET controller.

But, I want to build PROFINET device for Windows PC.
Is there any materials or references?

Thank you, best regards.

  Third-party analog inputs
Posted by: mnieuzyla - May-25th-2020, 12:44 PM - Forum: Hardware - Replies (1)


We're looking for the possibility to read some signals from control cabinet to the NetPi device. Howewer, I've read that the analog extension board was planned, but not phased into production.

In that case, do you know if there are other (maybe third-party) modules/extensions that could handle a couple of industrial grade (so 0-10V/4-20mA) analog input signals?