My coworkers and I are trying to create a Java program to read cards with a HID OMNIKEY 5427 CK. We have no previous experience with RFID and checked: https://support.impinj.com/hc/communities/public/questions/201883748-How-do-I-create-RFID-applications-with-Java-
for some sample code (we haven't been able to find much sample code apart from this), which we have adapted and used, but when running our code we get
java.nio.channels.UnresolvedAddressException
at sun.nio.ch.Net.checkAddress(Unknown Source)
at sun.nio.ch.SocketChannelImpl.connect(Unknown Source)
at org.apache.mina.transport.socket.nio.SocketConnector.connect(SocketConnector.java:187)
at org.apache.mina.transport.socket.nio.SocketConnector.connect(SocketConnector.java:137)
at org.apache.mina.common.support.BaseIoConnector.connect(BaseIoConnector.java:40)
at org.llrp.ltk.net.LLRPConnector.connect(LLRPConnector.java:135)
at org.llrp.ltk.net.LLRPConnector.connect(LLRPConnector.java:116)
at hellojavaltk.HelloJavaLtk.connect(HelloJavaLtk.java:212)
at hellojavaltk.HelloJavaLtk.run(HelloJavaLtk.java:227)
at hellojavaltk.HelloJavaLtkMain.main(HelloJavaLtkMain.java:9)
code is basically:
public class HelloJavaLtkMain
{
public static void main(String[] args) throws InterruptedException
{
HelloJavaLtk app = new HelloJavaLtk();
System.out.println("Starting reader.");
app.run("HID-OMNIKEY-5427-CK");
Thread.sleep(30000);
System.out.println("Stopping reader.");
app.stop();
System.out.println("Exiting application.");
System.exit(0);
}
}
and HelloJavaLtk is a class that implements the LLRPEndpoint interface, basically copy-pasted form the link above.
So we don't know if we are just not addressing the device correctly with that run("HID-OMNIKEY-5427-CK") or if we should be doing something completely different when trying to reach that Endpoint.
We would appreciate any help if somebody has been able to use the OMNIKEY-5427-CK (or other card readers) with Java code, could point us to other code examples or give us further insights on what are we doing wrong.
Thanks all.
The HID OMNIKEY 5427 CK is a PC/SC (CCID) compliant smartcard reader. The library you are trying to use is intended for EPC RFID readers. This Omnikey reader is accessed through PC/SC, however. Current Oracle Java has built in support for access to PC/SC smartcard readers using the Java SmartcardIO API.