Does nfcpy support passive mode?

Asked by wobyci

Hi,

I have used npp_test_server.py to communicate between RC-S370 and Nexus S,
it works fine.

After reading the source, I found nfcpy is using 424 kbps active mode. for testing,
I adapted the setting to 106 kbps passive mode as below:

pn53x.py 585
         rsp = self.dev.in_jump_for_dep("active", "424", pollrq, nfcid3, general_bytes)
->
         rsp = self.dev.in_jump_for_dep("passive", "106", "", nfcid3, general_bytes)

and I got an error because of no reponse from Nexus S.

Does nfcpy support passive mode? or Nexus S can only work at 424 kbps active mode?

Any information will be appreciated.

Thanks,

Jun

------------------------------------------------------------------------------------------------------

2011-09-12 16:03:08,390 INFO [nfc.dev.pn53x] searching for a usb bus reader
2011-09-12 16:03:08,608 INFO [nfc.dev.pn53x] trying reader at usb port bus-0:\\.\libusb0-0001--0x054c-0x02e1
2011-09-12 16:03:08,608 DEBUG [nfc.dev.pn53x] >>> 0000ff00ff00
2011-09-12 16:03:08,608 DEBUG [nfc.dev.pn53x] GetFirmwareVersion
2011-09-12 16:03:08,608 DEBUG [nfc.dev.pn53x] >>> 0000ff02fed4022a00
2011-09-12 16:03:08,608 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:08,608 DEBUG [nfc.dev.pn53x] <<< 0000ff06fad50333013007bd00
2011-09-12 16:03:08,608 INFO [nfc.dev.pn53x] chipset is a PN533 version 1.48
2011-09-12 16:03:08,608 DEBUG [nfc.dev.pn53x] ResetMode
2011-09-12 16:03:08,608 DEBUG [nfc.dev.pn53x] >>> 0000ff03fdd418011300
2011-09-12 16:03:08,625 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:08,625 DEBUG [nfc.dev.pn53x] <<< 0000ff02fed5191200
2011-09-12 16:03:08,625 DEBUG [nfc.dev.pn53x] >>> 0000ff00ff00
2011-09-12 16:03:08,640 DEBUG [nfc.dev.pn53x] ATR_RES timeout: 102.4 ms
2011-09-12 16:03:08,640 DEBUG [nfc.dev.pn53x] non-DEP timeout: 204.8 ms
2011-09-12 16:03:08,640 DEBUG [nfc.dev.pn53x] RFConfiguration
2011-09-12 16:03:08,640 DEBUG [nfc.dev.pn53x] >>> 0000ff06fad432020b0b0cd600
2011-09-12 16:03:08,640 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:08,655 DEBUG [nfc.dev.pn53x] <<< 0000ff02fed533f800
2011-09-12 16:03:08,655 DEBUG [nfc.dev.pn53x] RFConfiguration
2011-09-12 16:03:08,655 DEBUG [nfc.dev.pn53x] >>> 0000ff06fad43205020100f200
2011-09-12 16:03:08,655 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:08,671 DEBUG [nfc.dev.pn53x] <<< 0000ff02fed533f800
2011-09-12 16:03:08,671 DEBUG [nfc.dev.pn53x] ResetMode
2011-09-12 16:03:08,671 DEBUG [nfc.dev.pn53x] >>> 0000ff03fdd418011300
2011-09-12 16:03:08,671 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:08,687 DEBUG [nfc.dev.pn53x] <<< 0000ff02fed5191200
2011-09-12 16:03:08,687 DEBUG [nfc.dev.pn53x] >>> 0000ff00ff00
2011-09-12 16:03:08,703 DEBUG [nfc.dev.pn53x] RFConfiguration
2011-09-12 16:03:08,703 DEBUG [nfc.dev.pn53x] >>> 0000ff06fad432820801086700
2011-09-12 16:03:08,703 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:08,703 DEBUG [nfc.dev.pn53x] <<< 0000ff02fed533f800
2011-09-12 16:03:08,717 DEBUG [nfc.dev.pn53x] WriteRegister
2011-09-12 16:03:08,717 DEBUG [nfc.dev.pn53x] >>> 0000ff05fbd408630d00b400
2011-09-12 16:03:08,717 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:08,717 DEBUG [nfc.dev.pn53x] <<< 0000ff03fdd509002200
2011-09-12 16:03:08,717 DEBUG [nfc.dev.pn53x] ReadRegister
2011-09-12 16:03:08,733 DEBUG [nfc.dev.pn53x] >>> 0000ff12eed406a01ba01ca01da01ea01fa020a021a0223200
2011-09-12 16:03:08,733 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:08,733 DEBUG [nfc.dev.pn53x] <<< 0000ff0af6d507ed771c11418561f17b00
2011-09-12 16:03:08,750 DEBUG [nfc.dev.pn53x] RFConfiguration
2011-09-12 16:03:08,750 DEBUG [nfc.dev.pn53x] >>> 0000ff0bf5d4320bed771c11418561f14600
2011-09-12 16:03:08,750 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:08,750 DEBUG [nfc.dev.pn53x] <<< 0000ff02fed533f800
2011-09-12 16:03:08,765 DEBUG [nfc.clf] using driver <nfc.dev.pn53x.device object at 0x00C881B0>
2011-09-12 16:03:08,765 DEBUG [nfc.dev.pn53x] listen: gb=46666d0101110202038003020003040164070103 timeout=346 ms
2011-09-12 16:03:08,765 DEBUG [nfc.dev.pn53x] ResetMode
2011-09-12 16:03:08,765 DEBUG [nfc.dev.pn53x] >>> 0000ff03fdd418011300
2011-09-12 16:03:08,780 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:08,780 DEBUG [nfc.dev.pn53x] <<< 0000ff02fed5191200
2011-09-12 16:03:08,780 DEBUG [nfc.dev.pn53x] >>> 0000ff00ff00
2011-09-12 16:03:08,796 DEBUG [nfc.dev.pn53x] TgInitAsTarget
2011-09-12 16:03:08,796 DEBUG [nfc.dev.pn53x] >>> 0000ff39c7d48c0201010000004001fe696ec0f79a740000000000000000ffff01fe696ec0f79a74000046666d0101110202038003020003040164070103f900
2011-09-12 16:03:08,796 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:09,171 ERROR [nfc.dev.pn53x] libusb0-dll:err [_usb_reap_async] timeout error

