Raspberry cant communicate with ACR122U - java

I dont know why appear this exception in the execution
javax.smartcardio.CardException: list() failed
at sun.security.smartcardio.PCSCTerminals.list(PCSCTerminals.java:126)
at javax.smartcardio.CardTerminals.list(CardTerminals.java:72)
at prueba.ClaseNFC.doCardReaderCommunication(ClaseNFC.java:41)
at prueba.Prueba.main(Prueba.java:20)
Caused by: sun.security.smartcardio.PCSCException: SCARD_E_NO_READERS_AVAILABLE
at sun.security.smartcardio.PCSC.SCardListReaders(Native Method)
at sun.security.smartcardio.PCSCTerminals.list(PCSCTerminals.java:80)
... 3 more
The code is:
TerminalFactory terminalFactory;
terminalFactory = TerminalFactory.getDefault();
System.out.println(terminalFactory);
List<CardTerminal> terminals = terminalFactory.terminals().list();
System.out.println("Terminals: " + terminals);
if (terminals.isEmpty()) {
throw new Exception("No card terminals available");
}
Its strange because the RPi recognize the card reader with the command "lsusb" where appear "Bus 001 Device 007: ID 072f:2200 Advanced Card Systems, Ltd".
I have been reading days ago and people talk about install the PC/SC Package from the page of ACR122U - http://www.acs.com.hk/en/products/3/acr122u-usb-nfc-reader/ - and it will solve the problem. Indeed, that package is useful to the amd64 and i386 architecture and the RPi has a ARM architecture with Raspbian (Debian/Linux).
My question is, could you help me in the way to install that package in a ARM architecture? or someway to solve my problem?
Thank you

If you have same issue this is the solution.
First time, you must install the ACR122 drivers. In this case, we hare using a Raspberry, so we must download the next driver: http://www.acs.com.hk/download-driver-unified/6258/ACS-Unified-Driver-Lnx-Mac-108-P.zip.
Unzip the file inside a folder, go to "acsccid-1.X.X" and run "./configure"
Open and edit raspi-blacklist.conf inside of "/etc/modprobe.d/" and add the next two lines at the end:
blacklist nfc
blacklist pn533
Reboot raspberry

Related

Red5 Installed but Connection Failing

I am managing to install Red5 onto my VPS (I can tell it worked from looking up the IP/5080) but when it comes to testing, I get a connection failed error.
I am using terminal on mac for entering commands and cyberduck for accessing the directories/ftp.
I install java & ant, open ports 1935 and 5080 along with Red5 itself.
The problem could be to do with using certain versions but I really don't know after so many attempts to get this connected.
I've attempted to use several tutorials out there, but the commands don't work so I've only been able to narrow down the sources to use.
URL used for installing Red5 w/tutorial: http://www.muktware.io/setup-red5-streaming-media-server/
This source worked for me flawlessly but it doesn't connect, it's the only source I've followed the commands where it created and installed/started up the red5 application.
URL I found useful for further testing: http://blog.svnlabs.com/install-red5-1-0-1-on-centos-release-6-5-final-64-bit/
The second URL helped me because it helped me open ports, install ant which the first one didn't along with exporting paths etc.
Error I receive when testing connection with OFLA demo on Red5:
(110) Connections: true | true
(12643) connected?: true
(12911) NetConnection.onStatus:
data =
version = 4,0,0,1121
type = red5
fmsVer = RED5/1,0,5,0
capabilities = 33
mode = 1
description = Connection succeeded.
code = NetConnection.Connect.Success
level = status
(12914) catchVideos: [type Function]
(12976) NetConnection.onStatus:
stacktrace = org.red5.server.service.ServiceInvoker.invoke(ServiceInvoker.java:106),org.red5.server.net.rtmp.RTMPHandler.invokeCall(RTMPHandler.java:186),org.red5.server.net.rtmp.RTMPHandler.onCommand(RTMPHandler.java:293),org.red5.server.net.rtmp.BaseRTMPHandler.messageReceived(BaseRTMPHandler.java:105),org.red5.server.net.rtmp.ReceivedMessageTask.call(ReceivedMessageTask.java:57),org.red5.server.net.rtmp.ReceivedMessageTask.call(ReceivedMessageTask.java:11),java.util.concurrent.FutureTask.run(FutureTask.java:266),java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511),java.util.concurrent.FutureTask.run(FutureTask.java:266),java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142),java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617),java.lang.Thread.run(Thread.java:745)
11 = java.lang.Thread.run(Thread.java:745)
10 = java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
9 = java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
8 = java.util.concurrent.FutureTask.run(FutureTask.java:266)
7 = java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
6 = java.util.concurrent.FutureTask.run(FutureTask.java:266)
5 = org.red5.server.net.rtmp.ReceivedMessageTask.call(ReceivedMessageTask.java:11)
4 = org.red5.server.net.rtmp.ReceivedMessageTask.call(ReceivedMessageTask.java:57)
3 = org.red5.server.net.rtmp.BaseRTMPHandler.messageReceived(BaseRTMPHandler.java:105)
2 = org.red5.server.net.rtmp.RTMPHandler.onCommand(RTMPHandler.java:293)
1 = org.red5.server.net.rtmp.RTMPHandler.invokeCall(RTMPHandler.java:186)
0 = org.red5.server.service.ServiceInvoker.invoke(ServiceInvoker.java:106)
application = org.red5.server.service.ServiceNotFoundException
description = Service not found: demoService
code = NetConnection.Call.Failed
level = error
I've also tried to use the very latest version of Red 5 but this returns the exact same error.
As for java, I've used:
yum -y install java-1.6.0-openjdk java-1.6.0-openjdk-devel
and
yum install java
Then for ant I just used
wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.8.2-bin.tar.gz
I know there will be newer versions of ant but I'm open to suggestions on what I could test.
I have Googled this plenty of times and I searched on here before I made this post. I seen a few attempts but since updates appear to affect red5, I'll use this post as a fresh updated version of hopefully tackling the problem.
I've noticed different sources suggest placing the applications into different paths each time
Thanks for your help.
Dev

