Unable to send NDEF message using snep-client example in libllcp and libnfc

279 views
Skip to first unread message

Sriram Gopalan

unread,
Feb 13, 2014, 8:34:40 AM2/13/14
to nfc-too...@googlegroups.com
Hello everybody, 

I am using a SCL3711 USB Dongle on Ubuntu 12.04 and the use case I am trying to achieve is to send a NDEF message to Android application. SCL3711 is intended to be the Initiator and the Android Phone is to be the Target.    

To get started, I cloned the git repository for libnfc and libllcp and could build them successfully. I used the snep-client to send a test NDEF to Moto X. It did not work and failed with an error code 0x13 for SYMM PDU. 

Here is the log that I collected. I patched the code to output current time ( patch attached ) and also to retry the pdu_send operation ignoring the error. However that did not help. Can you please help me as to what could be going wrong here. 


root@probook:/home/sriram/out/x86/bin# LIBNFC_LOG_LEVEL=3 ./snep-client
18:41:57.880 unknown libnfc.general log_level is set to 3
18:41:57.881 debug libnfc.general allow_autoscan is set to true
18:41:57.881 debug libnfc.general allow_intrusive_scan is set to false
18:41:57.881 debug libnfc.general 0 device(s) defined by user
18:41:57.966 debug libnfc.driver.pn53x_usb device found: Bus 002 Device 019
18:41:57.966 debug libnfc.general 1 device(s) found using pn53x_usb driver
18:41:57.966 debug libnfc.driver.pn53x_usb 3 element(s) have been decoded from "pn53x_usb:002:019"
18:41:57.972 debug libnfc.driver.pn53x_usb TX: 00 00 ff 00 ff 00 
18:41:57.973 debug libnfc.chip.pn53x GetFirmwareVersion
18:41:57.973 debug libnfc.driver.pn53x_usb TX: 00 00 ff 02 fe d4 02 2a 00 
18:41:57.974 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:57.974 debug libnfc.chip.pn53x PN53x ACKed
18:41:57.974 debug libnfc.driver.pn53x_usb RX: 00 00 ff 06 fa d5 03 33 02 07 07 e5 00 
18:41:57.974 debug libnfc.chip.pn53x GetFirmwareVersion
18:41:57.974 debug libnfc.driver.pn53x_usb TX: 00 00 ff 02 fe d4 02 2a 00 
18:41:57.975 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:57.976 debug libnfc.chip.pn53x PN53x ACKed
18:41:57.976 debug libnfc.driver.pn53x_usb RX: 00 00 ff 06 fa d5 03 33 02 07 07 e5 00 
18:41:57.976 debug libnfc.chip.pn53x SetParameters
18:41:57.976 debug libnfc.driver.pn53x_usb TX: 00 00 ff 03 fd d4 12 14 06 00 
18:41:57.977 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:57.977 debug libnfc.chip.pn53x PN53x ACKed
18:41:57.978 debug libnfc.driver.pn53x_usb RX: 00 00 ff 02 fe d5 13 18 00 
18:41:57.978 debug libnfc.general "SCM Micro / SCL3711-NFC&RW" (pn53x_usb:002:019) has been claimed.
libllcp.llc.link service 0x9e7aa30 bound to SAP 1
libllcp.llc.link service 0x9e7a990 bound to SAP 32
libllcp.mac.link (SCM Micro / SCL3711-NFC&RW) Attempting to activate LLCP Link as initiator
18:41:57.978 debug libnfc.chip.pn53x ReadRegister
18:41:57.979 debug libnfc.driver.pn53x_usb TX: 00 00 ff 0c f4 d4 06 63 02 63 03 63 0d 63 38 63 3d b0 00 
18:41:57.980 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:57.980 debug libnfc.chip.pn53x PN53x ACKed
18:41:57.980 debug libnfc.driver.pn53x_usb RX: 00 00 ff 08 f8 d5 07 00 00 00 00 00 00 24 00 
18:41:57.981 debug libnfc.chip.pn53x PN53X_REG_CIU_TxMode (Defines the transmission data rate and framing during transmission)
18:41:57.981 debug libnfc.chip.pn53x PN53X_REG_CIU_RxMode (Defines the transmission data rate and framing during receiving)
18:41:57.981 debug libnfc.chip.pn53x WriteRegister
18:41:57.981 debug libnfc.driver.pn53x_usb TX: 00 00 ff 08 f8 d4 08 63 02 80 63 03 80 59 00 
18:41:57.982 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:57.982 debug libnfc.chip.pn53x PN53x ACKed
18:41:57.982 debug libnfc.driver.pn53x_usb RX: 00 00 ff 03 fd d5 09 00 22 00 
18:41:57.982 debug libnfc.chip.pn53x RFConfiguration
18:41:57.983 debug libnfc.driver.pn53x_usb TX: 00 00 ff 04 fc d4 32 01 00 f9 00 
18:41:57.984 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:57.984 debug libnfc.chip.pn53x PN53x ACKed
18:41:57.988 debug libnfc.driver.pn53x_usb RX: 00 00 ff 02 fe d5 33 f8 00 
18:41:57.989 debug libnfc.chip.pn53x PN53X_SFR_P3 (Port 3 value)
18:41:57.989 debug libnfc.chip.pn53x ReadRegister
18:41:57.989 debug libnfc.driver.pn53x_usb TX: 00 00 ff 04 fc d4 06 ff b0 77 00 
18:41:57.990 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:57.990 debug libnfc.chip.pn53x PN53x ACKed
18:41:57.991 debug libnfc.driver.pn53x_usb RX: 00 00 ff 04 fc d5 07 00 3e e6 00 
18:41:57.991 debug libnfc.chip.pn53x RFConfiguration
18:41:57.991 debug libnfc.driver.pn53x_usb TX: 00 00 ff 04 fc d4 32 01 01 f8 00 
18:41:57.992 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:57.992 debug libnfc.chip.pn53x PN53x ACKed
18:41:57.992 debug libnfc.driver.pn53x_usb RX: 00 00 ff 02 fe d5 33 f8 00 
18:41:57.992 debug libnfc.chip.pn53x PN53X_SFR_P3 (Port 3 value)
18:41:57.993 debug libnfc.chip.pn53x ReadRegister
18:41:57.993 debug libnfc.driver.pn53x_usb TX: 00 00 ff 04 fc d4 06 ff b0 77 00 
18:41:57.993 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:57.993 debug libnfc.chip.pn53x PN53x ACKed
18:41:57.994 debug libnfc.driver.pn53x_usb RX: 00 00 ff 04 fc d5 07 00 3e e6 00 
18:41:57.994 debug libnfc.chip.pn53x PN53X_SFR_P3 (Port 3 value)
18:41:57.994 debug libnfc.chip.pn53x WriteRegister
18:41:57.994 debug libnfc.driver.pn53x_usb TX: 00 00 ff 05 fb d4 08 ff b0 3a 3b 00 
18:41:57.995 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:57.995 debug libnfc.chip.pn53x PN53x ACKed
18:41:57.996 debug libnfc.driver.pn53x_usb RX: 00 00 ff 03 fd d5 09 00 22 00 
18:41:57.996 debug libnfc.chip.pn53x RFConfiguration
18:41:57.996 debug libnfc.driver.pn53x_usb TX: 00 00 ff 06 fa d4 32 05 ff ff ff f8 00 
18:41:57.997 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:57.997 debug libnfc.chip.pn53x PN53x ACKed
18:41:57.998 debug libnfc.driver.pn53x_usb RX: 00 00 ff 02 fe d5 33 f8 00 
libllcp.mac.link (SCM Micro / SCL3711-NFC&RW) nfc_initiator_init() succeeded
18:41:57.998 debug libnfc.chip.pn53x ReadRegister
18:41:57.998 debug libnfc.driver.pn53x_usb TX: 00 00 ff 0e f2 d4 06 63 02 63 03 63 05 63 38 63 3c 63 3d 19 00 
18:41:57.999 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:57.999 debug libnfc.chip.pn53x PN53x ACKed
18:41:58.000 debug libnfc.driver.pn53x_usb RX: 00 00 ff 09 f7 d5 07 00 80 80 00 00 00 00 24 00 
18:41:58.000 debug libnfc.chip.pn53x PN53X_REG_CIU_TxAuto (Controls the settings of the antenna driver)
18:41:58.000 debug libnfc.chip.pn53x PN53X_REG_CIU_Control (Contains miscellaneous control bits)
18:41:58.000 debug libnfc.chip.pn53x WriteRegister
18:41:58.000 debug libnfc.driver.pn53x_usb TX: 00 00 ff 08 f8 d4 08 63 05 40 63 3c 10 cd 00 
18:41:58.001 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:58.001 debug libnfc.chip.pn53x PN53x ACKed
18:41:58.002 debug libnfc.driver.pn53x_usb RX: 00 00 ff 03 fd d5 09 00 22 00 
18:41:58.002 debug libnfc.chip.pn53x RFConfiguration
18:41:58.002 debug libnfc.driver.pn53x_usb TX: 00 00 ff 06 fa d4 32 05 ff ff ff f8 00 
18:41:58.003 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:58.003 debug libnfc.chip.pn53x PN53x ACKed
18:41:58.003 debug libnfc.driver.pn53x_usb RX: 00 00 ff 02 fe d5 33 f8 00 
18:41:58.003 debug libnfc.chip.pn53x InJumpForDEP
18:41:58.003 debug libnfc.chip.pn53x Timeout value: 300
18:41:58.003 debug libnfc.driver.pn53x_usb TX: 00 00 ff 17 e9 d4 56 00 02 07 00 ff ff 00 0f 00 01 02 03 04 05 06 07 08 09 46 66 6d 7a 00 
18:41:58.004 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:58.004 debug libnfc.chip.pn53x PN53x ACKed
18:41:58.046 debug libnfc.driver.pn53x_usb RX: 00 00 ff 20 e0 d5 57 00 01 01 fe 72 30 1d 5c be 37 6c 91 00 00 00 0e 32 46 66 6d 01 01 11 03 02 00 13 04 01 96 a8 00 
libllcp.mac.link (SCM Micro / SCL3711-NFC&RW) nfc_initiator_poll_dep_target() succeeded
libllcp.mac.link (SCM Micro / SCL3711-NFC&RW) LLCP Link activated (initiator)
libllcp.llc.link llc_link_configure (0x9e80298, (nil), 0)
libllcp.llc.link mq_open (/libllcp-14393-0x9e80298-up)
libllcp.llc.link mq_open (/libllcp-14393-0x9e80298-down)
libllcp.llc.link LLC Link started successfully
libllcp.llc.llc (0xb74cfb40) Link activated
libllcp.llc.llc (0xb74cfb40) mq_receive+
libllcp.mac.link Sending 2 bytes
libllcp.mac.link LTOs: 1000 ms (local), 100 ms (remote)
18:41:58.046 debug libnfc.chip.pn53x InDataExchange
18:41:58.046 debug libnfc.chip.pn53x Timeout value: 1100
18:41:58.046 debug libnfc.driver.pn53x_usb TX: 00 00 ff 05 fb d4 40 01 00 00 eb 00 
18:41:58.047 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:58.047 debug libnfc.chip.pn53x PN53x ACKed
libllcp.mac.link Could not send 2 bytes
libllcp.mac.link NFC error: Timeout
libllcp.mac.link Received 0 bytes (Requested 8192, buffer size 0)
libllcp.mac.link Received 0 PDU bytes
libllcp.mac.link Sending 2 bytes
libllcp.mac.link Sending 2 bytes
libllcp.mac.link LTOs: 1000 ms (local), 100 ms (remote)
18:41:58.951 debug libnfc.chip.pn53x InDataExchange
18:41:58.951 debug libnfc.chip.pn53x Timeout value: 1100
18:41:58.951 debug libnfc.driver.pn53x_usb TX: 00 00 ff 05 fb d4 40 01 11 20 ba 00 
18:41:58.961 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:58.961 debug libnfc.chip.pn53x PN53x ACKed
libllcp.mac.link Could not send 2 bytes
libllcp.mac.link pdu_send returned -6
libllcp.mac.link Received 0 bytes (Requested 8192, buffer size 0)
libllcp.mac.link Received 0 PDU bytes
libllcp.mac.link Sending 2 bytes
libllcp.mac.link Sending 2 bytes
libllcp.mac.link LTOs: 1000 ms (local), 100 ms (remote)
18:41:59.966 debug libnfc.chip.pn53x InDataExchange
18:41:59.966 debug libnfc.chip.pn53x Timeout value: 1100
18:41:59.966 debug libnfc.driver.pn53x_usb TX: 00 00 ff 05 fb d4 40 01 00 00 eb 00 
18:41:59.976 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:41:59.976 debug libnfc.chip.pn53x PN53x ACKed
libllcp.mac.link Could not send 2 bytes
libllcp.mac.link pdu_send returned -6
libllcp.mac.link Received 0 bytes (Requested 8192, buffer size 0)
libllcp.mac.link Received 0 PDU bytes
libllcp.mac.link Sending 2 bytes
libllcp.mac.link Sending 2 bytes
libllcp.mac.link LTOs: 1000 ms (local), 100 ms (remote)
18:42:00.979 debug libnfc.chip.pn53x InDataExchange
18:42:00.979 debug libnfc.chip.pn53x Timeout value: 1100
18:42:00.979 debug libnfc.driver.pn53x_usb TX: 00 00 ff 05 fb d4 40 01 00 00 eb 00 
18:42:00.980 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:42:00.980 debug libnfc.chip.pn53x PN53x ACKed
^Clibllcp.llc.connection Stopping Data Link Connection [32 -> 4]
libllcp.llc.link Deactivating LLC Link
libllcp.llc.link The LLC Link has an active MAC link
libllcp.mac.link MAC Link deactivation requested (reason: 0)
18:42:01.583 debug libnfc.driver.pn53x_usb TX: 00 00 ff 00 ff 00 
libllcp.mac.link Could not send 2 bytes
18:42:01.587 debug libnfc.chip.pn53x InDeselect
18:42:01.587 debug libnfc.driver.pn53x_usb TX: 00 00 ff 03 fd d4 44 00 e8 00 
18:42:01.593 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:42:01.593 debug libnfc.chip.pn53x PN53x ACKed
libllcp.mac.link pdu_send returned -7
libllcp.mac.link MAC Link deactivated
libllcp.llc.link Back to LLC Link deactivation
libllcp.llc.link Stopping Data Link Connection [110 -> 183]
libllcp.llc.connection Stopping Data Link Connection [32 -> 4]
libllcp.llc.connection Freeing Data Link Connection [32 -> 4]
libllcp.llc.link Data Link Connection [110 -> 183] stopped
libllcp.llc.link LLC Link deactivated
libllcp.llc.link Freeing service 32
libllcp.llc.link Freeing service 1
18:42:01.755 debug libnfc.driver.pn53x_usb TX: 00 00 ff 00 ff 00 
18:42:01.756 debug libnfc.chip.pn53x InRelease
18:42:01.756 debug libnfc.driver.pn53x_usb TX: 00 00 ff 03 fd d4 52 00 da 00 
18:42:01.765 debug libnfc.driver.pn53x_usb RX: 00 00 ff 00 ff 00 
18:42:01.765 debug libnfc.chip.pn53x PN53x ACKed
root@probook:/home/sriram/out/x86/bin# 


Regards,
Sriram
prefix_current_time_in_log_output.patch
libllcp_do_not_give_up_on_timeout_error.patch
libllcp_safe_cleanup_when_connection_incomplete.patch

Jiapeng Li

unread,
Feb 13, 2014, 7:27:14 PM2/13/14
to nfc-too...@googlegroups.com
Please try snep-server to see what is happening. 

Also. Now there is a new branch of libllcp named `socket`, 
this `socket` branch adds some new features to libllcp, see commits for details.
but it is a beta version, need some test to see if it is stable, feel free to try it.


--
You received this message because you are subscribed to the Google Groups "nfc-tools developers group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nfc-tools-dev...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

JiapengLi
Blog:jiapeng.me
GitHubgithub.com/jiapengli
AboutMe: about.me/lich


Jiapeng Li

unread,
Feb 13, 2014, 7:28:55 PM2/13/14
to nfc-too...@googlegroups.com
By the way, what is the version of your Android?

Sriram Gopalan

unread,
Feb 14, 2014, 4:06:44 AM2/14/14
to nfc-too...@googlegroups.com
Thanks. I will try the socket branch and post back. 

The Android version on Moto-X is  4.4 Kitkat

Sriram
Reply all
Reply to author
Forward
0 new messages