Freetronics RFID Door Lock Shield and Priority 1 RFIDREAD-mRW-125

Control electric door locks and strike plates using your Arduino and an RFID module. Serial interface for an external RFID reader, and a switched output for door strike control. [Product page]
dukman83
Posts: 17
Joined: Fri Jun 19, 2015 4:16 am

Re: Freetronics RFID Door Lock Shield and Priority 1 RFIDREAD-mRW-125

Post by dukman83 » Mon Sep 28, 2015 11:03 am

Hi Angus,

Thanks for getting back to me.

I've flashed the Etherten with the "Blink" example sketch and connected pin 0 to the Rx pin of the reader and pin 1 to the Tx pin of the reader, as instructed.
Doing this didn't allow the unit to talk to Priority 1's RFID READER WRITER APPLICATION, which I've sourced from their site.
The error message I got from the software was telling me to check the reader connection and power.
I've confirmed that the power is available on the correct pins with a multi-meter.

I've then connected the power and ground pins to an external 5v supply and joined the ground pins.
Doing this was also unsuccesful, but gave me an error message saying that the reader didn't respond properly, and that it's expecting a different version.

These results are the same as what I've been getting when I was using the software serial pins.

Is there a way to confirm 100% without a doubt that it's either the code or the reader? I'd tend to think that based on these tests it's looking like the reader being faulty, but on the other hand, after speaking with Priority 1, it could be argued that because the Arduino isn't able to send itself a message and receive/print it, that there is still something wrong on it's end? Couldn't it?

Thanks again.

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 297
Joined: Sat Oct 15, 2011 11:31 am

Re: Freetronics RFID Door Lock Shield and Priority 1 RFIDREAD-mRW-125

Post by jonoxer » Tue Sep 29, 2015 1:47 am

You must be feeling very frustrated right now!

I think I have a spare P1D reader here somewhere, so I'm going to set it up now using an EtherTen as a USB-serial converter the way Angus suggested and see if I can communicate with it. There's nothing like having the hardware right in front of you when trying to solve this sort of problem :-)

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 297
Joined: Sat Oct 15, 2011 11:31 am

Re: Freetronics RFID Door Lock Shield and Priority 1 RFIDREAD-mRW-125

Post by jonoxer » Tue Sep 29, 2015 2:07 am

Found a stash of P1D readers in a box :-)

I've tested with both a USB-serial converter and also an EtherTen wired up as Angus suggested, and both methods worked. I loaded Blink onto the ET, connected the P1D reader as shown in the photo. 5V and GND directly to the ET, with the reader's RX pin going to D0 and the TX pin going to D1.

I opened the serial console at 9600bp, set the line termination to "Carriage return", and typed "SB0" <enter>. The module responded with "OK". I also scanned a tag (the one in my arm was handy so I used that ;-) ) and the console displayed the ID.

So assuming your reader is behaving the same way as mine, this method *should* work. The main difference I can think of is that I'm using a 134.2kHz version which defaults to the FDX-B tag type commonly used for implantation, so there's at least a difference in the default configuration even if they have the same firmware. I issued a "VER" command (read firmware version) and got a response of 210.
Attachments
2015-09-29 11.57.35.jpg

dukman83
Posts: 17
Joined: Fri Jun 19, 2015 4:16 am

Re: Freetronics RFID Door Lock Shield and Priority 1 RFIDREAD-mRW-125

Post by dukman83 » Tue Sep 29, 2015 2:52 am

Hi Jon and Angus,

Wow, it doesn't get any clearer than that!

I want to thank you both for your patience and tireless efforts!

What I didn't realise before was that you could actually use the console to type commands into. I was actually writing the commands into the code and expecting it to execute when uploaded.

That being said, I'm still not getting any response from the P1D, so it's looking pretty much confirmed as it being faulty.

Thank you all again so much for all your help, I'll check in when I've got a new reader to tell you how I go. :)

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 297
Joined: Sat Oct 15, 2011 11:31 am

Re: Freetronics RFID Door Lock Shield and Priority 1 RFIDREAD-mRW-125

Post by jonoxer » Tue Sep 29, 2015 3:53 am

Yes, in this case what we're trying to do is eliminate any code issues and get it connected to your computer so you can type commands to the reader manually and see any response that comes back without anything else getting in the way.

Before you send the reader back, there are three last-ditch things to try just in case. All of these things have caught me out many times in the past!

1. Swapped TX / RX. Getting these right can be brain-bending, because what is transmission and what is reception depends on which way you're looking at the circuit. So when I have a serial comms problem that stubbornly won't work, I always try swapping the TX and RX lines just in case - no matter how certain I am that I got it right!

2. Different baud rates. The datasheet may say 9600bps, but try a few others as well: if in doubt I normally start at 2400bps and try every possible speed up to 230k.

3. Line endings. If the device at the other end of the serial connection buffers its input until it receives a carriage return character, and your console sends a newline, it'll never process what you send it. Try different CR / NL settings just to see what happens.

