Coolred / ismb-snep-java

Automatically exported from code.google.com/p/ismb-snep-java
0 stars 0 forks source link

Communication problems from ACR122U to Phone #4

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the ReaderToPhone Code.
2. Place the phone up against the reader when ready.
3. The message is not sent.

What is the expected output? What do you see instead?
Instead of send the message, I see that output:
IN JUMP FOR DEP done..
[DEBUG] {sending   [10 bytes]} 0xFF 0x00 0x00 0x00 0x05 0xD4 0x40 0x01 0x11 
0x20 
[DEBUG] {receiving [7 bytes]} 0xD5 0x41 0x00 0x00 0x00 0x90 0x00 
3 
[DEBUG] {sending   [10 bytes]} 0xFF 0x00 0x00 0x00 0x05 0xD4 0x40 0x01 0x11 
0x20 
[DEBUG] {receiving [7 bytes]} 0xD5 0x41 0x00 0x00 0x00 0x90 0x00 
3 
[DEBUG] {sending   [10 bytes]} 0xFF 0x00 0x00 0x00 0x05 0xD4 0x40 0x01 0x11 
0x20 
[DEBUG] {receiving [7 bytes]} 0xD5 0x41 0x00 0x00 0x00 0x90 0x00 
3 
[DEBUG] {sending   [10 bytes]} 0xFF 0x00 0x00 0x00 0x05 0xD4 0x40 0x01 0x11 
0x20 
[DEBUG] {receiving [7 bytes]} 0xD5 0x41 0x00 0x00 0x00 0x90 0x00 
3 
[DEBUG] {sending   [10 bytes]} 0xFF 0x00 0x00 0x00 0x05 0xD4 0x40 0x01 0x11 
0x20 
[DEBUG] {receiving [5 bytes]} 0xD5 0x41 0x13 0x90 0x00 
1

What version of the product are you using? On what operating system?
Last version, Windows 7 and Nexus S with Android 4.1.2.

Please provide any additional information below.
I have a lot of questions about the code. I suppose that after "IN JUMP FOR 
DEP" we wait till the length of the reply is 7, what means that the phone is 
waiting the data. However, I receive the repplies you can see above.

Could you help me? Could it be because the phone sends that message while the 
thread is sleeping?

I have done the tests with Android Beam enabled and disabled with no 
differences.

I would be grateful if you could help me.

Original issue reported on code.google.com by rporr...@gmail.com on 19 Nov 2012 at 1:36

GoogleCodeExporter commented 9 years ago
Hi rpoor,

i had also the same problem. Now I have a temporary solution to the problem.
The only thing I did was just reboot my Android phone. Then it works only once. 
The problem is not yet solved. Anf if you touch the screen to beam, the screen 
fades up slowly, while the problem remains.
At some point the LLCP Link is deactivated. See below.
Is there any way to activate the LLCP Link using some commands?

