RFID driver : error at first read after startup of the device (connection lost)

Hello,

I need to fix an RFID chip read/write application (sick rfu630).
After each start of the RFID reader, the first reading always fails.
I see then the following error in the gateway:

	Exception caught; connection lost.
java.io.IOException: An existing connection was forcibly closed by the remote host
at java.base/sun.nio.ch.SocketDispatcher.read0(Native Method)
at java.base/sun.nio.ch.SocketDispatcher.read(Unknown Source)
at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(Unknown Source)
at java.base/sun.nio.ch.IOUtil.read(Unknown Source)
at java.base/sun.nio.ch.IOUtil.read(Unknown Source)
at java.base/sun.nio.ch.SocketChannelImpl.read(Unknown Source)
at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:258)
at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:722)
at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:658)
at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:584)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:496)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:986)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)

From the second reading the problem disappears.

But the problem also appears when the RFID reader is not used for a few hours.

Any idea ?

Thanks !

That means the reader itself is to blame. Search its documentation for timeouts or power-saving modes or similar behaviors that might cause it to cut off Ignition's connection.

Are you using the TCP driver to communicate with it?

yes

The TCP driver has an "Inactivity Timeout" setting that you might try setting to something like 15 seconds.

3 Likes

it was setted to 0. I change to 15000.
Now, after the start, the problem no longer appears.
I have to check after a long time without reading.
I will do that tomorrow morning.

Thanks !

1 Like

the problem is still there.
it just happened during my tests

I made tests during one day : no more error on log, no more error at start of the device
and after a long time without activity too.
But I have some reading errors.
I think it occurs during the reconnection (reconnection is display on GW log, reconnection and error occur at the same time).
So I will try there settings :

  • Inactivity Timeout : 30s
  • increase timeout of the device.
1 Like