Yes, these three things mean many possible combinations. Personally I would set line endings to both CR and NL (so it sends both), and work through all the baud rates. Then swap the TX / RX, and work through all the baud rates again. That way you should cover every single possible combination.

dukman83
Posts: 17
Joined: Fri Jun 19, 2015 4:16 am

Re: Freetronics RFID Door Lock Shield and Priority 1 RFIDREAD-mRW-125

Post by dukman83 » Tue Sep 29, 2015 4:25 am

Hi Jon,

I've tried going through all the baud rates available in the console and with each rate I've tried putting in the SD0 command in both lower case and all in caps for each of the line terminations. I've then put the full command SD0$0D which according to the datasheet is the ASCII carriage return. I've applied that to all the baud rates and utilising all the line termination types.

I've then swapped the Tx and Rx pins and did it all again in reverse order.

Thanks again!

User avatar
jonoxer
Freetronics Staff
Freetronics Staff
Posts: 297
Joined: Sat Oct 15, 2011 11:31 am

Re: Freetronics RFID Door Lock Shield and Priority 1 RFIDREAD-mRW-125

Post by jonoxer » Tue Sep 29, 2015 4:42 am

Sounds like you've exhausted all the possibilities then.

It's still possible there's a problem with your setup and the reader itself is OK, but it's probably about time to send it to P1D and see what they say. If they test it and the reader turns out to be fine then we can figure out what to try from there.

I didn't think to try the commands in lower case: I just used upper case, which worked for me. I also didn't put the $0D on the end, because the serial console in the Arduino IDE appends the carriage return (or newline, or both, depending on the settings) when you press enter.

dukman83
Posts: 17
Joined: Fri Jun 19, 2015 4:16 am

Re: Freetronics RFID Door Lock Shield and Priority 1 RFIDREAD-mRW-125

Post by dukman83 » Tue Sep 29, 2015 5:01 am

Hi Jon,

I really appreciate all your help. I'll send the reader back today and wait to see what they say about it.

I thought the same with case sensitivity and line termination, but while I was attempting those steps, I thought I might as well broaden the testing just in case.

Will let you know when I hear from Priority 1.

Thanks again!

dukman83
Posts: 17
Joined: Fri Jun 19, 2015 4:16 am

Re: Freetronics RFID Door Lock Shield and Priority 1 RFIDREAD-mRW-125

Post by dukman83 » Sat Oct 24, 2015 1:39 am

Hi guys,

The P1D has been confirmed to be the cause of the problems.

I've received the replacement reader and have connected and tested the reader as per Angus' and Jon's instructions, and have successfully communicated with the reader using hardware serial pins D0 and D1, and have gotten a read off the tags scanned.

Moving on to software serial, I've come across new problems, in which the reader does not respond to the basic commands supplied when testing it with hardware serial, nor does it read the scanned tags.

The steps I've taken were:
Use the supplied RFID code from the Freetronics site and the Practical Arduino book.
Changed the Tx and Rx pins to correspond to the pins in the code supplied (and later swapped them around)
Added one of the read tags into the allowed tags array
but was unable to have successful communication with the reader.

I've even tried code as simple as this:

Code: Select all

#include <SoftwareSerial.h>

#define rxPin 10
#define txPin 11

// set up a new serial port
SoftwareSerial mySerial =  SoftwareSerial(rxPin, txPin);

void setup()  
{
  // define pin modes for tx, rx:
  pinMode(rxPin, INPUT);
  pinMode(txPin, OUTPUT);
  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
}

void loop() 
{
  if (mySerial.available())
  {
    Serial.println(mySerial.read());
    mySerial.write(Serial.read());
  }
}
Power pins remain connected as per the hardware serial setup, just changed the Rx and Tx pins to 10 and 11.

I'd really appreciate any input.

Kind thanks,

Alex

angusgr
Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia
Contact:

Re: Freetronics RFID Door Lock Shield and Priority 1 RFIDREAD-mRW-125

Post by angusgr » Mon Oct 26, 2015 11:43 pm

Hi dukman,

Glad you're making some progress, even if it's frustratingly slow!

One thing to do is triple check the RX/TX orientation on the RFID reader, to be extra sure the lines are hooked up the correct way.

Code: Select all

void loop()
{
  if (mySerial.available())
  {
    Serial.write(mySerial.read());
    mySerial.write(Serial.read());
  }
}
This code only does anything at all if mySerial.available() is true, ie if the RFID reader has sent some data. So commands you type from the computer (on the hardware serial) don't necessarily make it to the RFID reader.

Try something like this:

Code: Select all

void loop()
{
  if (mySerial.available())
  {
    Serial.write('*');
    Serial.write(mySerial.read());
  }
  if (Serial.available())
  {
    mySerial.write(Serial.read());
  }
}
... I also added the line Serial.write('*'); so you'll see something ("stars") on the serial port even if the RFID reader only sends whitespace or other non-printing characters. You can remove this line if you get a response from the RFID reader.

Angus

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest