Arduino的RFID校验和计算和可视化的关键 [英] Arduino RFID checksum calculation and key visualization

查看:414
本文介绍了Arduino的RFID校验和计算和可视化的关键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用这个 RFID对于Arduino的以太网R3 模块,我需要从软件检索串口卡(的标记),该标签外的ID写入。
模块的数据表的说,14个字节被发送到Arduino。第一个是标题,最后页脚,脚注前2个字节的校验和,以及其他的10个字节是包含该标签ID。ASCII数据

I'm using this RFID module for Arduino Ethernet R3 and I need to retrieve from the Software Serial the card (TAG) ID that is written outside the tag. The module's datasheet says that 14 bytes are sent to the Arduino. The first is the header, the last the footer, the 2 bytes before the footer are the checksum, and the other 10 bytes are the ASCII data that contains the tag ID.

我怎样才能重新创建卡的ID,并控制校验?例如以具有此ID标签:0013530444,Arduino的回应是:

How can I recreate the ID of the card, and control the checksum? For example with a tag that has this ID: 0013530444, the Arduino response is:

I received: 2
I received: 51
I received: 67
I received: 48
I received: 48
I received: 67
I received: 69
I received: 55
I received: 53
I received: 52
I received: 67
I received: 67
I received: 66
I received: 3

但我不知道如何在屏幕上打印由Arduino的读取的ID。如何计算校验

http://www.seeedstudio.com/wiki/index。 PHP?标题= 125Khz_RFID_module _-_ UART

谁能帮我?

推荐答案

下面是一个如何计算校验演练。

Here's a walkthrough of how to calculate the checksum.

把你的卡号(这仅仅是直接从你的文字报价)

Take your card number (this is just directly quoted from your text)

I received: 2
I received: 51
I received: 67
I received: 48
I received: 48
I received: 67
I received: 69
I received: 55
I received: 53
I received: 52
I received: 67
I received: 67
I received: 66
I received: 3

这会给你一个数字,等同于以下内容:

This would give you a number that is equivalent to the following:

2 51 67 48 48 67 69 55 53 52 67 67 66 3

2 51 67 48 48 67 69 55 53 52 67 67 66 3

第一NUMER(2)表示,这是一个请求的开始。

The first numer (2) indicates that this is the beginning of a request.

最后一个编号(3)表示,这是一个请求的结束。

The last number (3) indicates that this is the end of a request.

2 51 67 48 48 67 69 55 53 52 67 67 66 3

2 51 67 48 48 67 69 55 53 52 67 67 66 3

有关计算校验和的目的,我们将删除这两个数字。所以,你的新号码现在是:

For the purposes of calculating the checksum, we are going to remove these two numbers. So your new number is now:

51 67 48 48 67 69 55 53 52 67 67 66

51 67 48 48 67 69 55 53 52 67 67 66

这是你拥有的最后两个数字是你的校验和。剩下的数字是你的卡号。所以:

The last two numbers that you have are your checksum. The remaining numbers are your card number. So:

您的卡号为:

51 67 48 48 67 69 55 53 52 67

51 67 48 48 67 69 55 53 52 67

和您的校验和是:

67 66

接下来,您需要将您的卡号和你的校验和转换为ASCII值:

Next you need to convert your Card Number and your Checksum to ASCII values:

您的卡号为:

3 C 0 0权证7 5 4℃

3 C 0 0 C E 7 5 4 C

和您的校验和是:

C B

接下来,选中每个号码分成两人一组:

Next, grab each number into pairs:

您的卡号为:

3C 00 CE 75 4C

3C 00 CE 75 4C

和您的校验和是:

CB

然后,你需要把每对为十六进制值,做一个异或反对他们。所以基本上你需要证明以下内容:

Then you need to treat each pair as a HEXIDECIMAL value and do an XOR against them. So basically you need to prove the following:

3C ^ ^ 00 ^ CE 75 ^ 4C == CB

3C ^ 00 ^ CE ^ 75 ^ 4C == CB

(3C ^ 00)= 3C

(3C ^ 00) = 3C

3C ^ ^ CE 75 ^ 4C == CB

3C ^ CE ^ 75 ^ 4C == CB

(3C ^ CE)= F2

(3C ^ CE) = F2

F2 ^ ^ 75 4C == CB

F2 ^ 75 ^ 4C == CB

(3C ^ CE)= 87

(3C ^ CE) = 87

87 ^ 4C == CB

87 ^ 4C == CB

(87 ^ 4C)= CB

(87 ^ 4C) = CB

CB CB ==

由于CB == CB,这是一个有效的事务。

Because CB == CB, this is a valid transaction.

毫无疑问,有人能拿出一个比这更好的方法,但应该有足够的伪code在这里为你把它写自己。

No doubt someone else can come up with a better approach than this, but there should be enough pseudo code here for you to write it yourself.

这篇关于Arduino的RFID校验和计算和可视化的关键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