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

RDM6300 addtional output formats, XOR Checksum #1302

Merged
merged 2 commits into from
Feb 23, 2021

Conversation

arne123
Copy link
Collaborator

@arne123 arne123 commented Feb 20, 2021

I had recently some issue with the RDM6300 reader, during debugging I found I would be very nice to have matching Numbers between the entries in the Database and the ones printed on the ID-Cards itself.

On the ID-Cards I am having are two Numbers, one 10 Digit Number with leading zeros and a fractional number.
Both are based on the same card number, just with a different representation. The Format is called Wiegand26.

Also I added a XOR checksum check as it is described in the RDM6300 Manual.

Additionally I tried to Address the dependency Topic of #1105, but this is mostly untested, since I don't have this modules available. It would be very nice if someone could support here.

… the RDM6300 Reader

-Added XOR Checksum for the RDM6300 Output format (Wiegand26)
-Tried to Address the dependencie Topic of MiczFlor#1105 (untested)

except ValueError as ve:
logger.errror(ve)
logger.error(ve)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does Anyone know, what was the Intention here,
I am not sure if this still works as it was originally intended or even was functional before.
(what can threw or could throw a ValueError?)

#this will return the raw (original) card ID e.g. 070067315809
card_id = raw_card_id

if card_id != self.last_card_id: #does this still makes sense here?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still makes sense here?
Means 2nd swipe will not be possible with RDM6300
Is this intentionally? Was there maybe a Good reason for this?

scripts/Reader.py.experimental Outdated Show resolved Hide resolved
@s-martin s-martin linked an issue Feb 21, 2021 that may be closed by this pull request
@s-martin s-martin added this to the 2.3 milestone Feb 21, 2021
- improved comment
@MiczFlor MiczFlor merged commit de99e0e into MiczFlor:develop Feb 23, 2021
@s-martin
Copy link
Collaborator

Hey @arne123,
the CI currently fails (e.g. https://github.com/MiczFlor/RPi-Jukebox-RFID/actions/runs/597448418).

./scripts/Reader.py.experimental:170:37: F821 undefined name 'MIFARE_WAIT_FOR_ENTRY'
        self.device.set_max_retries(MIFARE_WAIT_FOR_ENTRY)
                                    ^
1     F821 undefined name 'MIFARE_WAIT_FOR_ENTRY'
1
Error: Process completed with exit code 1.

I think the import doesn't work right. Could you have a look?
Thanks

@arne123
Copy link
Collaborator Author

arne123 commented Feb 25, 2021

I think I got it working with adding
from py532lib.mifare import MIFARE_WAIT_FOR_ENTRY

I can not test the Module without active i2c, I just checked for the availability of MIFARE_WAIT_FOR_ENTRY
which seems to have the right value (255/0xFF).

Can you do me a favor and test, if this will work in your environment?
Or should I just update the PR?

class Pn532Reader:

    def __init__(self):
        from py532lib.i2c import Pn532_i2c
        from py532lib.mifare import Mifare
        from py532lib.mifare import MIFARE_WAIT_FOR_ENTRY
        print(MIFARE_WAIT_FOR_ENTRY)  # just for test
        pn532 = Pn532_i2c()
        self.device = Mifare()
        self.device.SAMconfigure()
        self.device.set_max_retries(MIFARE_WAIT_FOR_ENTRY)


    def readCard(self):
        return str(+int('0x' + self.device.scan_field().hex(), 0))

    def cleanup(self):
        # Not sure if something needs to be done here.
        logger.debug("PN532Reader clean up.")`

@s-martin
Copy link
Collaborator

Unfortunately I don’t have that reader to test it

@s-martin s-martin mentioned this pull request Feb 25, 2021
@s-martin
Copy link
Collaborator

Fixed the import in #1312

@arne123 arne123 deleted the RDM6300_Number_Format branch May 15, 2021 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 | RC522 and PN532 require each other's dependencies
4 participants