I see JMRI supports the Seeed Studio RFID Readers. Looking further into this, Seeed make a 125kHz system and the NFC Shield v 2, which is a 13.56MHz PN532 system.
Does JMRI support both versions, as I would prefer to use the 13.56MHz one?
|
Hi,
If you use JMRI Panel Pro/Edit/Preferences/Connections and add an RFID then the Seeed Studio Connection Protocol option seems to give no sub options.
It might be worth trying the Olimex option and selecting?MOD-RFID1356MIFARE just in case the Seeed Studio NFC Shield software uses the Olimex?MOD-RFID1356MIFARE protocol.
If you are into writing software you could look at the Arduino code for the?Seeed Studio NFC Shield and see how to modify it to emulate an Olimex 13.56Mhz RFID module.
Which NFC protocol tags are you planning to use with the?Seeed Studio NFC Shield?.
Regards
Nick
|
Hi Nick,
I just happened to notice on the Interweb that Seeed? made a PN532 based RFID reader that they call a NFC Shield v.2. Being a 13.56MHz based reader, I'm fairly sure it will read Mifare tags, particularly the Midas Tiny I already use on my MERG CANRC522 system I have on another layout.
JMRI has connectivity for a Seeed Studio RFID reader and I have successfully used this connectivity for the Seeed 125kHz reader. So my question is, does JMRI's Seeed connectivity extend to their NFC Shield v.2? Has anyone used the shield successfully? It looks useful as it has a separate antenna.
I don't think the Olimex connectivity would work as Olimex use USB CDC protocol rather than a basic Serial protocol.
I think there a couple of ways to emulate USB CDC with an Arduino. One is in software, the other appears to be a hardware option costing ?4! Not sure how that works though!
I'm not very good as far as coding is concerned. The last serious coding I did was BBC Basic! I have been trying with coding, but finding it a struggle at the moment. You might recall some of my other posts trying to get the Arduino to emulate MERG Concentrator protocol.
So, has anyone used the Seeed NFC Shield v.2 with JMRI?
Regards
Steve
|
Hi Steve,
That's not an RFID module that I've evaluated. I evaluated the Adafruit?PN532 NFC/RFID controller breakout board which gave the most range with the Midas Tiny tag that I have seen.?
Many NFC RFID modules are intended for makers and come with software support for displaying data on a serial monitor and not for doing a more sophisticated version of a common 125kHz modules output.
Unlike the Adafruit?PN532 NFC/RFID controller breakout board the Seeed Studio version has a separate antenna which is much better for model railway use.
What vertical range do you want from your RFID module when used with the Midas Tiny?.
Regards
Nick
|
Not sure about the NFC v2 shield, although I just looked it up. I am sticking with the Seeedstudio 125KHz RFID readers though since they work absolutely great for me. I even figured out how to use an Arduino Mega to connect up to 12 of them, all working with JMRI. The coding part isn't too hard, but it can be challenging.?
The issue I see with using the NFC v2 shield is that you literally need a whole Arduino Uno (or equivalent) per reader. That is not an ideal situation unless you only have 1 or 2 readers installed. I would assume that the SeeedstudioRfidProtocol would also extend to this shield for use with the 13.56MHz tags, etc., but that is just an assumption. If so, then yes, it should work. I like the 125Khz systems though since they are far outside of the frequency ranges potentially generated by a DCC system or other nearby electronics. At least in my experience.?
Tom
|
Hi Nick,
I have decided to take a chance with the Seeed NFC Shield v 2 I have seen on eBay. I'm hoping Seeed might have followed the same protocol as their 125kHz reader.?
As I said earlier, the separate antenna appealed to me as I can hide the Arduino and shield under the baseboard and position the antenna under the track.?
I am looking for a similar vertical range to what I have with the MERG CANRC522.
I'll post my findings on here.
Regards
Steve
|
Hi Tom,
Thanks for your reply. For this particular layout, I only need one reader on the exit of the Fiddle Yard. JMRI Block Tracking should do the rest for me. Otherwise I agree, it's a bit wasteful on Arduino's!
I would like to stick to 13.56MHz readers as I have a MERG CANRC522 system on my other layout, which uses MFRC522's. Although this particular layout does not use CBUS, some of my stock will run on both.
I take your point on the 125kHz system and RF, DCC etc. interference.
Your setup sounds very interesting. How does your system work with JMRI? What connectivity option did you use? Do the reader outputs appear in the Reporter and ID Tag windows? How do you identify which reader sent the tag data??
I would be very interested in seeing the code you have used to achieve this.
Regards
Steve
|
Steve,
Hey!?
OK, so for connection type in JMRI, I use the 'network interface' instead of the 'direct serial', although I believe that too would work with how I do this. I have an Arduino Mega, with the Ethernet Shield v2 connected to it, and 12 Seeedstudio 125KHz RFID readers attached to the Mega using 3 hardware and 9 software serial ports. The code for the Mega is admittedly a bit complex, but the general idea is that the tag data from the 12 readers is read into a circular buffer and then formatted correctly according to the SeeedstufioRfidProtocol and sent to JMRI (the client) over the Ethernet shield. The formatting of the data is the key to JMRI being able to tell which reader sent what. So yes, each RFID reader has its own Sensor, Reporter, and corresponding ID Tag objects in JMRI. Arduino sketch (code) attached.
Tom
|
Hi Steve,
If the requirement is to use the same tags as your other layout and not write any code then using a MERG CANRC522 and a CANUSB4 is probably the only solution at present.
Regards
Nick
|
Tom,
That's brilliant, thank you very much for sharing, much appreciated.?
So, I'm guessing 'up to 12 readers' means that if you want to use less, say five, then the sketch will just pass over and ignore any unconnected ports?
If I wanted to use MFRC522's instead of the Seeed readers, would that be be fairly easy to do? Apart from calling the MRFC Library and defining some new pins, would the rest of the sketch work do you think?
|
Stephen,
So yes, with some slight modifications the sketch should be able to work with the different (and/or fewer) readers. I would also be happy to help you with the code. :-)
Tom
|
Tom,
that's great, thanks very much indeed. I had been hoping to input the card reader data as serial data via one of the existing JMRI RfID connections, but had run into various problems. The MERG Concentrator connection, as far as I can see uses RTS/CTS flow control, which is tricky to get around. The Olimex connection uses USB CDC, which again is not easy. I couldn't quite work out why the Seeed connection didn't work. I couldn't? get anything out of the Parallex connection either. Now, I'm wondering if it is something to do with the tag UID size? 125kHz tags seem to have 4 byte UID's whereas 13.56MHz Mifare tags seem to have 7 byte UID's. So is JMRI expecting a 4 byte input and I'm sending a 7 byte input? The Arduino Serial Monitor and PuTTY see the 7 byte tags, but JMRI doesn't.?
If I could get the tag data into JMRI, then as you say, it should only be slight modifications for a different reader setup.
Be very interested in your thoughts on this.
Steve
|
Steve,
I looked through whatever documentation exists for the SeeedstudioRfidProtocol again in the JMRI documentation. JMRI supports reading 4-byte (MIFARE Classic) and 7-byte (MIFARE Plus) tags. There is no specific mention of using 4-byte or 7-byte RFID tags. However, it is possible that the maximum size of the tag is defined in a configuration file or another part of the code that was not provided. This is not something I can find the answer to thus far. I don't see any technical reason for why the longer tag (7-byte) would not work though.?
Please give me your EXACT setup. I am making certain assumptions and that is no way to go about this. LOL!
Tom
|
Steve,
There does not seem to be any explicit limit on the tag size in this code. However, the method getMaxSize() returns the value 14, which may be an indication that tags should not exceed 14 bytes in length. Additionally, the getTag() method retrieves 10 bytes (bytes 1-10) from the message, which suggests that the protocol may be designed to handle tags up to 10 bytes in length. It is possible that larger tags may not be properly handled by this protocol.
Tom
|
Tom
thanks for your reply. The Mifare Ultralight tags do have longer UID's and I think you are right in suggesting that they are too long for JMRI. I guess these tags weren't around when the code was written and technology has moved on since.
However, I have since discovered that the MERG CANRC522 I have on the other layout doesn't read the UID's in any case. Instead it reads 4 bytes from the user EEPROM elements 4 and 5. This is a lot shorter being only 4 bytes, so perhaps a way forward would be to get the MFRC522 on my Arduino to read that and send it down the serial port? What do you think?
Steve
|
I did manage to get a Seeed NFC Shield v2 in an effort to see whether that would work with JMRI. Unfortunately I am having problems in trying to get the device to work properly! Looking at various forums, it appears I'm not the only one to to experience problems!
I will keep having a go at at it and see what happens. I am suspecting that it won't work with JMRI as the UID's might be too long.
There is also the Olimex MOD-1356Mifare which I have found. It appears to be a standalone unit, but I'm thinking this will only read Mifare Classic tags which have shorter UID's that the Mifare Ultralight that I am using.?
Again, I'll keep you posted on what I find.
|
Steve,
I think that your assumption is likely correct. I would think that an Arduino/MFRC522 combination is definitely feasible as well. The trick isn't getting the FRDI reader and Arduino to place together nicely. The issue will be extracting the tag data and formatting it according to JMRI's requirements for RFID concentrators. Regardless, that is ALL doable in the code. Using the serial connection is also an option. Are we talking about multiple readers with a single Arduino, or multiple readers per Arduino? I know you mentioned only needing a few of them, so the easiest way forward would be 1 Nano per reader, avoiding the need for any complex coding for "concentrator" formatting.?
Tom
|
Steve,
Again, I urge you to try the 125KHz Seeedstudio RFID readers. They work phenomenally well for me.
Tom
|
Tom,
Thanks again for your reply and useful insights. Appreciated.
I take what you say about the 125kHz system and that does work on my setup with JMRI, albeit with a single reader at present. However, the problem is that on the main layout, I use the MERG CANRC522 rfid system, which in my case uses Mifare Ultralite 13.56MHz tags. The issue is that some of the stock I use runs on both layouts, so to me it makes sense to use the 13.56MHz system on both. The alternative would be to fit two tags to each item of stock! The second layout is dcc only and does not have any MERG CBUS? equipment installed.
My Arduino Uno has the Software Shield and a MFRC522 connected to it. It reads the tags okay and I see the tag data on both the Serial Monitor and in PuTTY. I just can't see it in JMRI. We're thinking that this is because a Mifare Ultralite UID is 7 bytes long and therefore too long for JMRI.?
So, two options seem to present themselves to me. One is to perhaps try and read the user eeprom data elements 4 and 5 which also contain the loco id and send that to JMRI in a format that it can use, Seeed, MERG Concentrator or whatever. The other option perhaps would be just to send the UID as a serial data input to JMRI and perhaps have a JMRI script pick that up and place it in the Reporters and ID Tags windows. Would that work? Not sure how the latter would pick up which reader read the tag though!
Steve
|
Thomas ?playing with the rfid 125khz using a seeed reader and lotus. I have found if the train is moving to fast the first car scans every time and the second car is iffy. Because the first and third car always read I don’t think it’s an issue with range but the speed the ardueno can compute the incoming information. Do you find your mega can keep up with multiple sensors. I’m going to swap out the Lotus for an arduino uno to see if it can process any faster in the next few days.?
Micheal
|