Hilscher Community Forum
RTE3 Use real time ethernet as "normal" ethernet interface - Printable Version

+- Hilscher Community Forum (https://forum.hilscher.com)
+-- Forum: netPI 3 - Docker featuring Industrial Raspberry Pi 3 platform (https://forum.hilscher.com/forum-1.html)
+--- Forum: Software (https://forum.hilscher.com/forum-5.html)
+--- Thread: RTE3 Use real time ethernet as "normal" ethernet interface (/thread-410.html)

Pages: 1 2 3 4 5 6


RTE3 Use real time ethernet as "normal" ethernet interface - hannes - March-18th-2019

Hello,

is it possible to use the real time ethernet interfaces of the RTE 3 as a "normal" ethernet network interface?

Thanks!
BR
Hannes


RE: RTE3 Use real time ethernet as "normal" ethernet interface - Armin@netPI - March-18th-2019

Sure Hannes, just follow this example here https://hub.docker.com/r/hilschernetpi/netpi-netx-ethernet-lan/


RE: RTE3 Use real time ethernet as "normal" ethernet interface - hannes - March-18th-2019

(March-18th-2019, 10:17 AM)Armin@netPI Wrote: Sure Hannes, just follow this example here https://hub.docker.com/r/hilschernetpi/netpi-netx-ethernet-lan/

Great! Thanks. I will have a look on the example.

BR


RE: RTE3 Use real time ethernet as "normal" ethernet interface - Andi - March-26th-2019

Hey,

I didn't know, if I should open up a new topic or just reply here, since I've tested the proposed docker image.

Starting the container worked well and I can see both network adapters when typing "ip add show". To test the connection, I've started a mysql-server and tried to connect to it from another PC in the local network, which did not work. I've tried to use "host" and "bridge" as network-type and used the eth0-port for the connection. I can ping to my local PC from within the Container though. I tried to use the DNS and the IP, but I can't get a connection.

Since not even the eth0-port is working, I haven't tryed to use the cifx0.

Thanks for you Help!

Andi


RE: RTE3 Use real time ethernet as "normal" ethernet interface - Armin@netPI - March-27th-2019

Well, I would say using container "bridged" mode is always little tricky cause you have to specifically map all those ports needed by all your applications you have installed in the container ... but you are now also telling that "host" mode doesn't work either which I cannot explain. In "host" mode the container shares in all cases the network stack of the Linux host.
So not reaching the MYSQL-server from "outside" over your remote PC must have other reasons other than the chosen "host" mode. But let me ask you this: your remote PC runs a mysql-client, correct? Which one is it? And by the way which command are u using to install the mysql-server in the container? And also - since I am not so familiar with myqsl things - over which TCP/IP port/protocol is data exchanged over a mysql connection usually?

Thx
Armin


RE: RTE3 Use real time ethernet as "normal" ethernet interface - Andi - March-27th-2019

Hey Armin,

thanks for your fast reply.

I've tested the mysql-server in another container where it didn't work either, so the network settings were not the cause, sorry.
I have tried hard, but I just could not manage to get connections from outside to the mysql-server running on debian. On alpine linux it somehow works well. Since the drivers for the networks interface are debian-packages, I cannot integrate them in my alpine-linux-mysql container.

Since in Docker every task should run in its own container, wouldn't it be more straight forward to let the driver run in one container and the database in another container and somehow forward the incoming connections from the "network-container" to the "mysql-container"? Do you think this would work? And if so, do you have an idea what I would need to change?

Best regards,
Andi


RE: RTE3 Use real time ethernet as "normal" ethernet interface - Armin@netPI - March-28th-2019

Well, for a quick MySQL test to see if it works in principle I did the following now:

1.) I installed a MySQL client on my Windows machine first to be able to test remote servers.
2.) Then I pulled the MySQL image from the well known company hypriot from here https://hub.docker.com/r/hypriot/rpi-mysql/ (it installs an old verion 5.5 but never mind ... I just wanted to test)
3.) Then I started a container of it. There parameters are network mode "host" not to care about port mapping and the ENV variables MYSQL_ROOT_PASSWORD, MYSQL_DATABASE,MYSQL_USER and MYSQL_PASSWORD beeing set

In the Windows client I created a new connection and entered the netPI ip address instead of 127.0.0.1 ... and guess what it connected to my netPI. So there is no principle problem in letting a MySQL server run in a container.

The best of it now is you can analyse the original Dockerfile on Github of this image at https://github.com/hypriot/rpi-mysql/blob/master/Dockerfile to see what they have done to build this container. If you take over the line into your Dockerfile build lines you will get managed it to run your own MySQL server at a later version also


RE: RTE3 Use real time ethernet as "normal" ethernet interface - Andi - March-28th-2019

Okay, now I know what my problem was. I've missunderstood the description at the paragraph "Servicing the interface is only possible in the container it was created. It is not available to the Docker host or to any other containers started." I read it as if the whole interface was not available in other containers. That's the whole reason why I've tried to make a mysql-server work in the same container as the interface is hosted in.   Blush

Now I got it working, thanks! I can connect from eth0 and cifx0 to the mysql-database.

The problem I am facing now is that the netPi starts to freeze when the "netpi-netx-ethernet-lan"-container is active. Sometimes right at the start, sometimes it works for a short while and than it freezes. At the moment I am trying to figure out, what the problem might be. I have a feeling, that it only freezes, when another container runs at "host"-network as well. I will supply you with more info, when available.

Another problem, I was facing is configuring the interface to run in dhcp mode. I have configured the infterface-file "/etc/network/interfaces.d/cifx0" to look like this:
Code:
auto cifx0
allow-hotplug cifx0
iface cifx0 inet dhcp

But when I first started the container, the following error message occured:


Code:
Configuring network interfaces...failed.
ifup: failed to bring up cifx0
No DHCP client software found!

Afterwards, I installed a dhcp-client using this command:


Code:
apt-get install isc-dhcp-client

Now dhcp is basically working, an ip-adress, subnet mask and gateway were successfully retrieved. The only problem now is that it could not resolve the DNS-servers of our network but I don't really need that anyways.

Do you want to add the dhcp-client to your image? Otherwise I would build my own.


Regards,
Andi


RE: RTE3 Use real time ethernet as "normal" ethernet interface - Armin@netPI - March-29th-2019

Hello Andi,

I wanna first come back to your statement "netPI freezes". Freezes means to me that the only chance to get netPI back to life is to repower it? Or do you need just to restart the container? Or more easier just to restart the running cifx0daemon in the container?

Thx


RE: RTE3 Use real time ethernet as "normal" ethernet interface - Andi - March-29th-2019

Freezes means the green LED "act" does not blink anymore and only repowering gets it back into life. Since yesterday, the netPi runs stable with configuration:

netpi-netx-ethernet-lan on network "host"
mysql-server and other containers on own network using driver "bridge"

BR
Andi