My LogCat looks like :
11-11 00:50:38.088: I/NFC-HCI(499): I'm P2P Active Initiator @ 424 kb/s
11-11 00:50:38.096: D/NFCJNI(499): Discovered P2P Target
11-11 00:50:38.096: D/NfcService(499): LLCP Activation message
11-11 00:50:38.111: I/NFC-HCI(499): I'm P2P Active Initiator @ 424 kb/s
11-11 00:50:38.119: I/NFCJNI(499): LLCP Link activated (LTO=10, MIU=128, 
OPTION=0x00, WKS=0x01)
11-11 00:50:38.119: I/NfcP2pLinkManager(499): LLCP activated
11-11 00:50:38.119: D/NfcP2pLinkManager(499): onP2pInRange()
11-11 00:50:38.260: D/dalvikvm(499): GC_FOR_ALLOC freed 3337K, 43% free 
14247K/24839K, paused 18ms, total 18ms
11-11 00:50:38.267: I/dalvikvm-heap(499): Grow heap (frag case) to 17.079MB for 
3265936-byte allocation
11-11 00:50:38.283: D/dalvikvm(499): GC_FOR_ALLOC freed 4K, 30% free 
17432K/24839K, paused 18ms, total 18ms
11-11 00:50:38.314: D/dalvikvm(499): GC_CONCURRENT freed 0K, 30% free 
17432K/24839K, paused 12ms+3ms, total 31ms
11-11 00:50:38.322: D/NfcP2pLinkManager(499): onP2pSendConfirmationRequested()
11-11 00:50:38.330: D/PhoneStatusBar(412): disable: < EXPAND* icons alerts 
ticker system_info back home recent clock >
11-11 00:50:38.408: W/InputMethodManagerService(311): Starting input on 
non-focused client 
com.android.internal.view.IInputMethodClient$Stub$Proxy@41bcd758 (uid=10071 
pid=26819)
11-11 00:50:38.994: I/NFCJNI(499): LLCP Link deactivated
11-11 00:50:39.017: D/NfcService(499): LLCP Link Deactivated message. Restart 
polling loop.
11-11 00:50:39.017: I/NfcP2pLinkManager(499): LLCP deactivated.
11-11 00:50:39.767: D/NfcP2pLinkManager(499): Debounce timeout
11-11 00:50:39.767: D/NfcP2pLinkManager(499): onP2pOutOfRange()
11-11 00:50:40.228: D/PhoneStatusBar(412): disable: < expand* icons alerts 
ticker system_info back home recent clock >
11-11 00:50:40.299: D/dalvikvm(499): GC_FOR_ALLOC freed 3207K, 43% free 
14247K/24839K, paused 16ms, total 17ms
11-11 00:50:40.307: I/dalvikvm-heap(499): Grow heap (frag case) to 17.216MB for 
3409936-byte allocation
11-11 00:50:40.322: D/dalvikvm(499): GC_FOR_ALLOC freed <1K, 30% free 
17577K/24839K, paused 18ms, total 18ms
11-11 00:50:40.353: D/dalvikvm(499): GC_CONCURRENT freed 0K, 30% free 
17577K/24839K, paused 12ms+3ms, total 32ms
11-11 00:50:51.002: D/dalvikvm(20243): GC_CONCURRENT freed 404K, 8% free 
12013K/12935K, paused 16ms+3ms, total 35ms
11-11 00:51:27.002: D/dalvikvm(20243): GC_CONCURRENT freed 403K, 8% free 
12013K/12935K, paused 15ms+3ms, total 37ms
11-11 00:51:55.596: W/ThrottleService(311): unable to find stats for iface 
rmnet0
11-11 00:51:55.775: I/System.out(20243): AlarmBroadcastReceiver - Phone 
Sleeping: false
11-11 00:51:55.783: I/System.out(20243): PollingService
11-11 00:51:56.619: I/System.out(20243): ChatSessionJSON - LOGGED IN
11-11 00:51:56.986: D/dalvikvm(20243): GC_CONCURRENT freed 407K, 8% free 
12016K/12935K, paused 12ms+3ms, total 33ms
11-11 00:51:57.830: D/ServerReconnect(20243): handleAmIOnlineOutEvent() true
11-11 00:52:28.721: D/dalvikvm(20243): GC_CONCURRENT freed 408K, 8% free 
12013K/12935K, paused 15ms+3ms, total 41ms
11-11 00:53:04.721: D/dalvikvm(20243): GC_CONCURRENT freed 404K, 8% free 
12013K/12935K, paused 16ms+2ms, total 34ms

Original comment by sammy.as...@gmail.com on 19 Nov 2012 at 11:14

GoogleCodeExporter commented 9 years ago
That's right Sammy! My LogCat shows the same output. I have seen that if I turn 
off and turn on he NFC connectivity it works once till I repeat the process.

Any issue? Could someone help us? I think that it is an importan issue.

Thanks in advance.

Original comment by rporr...@gmail.com on 20 Nov 2012 at 1:47

GoogleCodeExporter commented 9 years ago
Anyway, I think that the problem isn't due to the deactivation of the LLCP link 
because when the data is successfully sent the LLCP link is also deactivated.

I have seen that when the communication is correct:

D/NFCJNI(487): Failed to accept incoming socket  0x0096[NFCSTATUS_ABORTED]

Could that help us?

Original comment by rporr...@gmail.com on 21 Nov 2012 at 7:38

GoogleCodeExporter commented 9 years ago
I can also see this message:

E/NFCJNI(487): phLibNfc_Llcp_Send() returned 0x006f[NFCSTATUS_BUSY]

I have searched for NFCSTATUS_BUSY in Google and I have found this:

https://android.googlesource.com/platform/external/libnfc-nxp/+/6bd5058796097ae4
0ed41c283a69e7874f2e9db2

Original comment by rporr...@gmail.com on 21 Nov 2012 at 8:13

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Has this issue been solved? I'm getting the same error, and the only workaround 
that I know is to reboot the phone or reset the NFC.

Original comment by soko...@gmail.com on 9 Aug 2013 at 11:37