• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RTE3 Use real time ethernet as "normal" ethernet interface
#1
Hello,

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

Thanks!
BR
Hannes
  Reply
#2
Sure Hannes, just follow this example here https://hub.docker.com/r/hilschernetpi/n...ernet-lan/
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

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

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

BR
  Reply
#4
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
  Reply
#5
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
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#6
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
  Reply
#7
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/blo...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
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#8
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
  Reply
#9
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
You never fail until you stop trying.“, Albert Einstein (1879 - 1955)

  Reply
#10
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
  Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Modbus TCP Connection via RTE Ethernet Ports Flo_Lo 18 473 April-15th-2019, 09:50 PM
Last Post: Armin@netPI
  [SOLVED] Use netX interface as profinet controller jromero248 2 53 January-10th-2019, 12:30 PM
Last Post: jromero248
  IP Realtime Ethernet michu252 7 323 August-21st-2018, 10:41 AM
Last Post: Armin@netPI
  EtherCAT Slave OP mode (netPI RTE3) mauroriva 1 110 June-20th-2018, 08:38 AM
Last Post: Armin@netPI
  What is needed to be a PROFINET slave (RTE3) jkohlmann 1 104 March-7th-2018, 06:31 AM
Last Post: Armin@netPI
  NTP setup (Network time protocol) zulliger@software-natives.ch 1 98 February-7th-2018, 09:05 PM
Last Post: Armin@netPI
  Web browser reports "insecure connection" when accessing netPI for the first time Armin@netPI 0 82 December-3rd-2017, 01:40 PM
Last Post: Armin@netPI

Forum Jump:


Users browsing this thread: 1 Guest(s)