0

I'm am trying to read in python an RFID card scanned with a RFID reader plugged in USB on my raspPi.

While the code looks very simple at the first sight, I'm kinda lost in the output and can't find back the decimal number written on the car.

ser = serial.Serial('/dev/tty1', 9600)
    while True:
        incomingByte = ser.read()
        hexo = str(binascii.hexlify(incomingByte))
        print(hexo)
    ser.close()

The output of this code is

b'bb'
b'c2'
b'bb'
b'c2'
b'bb'
b'c3'
b'a9'
b'e2'
b'80'
b'99'
b'28'
b'c2'
b'ab'
b'c3'
b'aa'
b'c3'
b'a9'
b'e2'
b'80'
b'99'
b'0d'

The number on the card is 0002859428043,41380

I scanned the same card by plugging in the RFID reader on my PC, here is the output àààé_(ç'é_ So I'm totally confused about all of that, I can't find the right way to find the card number.

Any help would be highly appreciated.

Thanks and all the best for this new year

tokitoast
  • 11
  • 2
  • 1
    You might get a better response if you mentioned what card-reader you are using... along with a link to its datasheet. – Mark Setchell Jan 07 '23 at 01:24
  • Likely related: https://stackoverflow.com/questions/37683157/how-can-i-get-the-serial-number-printed-on-rfid-tag-with-rfid-reader. Also, make sure the baud rate and other config is right, serial communication can spit out complete gibberish if misconfigured. – Lodinn Jan 07 '23 at 01:28
  • Hey! Thanks for your answers. I didn't find any datasheet. It's a basic whitemark RFID reader (see: https://ae01.alicdn.com/kf/Hdbd42dae38a646fa952a003f04078bfbA.jpg). The only thing I see in the description is a 106Kbit/s communication speed. I changed to that value for the baud rate but got the same output – tokitoast Jan 07 '23 at 22:21
  • @Lodinn the thing is that I don't seem to have a starting / ending byte like in the link you gave. Note that I used this rfid reader for a previous project where I had to reconfigure something. See this screenhttps://github.com/maddox/magic-cards/raw/master/docs/images/card-programmer.png – tokitoast Jan 07 '23 at 22:53
  • A last comment: the windows output `àààé_(ç'é_` is actually the code of the card. I needed to put my capslock on before scanning on windows. – tokitoast Jan 07 '23 at 23:33

1 Answers1

1

I have resolved the issue.

So basically, the issue was that my raspi keyboard was set to AZERTY while the reader is meant for QWERTY. So changing the localisation in the raspi config turned the output to

b'0'
b'0'
b'0'
b'4'
b'6'
b'5'
b'0'
b'7'
b'4'
b'3'
b'\r'

Which corresponds to my RFID card ID

tokitoast
  • 11
  • 2