nfcpy stops sending queries to RC-S380
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nfcpy |
Fix Released
|
High
|
Stephen Tiedemann |
Bug Description
I've hit a problem that I believe is caused by a race condition when using a Sony RC-S380.
In the attached USB packet log, nfcpy stops polling the NFC hardware at packet 283 (which is the last USB Bulk out transfer).
This bug only appears is very specific cases:
On a Gigabyte J1900N-D3V motherboard, we have never seen it.
On a Intel i7 laptop, it happens rarely (maybe one time in 50)
On a Intel i5, it appears nearly every time when logging is turned off in nfcpy.
With logging turned on, the Intel i5 machine works about half the time.
These tests are using exactly the same software and OS image.
I'm using the NFC reader in tag emulation mode, to send data to an Android phone (although I doubt that is relevant for the problem).
We are using the following revision:
revno: 268
committer: <email address hidden>
branch nick: trunk
timestamp: Wed 2015-11-25 12:01:37 +0100
message: Sony RC-S330 does not support listen as Type 4A Target
Here is the output from the python logging:
INFO Setting up NFC
INFO searching for reader on path usb
DEBUG using pyusb version 1.x
DEBUG path matches '^(usb|)$'
DEBUG loading rcs380 driver for usb:054c:06c1
DEBUG firmware version 1.11
DEBUG package data format 1.00
DEBUG firmware version 1.11
INFO using SONY RC-S380/S NFC Port-100 v1.11 at usb:001:005
DEBUG connect('llcp',)
INFO Setting up Bluetooth, and then car dealer
DEBUG connect options after startup: llcp
INFO Setting up Car Dealer scanner
INFO Scanning for a car dealer access point: car_dealer
INFO Checking wifi status...
DEBUG listen 1.000 seconds for DEP
DEBUG listen_dep for 1.000 sec
DEBUG nfca_params 01015e2ac640
DEBUG nfcf_params 01fe4b5305cc4d7
DEBUG wait 1000 ms for activation
DEBUG sense 106A atr_req=
DEBUG sense 106A
DEBUG polling for NFC-A technology
DEBUG found None
DEBUG sense 106A
DEBUG polling for NFC-A technology
DEBUG found None
DEBUG listen 1.000 seconds for DEP
DEBUG listen_dep for 1.000 sec
DEBUG nfca_params 010154b7e540
DEBUG nfcf_params 01febe183d0116c
DEBUG wait 1000 ms for activation
DEBUG sense 106A atr_req=
DEBUG sense 106A
DEBUG polling for NFC-A technology
DEBUG found None
DEBUG sense 106A
DEBUG polling for NFC-A technology
DEBUG found None
DEBUG listen 1.000 seconds for DEP
DEBUG listen_dep for 1.000 sec
DEBUG nfca_params 01014e299840
DEBUG nfcf_params 01fe3e437fba250
DEBUG wait 1000 ms for activation
I can reproduce this using beam.py. Here is a log of it failing:
./beam.py -d nfc.clf -v send link "http:// www.google. com" dd62a01ff00 dd72b00fe00 ed6200a00 cd7211101f600 ed6220800 cd72300010500 dd606002400 dd707002200 ed6200a00 cd7211101f600 dd606002400 dd707002200 900000000000000 00ffff cd640080bd700 dd74100e800 8d6420001010102 07dc00 dd74300e600 cd6420100e700 dd74300e600 1838f4001fe3810 878e4c590000000 000000000ffff00 00e803 dd6480000ffff01 010181838f4001f e3810878e4c5900 00000000000000f fff0000e8032400 7d7490000008000 00006000 dd606002400 dd707002200 D4008876CCE473C B4F315932000000 3246666D0101110 20207FF03020013 040132070103
[main] enable debug output for 'nfc.clf'
[nfc.clf] searching for reader on path usb
[nfc.clf.transport] using pyusb version 1.x
[nfc.clf.transport] path matches '^(usb|)$'
[nfc.clf.device] loading rcs380 driver for usb:054c:06c1
[nfc.clf.transport] >>> 0000ff00ff00
[nfc.clf.rcs380] SetCommandType 01
[nfc.clf.transport] >>> 0000ffffff0300f
[nfc.clf.transport] <<< 0000ff00ff00
[nfc.clf.transport] <<< 0000ffffff0300f
[nfc.clf.rcs380] GetFirmwareVersion
[nfc.clf.transport] >>> 0000ffffff0200f
[nfc.clf.transport] <<< 0000ff00ff00
[nfc.clf.transport] <<< 0000ffffff0400f
[nfc.clf.rcs380] firmware version 1.11
[nfc.clf.rcs380] GetPDDataVersion
[nfc.clf.transport] >>> 0000ffffff0200f
[nfc.clf.transport] <<< 0000ff00ff00
[nfc.clf.transport] <<< 0000ffffff0400f
[nfc.clf.rcs380] package data format 1.00
[nfc.clf.rcs380] SwitchRF 00
[nfc.clf.transport] >>> 0000ffffff0300f
[nfc.clf.transport] <<< 0000ff00ff00
[nfc.clf.transport] <<< 0000ffffff0300f
[nfc.clf.rcs380] GetFirmwareVersion
[nfc.clf.transport] >>> 0000ffffff0200f
[nfc.clf.transport] <<< 0000ff00ff00
[nfc.clf.transport] <<< 0000ffffff0400f
[nfc.clf.rcs380] firmware version 1.11
[nfc.clf] using SONY RC-S380/S NFC Port-100 v1.11 at usb:004:004
[nfc.clf] connect('llcp',)
[nfc.snep.server] snep server bound to port 4 (MIU=1984, RW=15), will accept up to 1048576 byte NDEF messages
[nfc.clf] connect options after startup: llcp
[nfc.clf.rcs380] SwitchRF 00
[nfc.clf.transport] >>> 0000ffffff0300f
[nfc.clf.transport] <<< 0000ff00ff00
[nfc.clf.transport] <<< 0000ffffff0300f
[nfc.clf] listen 1.000 seconds for DEP
[nfc.clf.rcs380] listen_dep for 1.000 sec
[nfc.clf.rcs380] nfca_params 010181838f40
[nfc.clf.rcs380] nfcf_params 01fe3810878e4c5
[nfc.clf.rcs380] TgSetRF 080b
[nfc.clf.transport] >>> 0000ffffff0400f
[nfc.clf.transport] <<< 0000ff00ff00
[nfc.clf.transport] <<< 0000ffffff0300f
[nfc.clf.rcs380] TgSetProtocol 000101010207
[nfc.clf.transport] >>> 0000ffffff0800f
[nfc.clf.transport] <<< 0000ff00ff00
[nfc.clf.transport] <<< 0000ffffff0300f
[nfc.clf.rcs380] TgSetProtocol 0100
[nfc.clf.transport] >>> 0000ffffff0400f
[nfc.clf.transport] <<< 0000ff00ff00
[nfc.clf.transport] <<< 0000ffffff0300f
[nfc.clf.rcs380] wait 1000 ms for activation
[nfc.clf.rcs380] TgCommRF 0000ffff0101018
[nfc.clf.transport] >>> 0000ffffff2300d
[nfc.clf.transport] <<< 0000ff00ff00
[nfc.clf.transport] <<< 0000ffffff0900f
[nfc.clf.rcs380] SwitchRF 00
[nfc.clf.transport] >>> 0000ffffff0300f
[nfc.clf.transport] <<< 0000ff00ff00
[nfc.clf.transport] <<< 0000ffffff0300f
[nfc.clf] sense 106A atr_req=
[nfc.clf.rcs380] SwitchRF 00
[nfc.clf.transport] >>>...