EtherCAT Master: any options? - 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: EtherCAT Master: any options? (/thread-219.html) |
RE: EtherCAT Master: any options? - andreash - April-19th-2019 (April-17th-2019, 05:38 PM)Armin@netPI Wrote: Well if you read the readme of the Codesys container carefully it says using Field network communications such as Profinet or EtherCAT along with Codesys requires to start the container in “host” mode, else in “bridged” mode the container is getting a local IP address (typically 172.17.0.1...2...3) and subnet mask (255.255.0.0) by Docker and the master function can hence only be driven to this subnet (172.17.0.x) only which is not what you want. Therefore the host mode is needed letting the TCP/IP stack (and the IP setting) of the host system be shared with the container giving full access to eth0 then as if it is running on the host. Oh yes... I have suspected that and it got lost somehow. I discovered that DNS resolves do not work anymore. The hilschernetpi/netpi-netx-ethernet-lan/ works in host mode as expected with correct DNS. Nevertheless when I deploy the merged container on the device in host mode I get pings of IP addresses but DNS is broken. Do you came accross that already? I'm so close now... Thank you very much for you comments and help, Andreas RE: EtherCAT Master: any options? - Armin@netPI - April-19th-2019 Yes indeed we had changed the Ethernet LAN container a little end of last week to simplify it, but unfortunately we have forgotten to resolve the gateway address settings. I suppose this is why your merged container does not work properly. It will be corrected tuesday next week. RE: EtherCAT Master: any options? - Armin@netPI - April-20th-2019 Hello Andreas, I have a question concerning the hilschernetpi/netpi-netx-ethernet-lan/ source code you used for your merged container. We have modified this container that everybody has the possibility now to choose between DHCP or static IP configuration via environment variables. So I suspect that you have maybe a new source code and have not recognized this new feature. Can you double check please? RE: EtherCAT Master: any options? - Armin@netPI - April-23rd-2019 I have investigated a little bit your DNS problem. If you have successfully setup a cifx0 interface then calling the command Code: ip route show will give you a similar output like the following Code: default via 172.17.0.1 dev eth0 There are two networks up and running and the default route is via the docker0 bridge 172.17.0.1. If I now remove the network cable of eth0 and call Code: ping google.com then I get no response ... cause all unroutable network traffic goes through eth0 due to the default route setting ... but eth0 connection it is no more. If I now call Code: ip route delete default to set the routing to the exisiting cifx0 then ping to google.com works fine as expected. So I cannot confirm with the latest container that resolving DNS does not work. RE: EtherCAT Master: any options? - andreash - April-30th-2019 Hello Armin, thank you for your post and help. Playing a little bit around with these things it seems to work sometimes via wifi. Sometimes it does not. I need to further investigate and I will write here. Now I'm using the latest version of the hilschernetpi/netpi-netx-ethernet-lan/ container as a starting point. During the process of standard gateway modifications via ip command I got also this message Code: sudo: unable to resolve host NetPi1 I could fix that by log in as root and run Code: echo 127.0.0.1 computer_name >> /etc/hosts When I restart the NetPi and log into the container via ssh things look like this Code: default via 192.168.0.1 dev cifx0 If I delete all default routes except the one for wlan0 in line 3 then it works when I have wifi connection. Unfortunately with this configuration it does not work (Internet access through the router which has ip 192.168.0.1 and is connected to cifx0 via a switch): Code: default via 192.168.0.1 dev cifx0 I'm getting closer... Best, Andreas RE: EtherCAT Master: any options? - Armin@netPI - April-30th-2019 About you netPI resolve problem: I suppose you gave your netPI "NetPi1" as Hostname in the main control panel, correct? Instead of writing the very same Hostname manuall into the /etc/hosts/ file you can prevent this message if a.) you set the parameter "Hostname" in the container start parameter with the same name as you used on your host b.) create a new user-defined network that automatically embeds a DNS server for the containers using this network: https://docs.docker.com/v17.09/engine/userguide/networking/configure-dns/ Regards RE: EtherCAT Master: any options? - andreash - May-20th-2019 Quite for a time it seemed like everything is working now. But today I discovered that there is no more internet access from portainer and all containers in bridge mode. Only the container which is in host mode and controls the cifx0 interface has internet accesss. I think I missed something. This worked already but I don't see the difference now. RE: EtherCAT Master: any options? - Armin@netPI - May-20th-2019 Hello Andreas, I remember that you have created container yourself with a mix of CoDeSys container and Ethernet-LAN container, is my understanding correct? What is with your Dockerfile to build your container, can you post it, so we can have a look on it. If you say "Quite for a time it seemed like everything is working now". What does that mean? We both had the last contact 20 days ago. So what your are saying is that 20 days it worked fine and since day 21 it doesn't any more? Is my understanding correct. What I can tell you is that containers - and this is the advantage of a container - are running always in the manner when you restart it. A big benefit. So if there is trouble today then this was also a problem in the past 20 says, but was not recognized and the "bug" was sleeping. What does the command return? Code: ip route show Thx Armin RE: EtherCAT Master: any options? - andreash - May-21st-2019 Hello, Yes that is correct, I built a container uniting the codesys and the netx containers. I use the cifx0 interface for codesys ide connection and internet connection via a router which is at 192.168.0.1. The following configuration does not work (Internet connection inside the container (host mode) where I do the ip route show command, but no internet connection of the host system (e.g. portainer webinterface) and no connection in other bridge mode containers (e.g. node-red in bridge mode).): Code: pi@NetPi1:~$ ip route show Code: pi@NePi1:~$ ip route show My docker file and scripts are at github: https://github.com/fokkersim/netPI-netx-ethernet-lan Best regards, Andreas RE: EtherCAT Master: any options? - Armin@netPI - May-21st-2019 Hello Andreas, please watch our latest edits in the current entrypoint.h https://github.com/HilscherAutomation/netPI-netx-ethernet-lan/blob/master/init.d/entrypoint.sh. I see you are using an older version. Pls update your container accordingly and try again. There is a new command "ip route flush dev cifx0" implemented and very important, the line "ip link set cifx0 up" is now located right after the line "/opt/cifx/cifx0daemon", Thx Armin |