AdamLaurie / RFIDIOt

python RFID / NFC library & tools
http://www.rfidiot.org/
1.03k stars 223 forks source link

Cannot detect reader #16

Open lesbeben opened 9 years ago

lesbeben commented 9 years ago

Hi,

I apologize in advance for posting this here, there just does not seem to be a forum dedicated to rfidiot.

I'm starting a project for an NFC toolkit GUI based on rfidiot, but I cannot seem to make it detect my reader (a PN533-based Ask LoGo). I thought rfidiot was based on libnfc, but nfc-list can access my reader without trouble, whereas rfidiot gives me: "There is no such reader #0, PCSC sees only 0 reader(s)".

I'm using libnfc 1.7.0 in a Kali Linux VM, running in VMWare, my C programs based on libnfc work perfectly on it.

When I try using the VMWare CCID driver instead of the libnfc one, rfidiot detects my reader but is still unable to select any card I present.

Any thoughts on that? Is this a compatibility issue with the newest API? Should I downgrade to libnfc 1.6 ?

Sorry and thank you!

kirelagin commented 9 years ago

Well, judging by PCSC in your output, I’d guess you don’t actually tell RFIDIOt to use libnfc. What does running with -N output?

kirelagin commented 9 years ago

Ah, I assumed you were using one of RFIDIOt example tools. If you are talking to the rfidiot class directly, then the reader option is your friend.

If you study the rfidiot class you’ll notice that the error you are referring to is output only

if self.readertype == self.READER_PCSC`
lesbeben commented 9 years ago

Actually it was both... I feel stupid, I don't know why I was under the impression that rfidiot was built on top of libnfc. Anyway, thanks for your answer, I tried readtag.py -N, I now get:

"error libnfc.driver.pn53x_usb Unable to set USB configuration (Device or resource busy) LibNFC ver 1.7.0 devices (0): no supported devices!"

when nfc-list gives me: "nfc-list uses libnfc 1.7.0 NFC device: ASK / LoGO opened 1 ISO14443A passive target(s) found: ISO/IEC 14443A (106 kbps) target:" Etc...

Do you have any idea why this could happen?

lesbeben commented 9 years ago

Also, when I run an rfidiot script, my reader's LEDs turn on and stay on, at least until I run some other tool, such as nfc-list.

kirelagin commented 9 years ago

Hm…

  1. Does your nfc reader have proper permissions for you to access it? I mean, if you can use nfc-list, it probably does… but are you running nfc-list and RFIDIOt scripts as the same user? Might it be that nfc-list is setuid or something?
  2. libnfc is known to interfere with certain kernel nfc modules, so check that they are not loaded (lsmod | grep nfc and lsmod | grep pn53). Well, since nfc-list works, again, this is probably not the case, but I don’t have any other ideas.
lesbeben commented 9 years ago

I'm sudoing both programs, so they are both running with root privileges.

lsmod shows no nfc or pn53 module loaded, before or after running 'nfc-list' or 'script.py -N'.

The weirdest thing is, the rfidiot scripts are actually communicating with my reader, since running them puts it in 'read mode' (two green lights on) however, they still output

"error libnfc.driver.pn53x_usb Unable to set USB configuration (Device or resource busy)"

and the reader is then stuck until I unplug it or until I run 'nfc-list'.

I have yet to try the reader option you mentionned in my own program, but I figured since the rfidiot-provided scripts won't run, I should focus on that before moving on to more complicated issues.

Thanks again for your help, I'll look into it and come back if I ever find something relevant!

Cheers.

niklasent commented 3 years ago

I know that it's a bit late (>5 years) but did you solve the issue? I encounter the same problem now. :D