RDM6300 125KHz (ID) RFID reader module (HCRFID0006)

RFID kits, modules and tags
neftronics
Posts: 2
Joined: Sat Apr 04, 2020 12:51 pm

Re: RDM6300 125KHz (ID) RFID reader module (HCRFID0006)

Post by neftronics » Sat Apr 04, 2020 3:47 pm

Useful information: What the output data actually means! - Forgive me if this is a repeat from another post, but I haven't found one.

So far nobody seems to have posted anything on how to decode the data, and what relationship this has to the serial number printed on the key-fobs (I don't have any cards - do these have a number on them too?)
If you're short on time, skip to the Example below.

Background
The RDM6300 prints the key code in ASCII encoded Hexadecimal, meaning that if viewed on a PC terminal such as Hyperterminal you will see what looks like a Hex string. The reader keeps on squirting out this string for as long as the key is in range, with a repetition rate of 50ms. This can make it difficult to see the start and end of a code number.
If you are trying to extract the 48-bit RFID code on a microcontroller, more decoding is necessary as they do not operate within the 'human readable' world!

Decoding the data
The HobbyComponents USB logic analyser was a very handy tool for visualizing the timing from this device but that's another subject.
Inspecting the output data I noticed that out of all the keyfobs I have, the start and end are always the same code. These codes happen to be SOT and EOT. You don't see these on a terminal screen as they are non-printing control characters. These however are handy for decoding the data string within a microcontroller. More on that later.

Example
To cut a long story short here is an example. I have changed one or two bytes so the data below is not a key I own...

Code: Select all

Raw Data read (Hex): 02 31 30 30 30 32 36 46 34 34 34 32 36 03
Code 02 is "SOT" or Start Of Text
Code 03 is "EOT" or End Of Text... Makes sense!
The 12 codes remaining in between these control characters convert to:

Code: Select all

100086F44426
which, paired up is

Code: Select all

10 00 86 F4 44 26
in hexadecimal. This is what you would see on a PC serial terminal.
The number printed on the fob or card is in decimal and is taken from the 2nd, 3rd, 4th & 5th bytes. So in this case the number on the key is "0008844356" This number in Hexadecimal is "00 86 F4 44" which can be seen in the Hex number above.
The last byte (26h) is the checksum (see posts after this one) made up from the XOR of all bytes in the message, excluding the SOT and EOT. eg.

Code: Select all

10h XOR 00h XOR 86h XOR F4h XOR 44h = 26h


Conclusion
Knowing how to convert the output should make it easier to write a properly structured decode routine on your Arduino, Raspberry pi, PIC or whatever you choose. The SOT and EOT control codes can (should) be used in your serial receive routine to tell your receive buffer when data has been completely received and to mark the beginning and end of a valid key code.
The checksum can be used for checking the integrity of the message by calculating in software and comparing with that in the message.
The raw received data can be converted easily to a number using atoi() or atol() or another similar function, making for easier storage and comparison of key codes instead of working with raw ASCII.
I hope this helps!

Now, has anyone had success writing to a writable RFID tag with this device? It has a RX pin as well as TX and there is a brief mention of it being able to write to tags. It might be sensible to assume that writing follows the same encoding as reading.
Last edited by neftronics on Mon Apr 06, 2020 5:18 pm, edited 1 time in total.

andrew
Site Admin
Posts: 1422
Joined: Sun Aug 05, 2012 4:15 pm

Re: RDM6300 125KHz (ID) RFID reader module (HCRFID0006)

Post by andrew » Sun Apr 05, 2020 8:39 am

I don't have any cards - do these have a number on them too?
The ones we sell do:

https://hobbycomponents.com/rfid/448-12 ... -set-of-10


Code 02 is "SOT" or Start Of Text
Code 03 is "EOT" or End Of Text... Makes sense!
The 12 codes remaining in between these control characters convert to:
Also I believe the 2 codes preceding the final EOT code are checksum bytes

Now, has anyone had success writing to a writable RFID tag with this device? It has a RX pin as well as TX and there is a brief mention of it being able to write to tags. It might be sensible to assume that writing follows the same encoding as reading.
I'm afraid this reader doesn't have any write capability so you won't be able to use it to write to writable cards/tags.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

neftronics
Posts: 2
Joined: Sat Apr 04, 2020 12:51 pm

Re: RDM6300 125KHz (ID) RFID reader module (HCRFID0006)

Post by neftronics » Sun Apr 05, 2020 9:22 am

I did read about the checksum after posting my last post. There is an article that says the checksum is the last 2 bytes before the EOT code, but it appears to be only one byte made up of the bitwise XOR of all preceding bytes, excluding the SOT code.
I have confirmed this to be true for all the fobs I have.
Also, it appears that the first byte (always 0x10 or 0x12 for the fobs I have) is either a manufacturer code or a version number. This makes the key's actual code 4 bytes long (32-bit) which is what the EM4100 datasheet states. I should have RTFM'd! :lol:

Post Reply

Return to “Security/RFID”