QC Connection from Java using Com4

I am trying to connect to QC using code below :
ITDConnection2 QCconn= ClassFactory.createTDConnection();
QCconn.initConnectionEx(Parameters.QC_URL);
QCconn.login(Parameters.QC_USERNAME, Parameters.QC_PASSWORD);
QCconn.connect(Parameters.QC_DOMAIN, Parameters.QC_PROJECT);
But i am getting exception at line
ITDConnection2 QCconn= ClassFactory.createTDConnection();
Exception:
com4j.ComException: 80004002 QueryInterface failed : No such interface supported : .\com4j.cpp:163
I have QC install on my PC. I am gettign same error on other PCs as well.
Which Version of Quality Center your are trying to connect ?
The otaclient.jar file should be compatible with OTACLIENT.dll.
You should also include com4j.jar in the build path.
We got the same problem, we got com4j.jar in the build path
We try to connect to QC 11 but our windows also has QC 10 installed.
So there was a problem in the version of the QC. We installed TDConnect from QC 11 to get the code running.
If you run QC 10 it rolls back OTAClient.dll 11 to 10 again.
You have also add otaclient.dll to java.library.path in the VM arguments.
We resolved this issue by reinstalling Quality center 11.52 and run the IE in admin mode and it added the TDConnect plugin to QC , then java program connected to the QC.

Java RXTXcomm lib to connect to /dev/ttyACM0

I'm using RXXTX java lib to connect to serial ports. I'm using this lib with no problems connecting to /dev/ttyUSB0 (1,2,3,etc).
But when I want to connect to /dev/ttyACM0 the port its not found.
CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier("/dev/ttyACM0");
the Exception is thrown:
gnu.io.NoSuchPortException
at gnu.io.CommPortIdentifier.getPortIdentifier(CommPortIdentifier.java:218)
I already listed all the ports but no success.
Processing and USB ports /dev/ttyACM0, /dev/ttyACM1, ....
http://pblog.ebaker.me.uk/2011/09/processing-usb-ports-devttyacm0.html
Processing doesn't like reading Linux USB devices like /dev/ttyACM0 or
/dev/ttyACM1.
The solution is easy, just symlink the devices like this...
ln -s /dev/ttyACM[x] /dev/ttyS8[x]
You can put any number after the ttyS, although it is possible that
ttyS0 and other low numbers are defined, numbers in the eighties are
(almost) guaranteed to work.
This might help you: https://groups.google.com/forum/#!topic/openhab/f-gVkwJg-hg
update your startup script to include "->Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0" in the Java command line

Serial Port accessing code for linux platform

I'm working on a project to communicate to the serial ports using Java. Do I need to have a device connected to serial port to test the following code?
Enumeration ports = CommPortIdentifier.getPortIdentifiers();
while (ports.hasMoreElements()) {
CommPortIdentifier port = (CommPortIdentifier) ports.nextElement();
String type;
switch (port.getPortType()) {
case CommPortIdentifier.PORT_PARALLEL:
type = "Parallel";
break;
case CommPortIdentifier.PORT_SERIAL:
type = "Serial";
break;
default: /// Shouldn't happen
type = "Unknown";
break;
}
System.out.println(port.getName() + ": " + type);
}
Any solution to make this code working. Currently I'm getting an error as follows.(without attaching any device to serial port.
Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z
at com.sun.comm.SunrayInfo.isSessionActive(Native Method)
at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155)
at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100)
at javax.comm.CommPortIdentifier.<clinit>(CommPortIdentifier.java:138)
at PortTest.main(PortTest.java:9)
Java Result: 1
I've configured comm with jre. I've followed this blog to do it.
You're missing the native libraries required. The line above the error lines you posted is telling you that.
You need to install the javax.comm extention - http://www.oracle.com/technetwork/java/index-jsp-141752.html
If you're using windows, it's no longer supported or available from Sun/Oracle. You may be able to find an older version on the net or someone else porting it.
After a bit struggles, I got the code running.
One mistake I made was using RxTx 2.2 library for Fedora 13. It uses 2.2 version of libSerial and libParellal files and 2.1 RxTxComm jar file. When I removed it and used RxTx2.1 I got an error like following.
gnu.io.RXTXCommDriver cannot be cast to javax.comm.CommDriver
While checking for this error, I found the second mistake I made and solution for the above problem. I was using RxTx Driver with java Comm API. Actually the required class files in Java Comm API is already available in the RxTx library with in "gnu.io" package.
So I changed all the javax.comm.* packages to gnu.io.*. Now I can run the application without any error.

JPOS Configuration Problems for an Epson POS printer in Windows

I'm trying to print using jPOS in Windows and get the following exception:
jpos.JposException: Could not connect to service with logicalName = Printer: Exception.message=jp.co.epson.uposcommon.util.EpsonJposServiceInstanceFactory
at jpos.loader.simple.SimpleServiceConnection.connect(Unknown Source)
at jpos.BaseJposControl.open(Unknown Source)
...
More information:
I'm trying to port our Java printing software from Linux (where it works well) to Windows. We are using an Epson TM-T70 receipt printer. I installed the regular printer drivers and was immediately able to print stuff using notepad, for instance.
Now I installed the Epson JavaPoS ADK. I configured the printer using the SetupPOS application that comes with the ADK. I created a new configuration for my printer with Logical Device Name "Printer". I saved everything and it created the jpos.xml file.
When I try run our application and it executes printer.open("Printer") where "Printer" is the logical device name and printer is a POSPrinter instance, I get the exception above.
I know that my generated jpos.xml file is being used because if I provide a random logical device name, I get a different exception.
I guess the problem is in the port configuration of SetupPOS. The printer is connected through USB. I tried the Port name that appears in the windows printer properties (ESDPRT001) and I even tried all combiniations of COM1 to COM10 but nothing works.
Does anyone have some suggestion? Thanks!
The Installation Routine of the Epson JavaPOS ADK is ... ahm ... let me say: "very special". So the Installation copies some jar files (like epsonupos.jar, jposXXX.jar and some more) in the ext/lib Directory of the JRE (!!!) (which must be selected while installing the JavaPOS Driver). We had also some very strange effects if we install another JavaPOS Version, switching to another JRE/JDK, using other Printers which are not from Epson or somthing else.
May be your problem is a result of any conflicts between different jar Version or JDK's or somthing else ...
EDIT:
Since ADK Version 1.11.anywhat (not realy sure, but I mean 1.11.9) you can specify the path in which the additional jar files are stored. But: Some DLL's will be also in the currently newest ADK Version (1.13.17) stored into the bin directory of the selected JRE. May be this is also a conflict between different Versions of used jar's and used DLLs or something else ...
I Solved this adding the following library paths to java project:
C:\Program Files\EPSON\JavaPOS\lib
C:\Program Files\EPSON\JavaPOS\SetupPOS
With javaPOS 1.14.6, on Debian 9 Linux I solved with LD_LIBRARY_PATH:
$ export LD_LIBRARY_PATH = /opt/EpsonJavaPOS/bin && javapos_application_to_run
On windows 10 copy:
BluetoothIO.DLL
epsonjpos.dll
EthernetIO31.DLL
SerialIO31.dll
USBIO31.DLL
from C:\Program Files\EPSON\JavaPOS\bin\
to C:\Program Files\Java\jre1.8.0.171\bin\
Run javaPOS application.
I know is a little late for response but may help others with similar problems.
In my case i am interacting with a Data logic Scanner using javapos, and i was having this message:
ERROR: Failed to open DL-Magellan-9400i-USB-OEM-Scanner-Scale profile, jpos.JposException: Could not connect to service with logicalName = DL-Magellan-9400i-USB-OEM-Scanner-Scale:
Exception.message=com.dls.jpos.service.DLSScannerInstanceFactory
i started looking in the javapos software that downloaded from datalogic and found that there was a jar file that was not included in my classpath (JavaPOS.jar) and that was why i was getting the error, take a look netx image:
I wanted to share in case someone has same issues.
(Took me almost 2 days to get it done!!)

Categories