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

NFC reader will not connect #11

Open
lasagneking opened this issue Aug 9, 2020 · 22 comments
Open

NFC reader will not connect #11

lasagneking opened this issue Aug 9, 2020 · 22 comments

Comments

@lasagneking
Copy link

For some reason I have an NFC connection issue.

PM2 status shows readnfc as connected, I've stopped the service and restarted although same problem exists.

pi@raspberrypi:~ $ python -m nfc
This is the 1.0.3 version of nfcpy run in Python 2.7.16
on Linux-5.4.51-v7+-armv7l-with-debian-10.4
I'm now searching your system for contactless devices
** found ACS ACR122U PN532v1.6 at usb:001:003
I'm not trying serial devices because you haven't told me
-- add the option '--search-tty' to have me looking
-- but beware that this may break other serial devs

Which seems good although:-

pi@raspberrypi:~ $ python vinylemulator/readnfc.py

Loading and checking readnfc


SCRIPT
You are running version Alpha 0.9.2...
... and latest version is Alpha 0.9.2
Your script is up to date

NFC READER
Connecting to NFC reader...
... could not connect to reader

----------------------------------------------------------
I actually have an identical NFC reader which I use on my PC, I've attached this and this doesn't work either

I'm really stuck, hope someone can help here
@Esamanoaz
Copy link
Contributor

If you read pull request #6 you should be able to fix this issue. If you have fixed it can you close the issue now? Thanks.

@LiveDrunk
Copy link

LiveDrunk commented Sep 29, 2020

Check the command: python -m nfc again.
Might be a problem regarding the revision of the reader: (revision can be found using python -m nfc -v -v -v , see the link below)
nfcpy/nfcpy#167

I have revision 216 and haven't found a way to fix it yet

@LiveDrunk
Copy link

Found a small "fix"
Try to run the application python vinylemulator/readnfc.py the first time without checking with: python -m nfc
This should make it work...
And try to keep it running so the connection doesn't go bad. (this is my next step that i'm gonna try but i expect this to work)

@kastrom
Copy link

kastrom commented Feb 14, 2021

@LiveDrunk any luck with fixing yours yet?
I also have revision 216 and have the same issue. I’ve managed to get it working once by running python vinylemulator/readnfc.py without first running python -m nfc, but every other time I just get a not found error.
I’ve ordered a couple more readers from Amazon and Ali Express as there doesn’t seem to be a way to find out the revision from the product listing.

@hankhank10
Copy link
Owner

You may want to try Node-Sonos-NFC: https://github.com/ryanolf/node-sonos-nfc

This is a new library which is supposedly compatible with more card readers since it doesn't rely on NFCpy

@macjester
Copy link

You may want to try Node-Sonos-NFC: https://github.com/ryanolf/node-sonos-nfc

This is a new library which is supposedly compatible with more card readers since it doesn't rely on NFCpy

hankhank10 , i cannot connect the caed reader , do i follow your instructions until the section on the card reader then go to https://github.com/ryanolf/node-sonos-nfc , whats your thoughts ?

@mbecker4
Copy link

I am having a similar issue. I followed all directions and used https://github.com/ryanolf/node-sonos-nfc instead of NFCpy. However when I try to run python vinylemulator/readnfc.py It cannot connect to the reader.

I am able to see the reader when I use lsusb. Can anyone point me in the right direction on making the nfc reader properly load?

@Esamanoaz
Copy link
Contributor

I am able to see the reader when I use lsusb. Can anyone point me in the right direction on making the nfc reader properly load?

Have you changed nfc_reader_path="usb" in usersettings.py to the result of lsusb? If you run lsusb and it says something like usb:072f:2200, put that in. For example: nfc_reader_path="usb:072f:2200".

Also, what NFC reader are you using?

@mbecker4
Copy link

I already tried updating usersettings. My path is currently set to usb:072f:2200

The NFC Reader comes up as Advanced card systems, Ltd ACR122U

@macjester
Copy link

macjester commented Sep 16, 2021 via email

@TheScurvyDawg
Copy link

I am having this same problem. Having to use Python3.

In usr/bin/python3 there is no module named nfcpy

