Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unknown mifare tag (Mifare::Error) #3

Open
paulomcnally opened this issue Jun 8, 2016 · 9 comments
Open

Unknown mifare tag (Mifare::Error) #3

paulomcnally opened this issue Jun 8, 2016 · 9 comments

Comments

@paulomcnally
Copy link

D, [2016-06-08T17:12:17.454115 #9944] DEBUG -- : Library version: 1.7.0-rc7
D, [2016-06-08T17:12:17.683679 #9944] DEBUG -- : Available readers: [#<NFC::Reader:0x005613904b5ec0 @name="acr122_usb:001:016", @ptr=nil>, #<NFC::Reader:0x005613904b5e98 @name="acr122_pcsc:ACS ACR122U PICC Interface 00 00", @ptr=nil>]
/home/polin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby-nfc-1.3/lib/ruby-nfc/tags/mifare/tag.rb:42:in `initialize': Unknown mifare tag (Mifare::Error)
    from /home/polin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby-nfc-1.3/lib/ruby-nfc/tags/mifare/classic.rb:38:in `initialize'
    from /home/polin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby-nfc-1.3/lib/ruby-nfc/reader.rb:65:in `new'
    from /home/polin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby-nfc-1.3/lib/ruby-nfc/reader.rb:65:in `block (3 levels) in poll'
    from /home/polin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby-nfc-1.3/lib/ruby-nfc/reader.rb:63:in `each'
    from /home/polin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby-nfc-1.3/lib/ruby-nfc/reader.rb:63:in `block (2 levels) in poll'
    from /home/polin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby-nfc-1.3/lib/ruby-nfc/reader.rb:57:in `upto'
    from /home/polin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby-nfc-1.3/lib/ruby-nfc/reader.rb:57:in `block in poll'
    from /home/polin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby-nfc-1.3/lib/ruby-nfc/reader.rb:52:in `loop'
    from /home/polin/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/ruby-nfc-1.3/lib/ruby-nfc/reader.rb:52:in `poll'
    from app.rb:15:in `<main>'

@hexdigest
Copy link
Owner

Hi,
What version of libfreefare do you use? And how did you install it?

@nomisoft
Copy link

Hi,

I'm seeing the same error as above on a project i've inherited. Any ideas of how I can go about fixing it?

I've tried installing libnfc and libfreefare via apt-get on ubuntu 16.04 and also tried compiling the latest versions and versions from about a year ago of both libraries from the their code on github

IsoDep seems to work but I get the 'Unknown mifare tag' error for any mifare cards/tags

@hexdigest
Copy link
Owner

@nomisoft

Can you please dump target variable (line 40 of tags/mifare/tag.rb) and paste it here?
I've seen this error when I tried wrong version of libfreefare.

@nomisoft
Copy link

I'm not sure if i'm doing this correctly as i'm new to ruby but i get the following:
p target
#LibNFC::Target:0x00000002508460

p target.to_yaml
--- !ruby/object:LibNFC::Target {}

@hexdigest
Copy link
Owner

@nomisoft it didn't help, please print value of target[:nti][:nai][:btSak]

@nomisoft
Copy link

I get:
p target[:nti][:nai][:btSak]
D, [2017-03-18T15:11:46.953329 #6644] DEBUG -- : 0

p target[:nti][:nai][:btSak].to_yaml
D, [2017-03-18T15:11:46.953839 #6644] DEBUG -- : --- 0

@hexdigest
Copy link
Owner

It seems like you're using wrong version of libfreefare, please try to remove libfreefare installed via apt-get and then try to re-install libfreefare from github.

@nomisoft
Copy link

Got it working!

I was still getting the same errors using the latest code from the master branches on github but managed to get it working by compiling libnfc 1.7.0 and libfreefare 0.4.0 releases

Thanks for your help!

@hexdigest
Copy link
Owner

@nomisoft you're welcome. The last version of libnfc I've tried without any issues was 1.7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants