java.util.concurrent.CompletionException: io.netty.channel.ConnectTimeoutException: connection timed out: /10.22.2.241:44818
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.postComplete(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.completeExceptionally(Unknown Source)
at com.digitalpetri.enip.EtherNetIpClient.lambda$bootstrap$8(EtherNetIpClient.java:391)
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:577)
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:570)
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:549)
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:490)
at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:615)
at io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:608)
at io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:117)
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:263)
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:170)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: io.netty.channel.ConnectTimeoutException: connection timed out: /10.22.2.241:44818
at io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe$1.run(AbstractNioChannel.java:261)
Look into what @lrose suggested. The controller just isn’t responding to the TCP connection being opened, so maybe it does need some extra configuration. Usually they don’t but these 310’s have 2 ethernet ports and can operate in Dual IP or DLR as mentioned.
You should be able to get the configuration for the network ports from the built-in web server on the PLC. If you look in the diagnostic folder in the web server, there should be a section for network settings. No PLC software needed.
So from there you would just be checking to see if the network settings for port A1 match the settings for port A2 or if they are configured as Dual IP. I do not believe that is the issue though, as you are saying you can reach the PLC from the gateway.
I ran into a similar issue in the past trying to connect one of the new CompactLogix PLCs (I think 5069-L330ER maybe?), and I could not get the Ignition Logix driver to connect to the PLC either. To correct it, I simply used the legacy Compact driver instead and haven’t had any issues with it since. However, you mention in the original post that you have already tried that driver to no avail.
In the PLC web server, could you go into the Advanced Diagnostics section, there should be a TCP Connection table and a TCP Statistics page. I’m wondering if the PLC can see the gateway attempting the connection.