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

2-second delay after sending certain commands #12

Open
RokyB3 opened this issue Jul 15, 2024 · 0 comments
Open

2-second delay after sending certain commands #12

RokyB3 opened this issue Jul 15, 2024 · 0 comments

Comments

@RokyB3
Copy link

RokyB3 commented Jul 15, 2024

Hello,

I am using this simple python script:

from py122u import nfc
import time

while 1:
    # Initialize the NFC reader
    try: 
        reader = nfc.Reader()
    except:
        print("Error connecting to scanner")
    
    try:
        reader.connect()
        print(reader.read_binary_blocks(10, 4))
        time.sleep(0.5)
    except:
        print("Error reading from scanner")
        time.sleep(0.5)

The first time an NFC is connected to the scanner, its 10th page bytes are printed to the screen. They continue to be printed while the NFC is connected to the scanner.

When the NFC is removed from the scanner, the scanner's light stays green and it is not possible to read another chip.

Even after adding reader.disconnect() after the print(reader.read_binary_blocks(10, 4)) statement, it does not work.

Changing the sleep time in the last except statement from 0.5 to 2 allows the scanner time to seemingly timeout, change its light back to red, and connect to a new NFC chip.

Is there a way to disconnect from the chip and connect to another without waiting the two seconds?

Thanks.

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

1 participant