Problem with Elechouse RFID Module v1.2 + Arduino UNO R3

I'm using default arduino sketch from manufacturer.
But when I put my card on the module nothing happends (the card led indicator turns on so the card is detected & the module works) I should see the card HEX ID but I don't.

Here is the oficial link:

When I print this:

int a = SerialReadHexDigit();

My monitor console is flooded with -1 that means invalid character...

What am I doing wrong?

Full sketch.

#include <SoftwareSerial.h> 
SoftwareSerial mySerial(2, 3); //pin2 Rx, pin3 Tx 

int CMD[64];
int comlen =0;
int out_flag =0;

void setup() 
{ 
  Serial.begin(9600);
  mySerial.listen();
  Serial.println("Serial number will be displayed here if a card is detected by the module:\n"); 
  // set the data rate for the SoftwareSerial port 
  mySerial.begin(9600); 
  delay(10);
  mySerial.write(0x02); //Send the command to RFID, please refer to RFID manual 
} 
void loop() // run over and over 
{ 

  while (Serial.available()) 
  {
    int a = SerialReadHexDigit();
    //Serial.println(a);
    if(a>=0){
      CMD[comlen] = a;
      comlen++;
    }
    delay(10);
  }
  //Serial.println("j3j0x");
  for(int i=0; i<comlen; i+=2){
    int c = mySerial.write( CMD[i]*16 + CMD[i+1]);
  }
  comlen =0;

  while (mySerial.available()) {
    byte C = mySerial.read();
    if (C<16) Serial.print("0");
    Serial.print(C ,HEX); //Display the Serial Number in HEX 
    Serial.print(" ");
    out_flag =1;
  }
  if (out_flag >0) {
    Serial.println();
    out_flag = 0;
  }

}
int SerialReadHexDigit()
{
  byte c = (byte) Serial.read();
  if (c >= '0' && c <= '9') {
    return c - '0';
  } 
  else if (c >= 'a' && c <= 'f') {
    return c - 'a' + 10;
  } 
  else if (c >= 'A' && c <= 'F') {
    return c - 'A' + 10;
  } 
  else {
    return -1;   // getting here is bad: it means the character was invalid
  }
}

nvm.

I put TX from RFID on arduino RX & RX from RFID on arduino TX when I have to put RFID TX on arduino pin2 & RFID RX on arduino pin3

Your device is connected to the pins that the SoftwareSerial instance, mySerial, is connected to. You are reading the data that comes in the hardware serial port.

First, mySerial is a stupid name. You do NOT have a mySerial connected to those pins. Use an instance name that reflects what is REALLY attached.

If you had named the instance RFID, it would have been quite clear that SerialReadHexDigit() should have been reading from the RFID instance, not the Serial instance.

Hi,
Same Item is not working kindly let me know whats the problem .
I also purchased sensor shield for this to work, plug n play. Kindly help.
Am using mega arduino 2650 and copied code from same website connect to sensor shield v7.

http://www.elechouse.com/elechouse/index.php?main_page=product_info&cPath=&products_id=2211

http://www.elechouse.com/elechouse/index.php?main_page=product_info&cPath=90_93&products_id=2156&zenid=95s9frfdhqarvlqimqe0tf7k60

code is same as mentioned below.

Kindly help.

Best Regards.

Kindly help.

Not possible as long as you insist on using code that does not work on a Mega. The Mega has 4 hardware serial ports. There is NO reason to be using SoftwareSerial on the Mega.

If you do insist on that foolishness, you MUST pay attention to the SoftwareSerial page that tells you which pins on the Mega can be used for SoftwareSerial.

Until then you are wasting your time, and ours.