2011-09-12 16:03:09,171 DEBUG [nfc.dev.pn53x] >>> 0000ff00ff00
2011-09-12 16:03:09,171 DEBUG [nfc.dev.pn53x] polling for NFC-A technology
2011-09-12 16:03:09,171 DEBUG [nfc.dev.pn53x] ResetMode
2011-09-12 16:03:09,187 DEBUG [nfc.dev.pn53x] >>> 0000ff03fdd418011300
2011-09-12 16:03:09,187 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:09,187 DEBUG [nfc.dev.pn53x] <<< 0000ff02fed5191200
2011-09-12 16:03:09,187 DEBUG [nfc.dev.pn53x] >>> 0000ff00ff00
2011-09-12 16:03:09,217 DEBUG [nfc.dev.pn53x] InListPassiveTarget
2011-09-12 16:03:09,217 DEBUG [nfc.dev.pn53x] >>> 0000ff04fcd44a0100e100
2011-09-12 16:03:09,217 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:09,233 DEBUG [nfc.dev.pn53x] <<< 0000ff0cf4d54b01010008400408aa50870900
2011-09-12 16:03:09,233 DEBUG [nfc.dev.pn53x] NFC-A target found at 106 kbps
2011-09-12 16:03:09,250 DEBUG [nfc.dev.pn53x] NFC-A configured for DEP
2011-09-12 16:03:09,250 DEBUG [nfc.dev.pn53x] polling for a dep target
2011-09-12 16:03:09,250 DEBUG [nfc.dev.pn53x] ResetMode
2011-09-12 16:03:09,250 DEBUG [nfc.dev.pn53x] >>> 0000ff03fdd418011300
2011-09-12 16:03:09,250 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:09,265 DEBUG [nfc.dev.pn53x] <<< 0000ff02fed5191200
2011-09-12 16:03:09,265 DEBUG [nfc.dev.pn53x] >>> 0000ff00ff00
2011-09-12 16:03:09,280 DEBUG [nfc.dev.pn53x] InJumpForDEP
2011-09-12 16:03:09,280 DEBUG [nfc.dev.pn53x] >>> 0000ff23ddd45600000601fed834f57a0508983146666d01011102020380030200030401640701035100
2011-09-12 16:03:09,280 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:09,296 DEBUG [nfc.dev.pn53x] <<< 0000ff03fdd55701d300
2011-09-12 16:03:09,296 DEBUG [nfc.dev.pn53x] ResetMode
2011-09-12 16:03:09,296 DEBUG [nfc.dev.pn53x] >>> 0000ff03fdd418011300
2011-09-12 16:03:09,312 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:09,312 DEBUG [nfc.dev.pn53x] <<< 0000ff02fed5191200
2011-09-12 16:03:09,312 DEBUG [nfc.dev.pn53x] >>> 0000ff00ff00
2011-09-12 16:03:09,328 DEBUG [nfc.dev.pn53x] RFConfiguration
2011-09-12 16:03:09,328 DEBUG [nfc.dev.pn53x] >>> 0000ff04fcd4320100f900
2011-09-12 16:03:09,328 DEBUG [nfc.dev.pn53x] <<< 0000ff00ff00
2011-09-12 16:03:09,328 DEBUG [nfc.dev.pn53x] <<< 0000ff02fed533f800

Question information

Language:
English Edit question
Status:
Solved
For:
nfcpy Edit question
Assignee:
No assignee Edit question
Solved by:
Stephen Tiedemann
Solved:
Last query:
Last reply:
Revision history for this message
Best Stephen Tiedemann (stephen-tiedemann) said :
#1

Thanks for the trigger, similar corrections were needed to get a Samsung Bada phone working. Turned out that for passive initialization the RF field needs to be shut down before DEP activation (because type A technology had already been detected and activated). This is now fixed with the just committed revision #93 and I've also made the DEP activation try passive if active mode failed (again needed for the Samsung Bada phone).

To test with 106 kbps passive only, change line 589 to (don't miss the comma before the last closing bracket):

    for mode, speed in (("passive", "106"), ):

Revision history for this message
wobyci (wobyci) said :
#2

Thanks for the helpful information.

106 kbps passive mode also works fine with Nexus S now.

Jun

Revision history for this message
wobyci (wobyci) said :
#3

Thanks Stephen Tiedemann, that solved my question.