RFID tags (MERG kit and others)

Moderator: Moderators

RFID tags (MERG kit and others)

Postby pmansvelder » 26.01.2010, 17:46

Hello,

has anybody had any experience with RFID tags and Rocrail, asides from the LDT kits?
I have recently bought the MERG rfid starter kit, and it works very simple:
RFID tag under loco, RFID reader reads tag, and outputs label to a serial port in ASCII format. There is also an 8-port concentrator for 8 RFID readers, I will try that next.
It would be great to have this implemented in Rocrail, as a second sensor system, apart from the S88 or other 'standard' one.
Maybe the 'Barjut' system is similar in rocrail terms? if it just waits for an ASCII string to be read by a serial port, it will probably work the same. I will try this as soon as I get my 4-port serial to USB adapter, for all my serial ports are in use at the moment :roll:

Peter Mansvelder
(Roco Multimaus + S88XpressNetLi + RocRail)
pmansvelder
 

Postby rjversluis » 26.01.2010, 20:30

Hi Peter,

is this 'ASCII' protocol documented?
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

RFID tags (MERG kit and others)

Postby pmansvelder » 26.01.2010, 21:04

Hello Rob,

well, the documentation is all on the MERG website, but there is not so much there, as the starter set is basically built around the innovations ID-12 rfid reader:
http://www.id-innovations.com/Modules%2 ... ite%29.htm
This is a complete module, with RFID antenna and logic all in one enclosure, all it needs is +5V and then it outputs the data.
There is loads of documentation on various projects using the ID-12 reader. From one of these sites:
The Data OutPut Format – ASCII
STX (ASCII 02) DATA (10 ASCII) CHECK SUM (2 ASCII) CR (ASCII 13) LF (ASCII 10) ETX (ASCII 03)

The communication starts with a start-of-communication (STX) byte (ASCII 02) and ends with end-of-communication (ETX) byte (ASCII 03). The STX byte is immediately followed by the ten-byte tag ID (unique signature), a checksum, a carriage return (ASCII 13), a linefeed (ASCII 10) and then the ETX byte.


There are other output formats (Magnetic, Wiegand), but this is the one mostly used.
The MERG kit is the one I could get my hands on most easily, the other kits are mostly from the US and more expensive. There is one with an USB chip, which looks very professional (http://www.robotshop.us/sparkfun-rfid-usb-reader-1.html), but I haven't tried that.

Hope this is enough, there is also a yahoo discussions group:
http://groups.yahoo.com/group/RFID4MRR/
This is a spinoff from the JMRI discussions group, so there is a lot of JMRI talk there, but it mostly deals with how to put the RFID into practical use.

Peter
pmansvelder
 

Postby rjversluis » 26.01.2010, 21:13

Hi Peter,

this is not complete, and I do not have time to search in forums and many web sites.

What is needed:

1) Serial line settings.
2) Protocol description including on how to calculate the checksum.
3) Do the reader report by it self or must it be polled.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

RFID tags (MERG kit and others)

Postby pmansvelder » 26.01.2010, 21:36

Hello Rob,

I will try my best:
- serial line setting: 9600 baud, 8 bits, no parity, hardware handshake.
- The checksum is calculated as follows:

It outputs serial data in the following format. Each [] is one ascii byte.

[STX]
[D1] [D2] [D3] [D4] [D5] [D6] [D7] [D8] [D9] [D10]
[CS1] [CS2]
[CR]
[LF]
[ETX]

D1-D10 is the actual data, 10 ascii charactors. CS1 and CS2 are 2 ascii charactors that are the checksum for the data. Here is how the data sheet says the checksum is done to the data

if the 10 digits of ascii come in and lets say they equal

2 4 0 0 C C 5 7 8 3

and the check sum is

3 C

then to get the checksum you need to take pairs of ascii and convert them into one HEX byte and then XOR the hex bytes. which would look like this.

2 4 0 0 C C 5 7 8 3
becomes
[24] [00] [CC] [57] [83]

and 3 C becomes [3C]

then you can do a simple [24] ^ [00] ^ [CC] ^ [57] ^ [83] (^ is XOR) to see if it = [3C]

- The reader outputs the serial data any time it reads a valid RFID tag, it doesn't need to be polled.
- If a 8-port concentrator is used, it connects 8 readers and converts them to a single serial port; to identify the reader, it overwrites the [STX] character of the above data format with the bankid ( 1 to 8 ) in ASCII.

Hope this is enough, I will do some testing myself when I build the concentrator,

Peter
pmansvelder
 

Postby rjversluis » 26.01.2010, 22:23

Hi Peter,

ok, this information seems to be enough to get started.

The best way is to copy your last posting into a tracker issue:

https://bugs.launchpad.net/rocrail/+filebug
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Re: RFID tags (MERG kit and others)

Postby rjversluis » 28.01.2010, 22:00

Hi Peter,

pmansvelder wrote:- If a 8-port concentrator is used, it connects 8 readers and converts them to a single serial port; to identify the reader, it overwrites the [STX] character of the above data format with the bankid ( 1 to 8 ) in ASCII.

In this case there is no start char any more...
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

RFID tags (MERG kit and others)

Postby pmansvelder » 28.01.2010, 22:48

Hello Rob,

Yes, I guess that's true. If that is a problem, I guess it is better to start with the configuration of a single reader, and then tackle the problem of the concentrator later. As I said, I can't test the concentrator yet.

Peter
pmansvelder
 

RFID tags (MERG kit and others)

Postby pmansvelder » 29.01.2010, 12:14

Hello Rob,

after some digging I got some additional info of the difference in data between a single ID-12 reader and multiple readers attached to a MERG concentrator:

Martin Perry wrote:
The task level code intercepts a reader's STX character and exchanges it for
a reader ID character A - H appropriate to the incoming line. It then echoes
the next 12 bytes, CR, LF from the reader and exchanges the ETX for a >.
Framing errors are identified by a ! and overrun errors by a ?

Normally you get an STX character at the start of the RFID tag string and an ETX at the end, the concentrator substitutes these as described above, so I would expect to see data such as

<STX>0413276BC19A
<ETX><STX>0413275FCAA5
<ETX><STX>0413276ADB81
<ETX><STX>041327722163
<ETX>


coming from a reader without a concentrator. <STX> is the non-printable ASCII character for "start of text" and <ETX> is the "end of text" character.

And

A0413276BC19A
>B0413275FCAA5
>A0413276ADB81
>B041327722163
>

with a concentrator.


Like I said, I will test this as soon as the items arrive, but I think it would be best to start with support for a single ID-12 reader, and then add supoprt for the concentrator later.

Peter
pmansvelder
 

Postby rjversluis » 29.01.2010, 18:26

Hi Peter,

in revision 1213 the new library, rfid12, is added.
This first version supports not jet the concentrator output, but will be if you have some test results.
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

RFID tags (MERG kit and others)

Postby pmansvelder » 31.01.2010, 10:30

OK, the USB to serial adaptor is in and working, so I have the single RFID reader connected; the concentrator will arrive next week, I hope to get some testresults soon,

Peter
pmansvelder
 

Postby drblack » 02.02.2010, 22:33

Hi Rob,


thanks for the support of the RFID reader.
Unfortunately I can't use it. I always get the error:
r9999E main OLib 0042 rocs_lib_load [C:\Programme\Rocrail\rfid12.dll] failed. rc=12
.
There is no file in the main Rocrail folder. Even with a new clean installation of rev 1221 there is no dll with this name. What is my mistake?

Regards,

Henning
drblack
 

Postby rjversluis » 03.02.2010, 07:36

Hi,

the library was not included in the windows setup.

I corrected this problem, and you can test the snapshot found here:
http://rocrail.net/software/rocrail-snapshot/
Best Regards, Rob.
:!: PS: Do not forget to attach the usual files.
:!: PS: Nicht vergessen die übliche Dateien an zu hängen.
[ macOS - Linux] - [ N: CBus - CAN-GCA ] - [ 0: RocNetNode - GCA-Pi ]
rjversluis
Site Admin
 

Postby drblack » 03.02.2010, 10:36

Thanks!

I will test it tonight.

Regards,

Henning
drblack
 

Postby drblack » 03.02.2010, 22:39

Hi Rob,

now I get rocrail to show me the ident in the message window. I configured the sensor as RFID which I guess would make sense. But then once the sensor is triggered it stays active. If I use it as sensor it doesn't come active at all.

Do I need to set anything differently?

Regards,

Henning
You do not have the required permissions to view the files attached to this post.
drblack
 

Next

Return to DIY Hardware