I know I am late to the game on this and I am also a complete newb to all this. I have it all working except this final step of getting the NFC reader working on the Pi. I have set the path in user settings. nfcpy seems to be where I am stuck. It will not recognize the ACS NFC reader. I came here from Hackster.io hoping there would be an easy resolution.

@TheScurvyDawg
Copy link

I am having this same problem. Having to use Python3.

In usr/bin/python3 there is no module named nfcpy

I know I am late to the game on this and I am also a complete newb to all this. I have it all working except this final step of getting the NFC reader working on the Pi. I have set the path in user settings. nfcpy seems to be where I am stuck. It will not recognize the ACS NFC reader. I came here from Hackster.io hoping there would be an easy resolution.

I saw on the main page your important note.

I am sorry to have to ask but do you have a link to instructions on installing this node-sonos-nfc?

I will go read up on it now.

@macjester
Copy link

macjester commented Oct 31, 2021 via email

@Esamanoaz
Copy link
Contributor

In usr/bin/python3 there is no module named nfcpy

Have you tried installing the module like this? pip3 install -U nfcpy

Sometimes specifying the 3 in pip3 or python3 commands is important because it distinguishes from python 2. Also try it with sudo, like this: sudo pip3 install -U nfcpy

@TheScurvyDawg
Copy link

TheScurvyDawg commented Oct 31, 2021

In usr/bin/python3 there is no module named nfcpy

Have you tried installing the module like this? pip3 install -U nfcpy

Sometimes specifying the 3 in pip3 or python3 commands is important because it distinguishes from python 2. Also try it with sudo, like this: sudo pip3 install -U nfcpy

I did exactly that just after posting here. It now doesn't say there is no NFC but it still doesn't connect, sadly.

I also went and installed the node-sonos-nfc linked to in the important note and that looked very hopeful but honestly, this newb is stuck.

Thanks for responding Esamanoaz

@Esamanoaz
Copy link
Contributor

Hmmmm. So the NFCpy module is not seeing your reader, right? I use NFCpy for something similar to this on a Raspberry pi computer. I tried it on my Windows 10 laptop and it could not find the reader, because it needed some kind of driver if I remember correctly. I never figured that problem out, so I just used it on my raspberry pi.

Are you using a raspberry pi or a different type of computer?

@TheScurvyDawg
Copy link

Hmmmm. So the NFCpy module is not seeing your reader, right? I use NFCpy for something similar to this on a Raspberry pi computer. I tried it on my Windows 10 laptop and it could not find the reader, because it needed some kind of driver if I remember correctly. I never figured that problem out, so I just used it on my raspberry pi.

Are you using a raspberry pi or a different type of computer?

The ACS NFC ACR122U works fine on my PC as I used it to load a bunch of the stickers. I am setting this up on my Raspberry Pi.

@Esamanoaz
Copy link
Contributor

Ah, so it works on your PC but not your Pi? I'm actually not sure how to help then. You should look through the github issues on the official NFCpy repository. This seems like a problem that they could solve.

@TheScurvyDawg
Copy link

I will look that up, I am totally new to using a Pi and this is my first attempt at a project using one. I am so close and excited to get this working. The Sonos server works great. The NFC card works flawlessly on the PC I am just stuck on this one final step darn it.

@macjester
Copy link

macjester commented Nov 1, 2021 via email

@macjester
Copy link

macjester commented Nov 1, 2021 via email

@mbecker4
Copy link

mbecker4 commented Nov 8, 2021

I was able to get it to work a few weeks ago, and now have my Pi up and running.
Sorry for the delay. I got it to work then my computer crashed and I’m now limping on my 10 year old MacBook Pro, this also means I don’t have the final code that I cleaned up (and running it on a Raspberry Pi 3A+ loading all the files is pretty slow and difficult). Knowing that many people have been working on this for a long while I thought the sooner the better.

I bought this NFC Hat: here

I then updated the reader path because we are no longer using the usb nfc reader.
reader = nfc.ContactlessFrontend("ttyS0")

I also did have to install a few additional packages as well, pn532 and ndef. I moved these packages into the vinyleumlator folder along with the nfc package folder. — This is probably not necessary, but it did make it a lot easier as I was trying to make the NFC hat play nice.

I'm not the most experienced python developer, but if you have additional questions on my comments let me know and I will try to help you out as best as I can.

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

8 participants