RFID reader based on Innovations ID-12

Bug #513006 reported by Peter Mansvelder
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Rocrail
Fix Released
Wishlist
Unassigned

Bug Description

The MERG rfid starter kit and others available are built around the Innovations ID-12 reader.
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:
Quote:

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.

- 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.

Rocrail (r.j.versluis)
Changed in rocrail:
importance: Undecided → Wishlist
Revision history for this message
Rocrail (r.j.versluis) wrote :

The concentrator cannot be daisy chained with other concentrators so a reader offset address is needed if multiple concentrators are needed in the Rocrail setup.

Bus 5 must be used to setup the RFID's:
http://wiki.rocrail.net/doku.php?id=sensor-int-en

Rocrail (r.j.versluis)
Changed in rocrail:
status: New → In Progress
Revision history for this message
Rocrail (r.j.versluis) wrote :

Revision 1213 has the first test version of the new rfid12 library.

Changed in rocrail:
status: In Progress → Fix Committed
Revision history for this message
Rocrail (r.j.versluis) wrote :

The current implementation does not send a 'low' state after scanning an ID.
To use it for events it has to be reseted after x seconds.

Rocrail (r.j.versluis)
Changed in rocrail:
status: Fix Committed → Fix Released
Revision history for this message
gramels (lothar-gramelspacher) wrote :

2 readers (A & B)
[code]
gramels@eeePC:~$ gramels@eeePC:~$ cu -l /dev/ttyUSB1 -s 9600
Connected.
A0413277F9ED1
>B0413277F9ED1
>A0413277F9ED1
>A0413277F9ED1
>B0413277F9ED1
>A0413277AE3A9
>B0413277AE3A9
>A04132759355C
>B0413276C1C40
>A0413276C1C40
>B0413276C1C40
>B0413276C1C40
>A04132759355C
>B0413277F9ED1
>A041327600050
>B041327600050
>A0413277F9ED1
>B041327600050
>B0413276C1C40
>A041327600050
>A041327600050
>A0413277F9ED1
>A04132759355C
>B041327600050
>B0413276C1C40
>B0413277AE3A9
>A0413277AE3A9
>cu: Got termination signal

Disconnected.
gramels@eeePC:~$ [/code]

not a lot in trace (attached)[/quote]

Revision history for this message
Rocrail (r.j.versluis) wrote :

Is the trace 1411?

BTW LocoMouse did came in.

Revision history for this message
Rocrail (r.j.versluis) wrote :

I added more traces in 1412.
Please use byte trace level.

Revision history for this message
gramels (lothar-gramelspacher) wrote :

no, its 1409, just building 1411, takes 12 minutes

MultiMaus: cool, hope it helps. Got your openDCC_XP upgrade?

Revision history for this message
gramels (lothar-gramelspacher) wrote :

this looks good

more tests later

20100306.111506.017 r9999I rfid12re ORFID12 0331 packet start detected: [0x41]
20100306.111506.048 r9999I rfid12re ORFID12 0340 packet end detected: [0x3E] idx=15
20100306.111506.048 r9999c rfid12re ORFID12 0250 evaluateRFID[A][0413277AE3]: addr=1 id=321354471
20100306.111515.412 r9999I rfid12re ORFID12 0331 packet start detected: [0x41]
20100306.111515.442 r9999I rfid12re ORFID12 0340 packet end detected: [0x3E] idx=15
20100306.111515.443 r9999c rfid12re ORFID12 0250 evaluateRFID[A][0413277AE3]: addr=1 id=321354471
20100306.111521.215 r9999I rfid12re ORFID12 0331 packet start detected: [0x42]
20100306.111521.251 r9999I rfid12re ORFID12 0340 packet end detected: [0x3E] idx=15
20100306.111521.251 r9999c rfid12re ORFID12 0250 evaluateRFID[B][0413277AE3]: addr=2 id=321354471

Revision history for this message
gramels (lothar-gramelspacher) wrote :

it works as a sensor, but I dont understand how to use the ID information as described in http://wiki.rocrail.net/doku.php?id=tams-railcom-en#example for railcom

evaluateRFID[A][0413276000]: addr=1 id=321347588

Revision history for this message
Rocrail (r.j.versluis) wrote :

you must set the sensor action to ident:

<fbevent id="rcd1" action="ident" from="all" byroute="all" endpuls="false"/>

http://wiki.rocrail.net/doku.php?id=sensors_and_blocks#event_table

But we need more coding to use it also as other event type.

Revision history for this message
gramels (lothar-gramelspacher) wrote :

I think for now the compatibiliy with the MERG RFID kist is given.
It can be ut on the BiDi list.

I have some issues with reading distance and speed, but this is on the hardware side.

Thx Rob :)

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.