SparkFun Forums 

Where electronics enthusiasts find answers.

#204137
I am very new to RFID technology. I have mounted SRTR on top of the Redboard and connected to Raspberry PI using a USB cable. And in Node-Red workflow, I have the serial in node and is configured with serial port = /dev/ttyUSB0:9600-8N1
A message debug node is also connected.

I get the msg.payload as ..

A5PinSet_results_part1 0: 1
A5PinSet_results_part1 1: 1 etc A5PinSet_results_part1 5: 0

and continues to give A4TEST: 0 A5TEST: 0 A0-4: 1023 A1-4: 1023 etc ..

Not sure about any of these.

Can someone explain the basics here and the data format the serial in node is showing

Thanks
#204143
As described in other topics, the way you want to connect the Simultaneous RFID reader to your Raspberry PI is not how it should be done. The best / preferred way is to use a separate USB to serial converter. I use the https://www.sparkfun.com/products/14050

Other people tried (and like me) failed to get the connection working with the RFID reader on an Arduino- variant. Recently I have done a project to understand WHY it does not work and created a work-around. I have documented that on https://github.com/paulvha/ThingMagic/t ... assthrough.
#204819
Thanks Paul, while I am trying to test this through Audrino hat and connected to USB on laptop, using the sketch as in an example directory(C:\SparkFun_Simultaneous_RFID_Tag_Reader_Library-master\SparkFun_Simultaneous_RFID_Tag_Reader_Library-master\Example1_Constant_read.ino), I get the error : Module failed to respond. Please check wiring

I have tried different baud rates like 9600, 38400 ...

I have followed all the soldering instructions etc.

Any ideas?
#204820
lots of questions. but starting with the basics: after 10-15 seconds : is the led on the Arduino blinking or steady high ?
How did you define (in the sketch) & connect the reset-blocker line ?
Try to use the baudrate that is the same as CON_SPEED_SER in the sketch?

How did you set the switch on the SRTR board (HW/SW). If software, make sure
#204829
Arduino led steady high
switch is in Software side

I am using the skecth as below. and I do not find CON_SPEED_SER

Edited by moderator to add code tags
Code: Select all
/*
  Reading multiple RFID tags, simultaneously!
  By: Nathan Seidle @ SparkFun Electronics
  Date: October 3rd, 2016
  https://github.com/sparkfun/Simultaneous_RFID_Tag_Reader

  Constantly reads and outputs any tags heard

  If using the Simultaneous RFID Tag Reader (SRTR) shield, make sure the serial slide
  switch is in the 'SW-UART' position
*/

#include <SoftwareSerial.h> //Used for transmitting to the device

SoftwareSerial softSerial(2, 3); //RX, TX

#include "SparkFun_UHF_RFID_Reader.h" //Library for controlling the M6E Nano module
RFID nano; //Create instance

void setup()
{
  Serial.begin(9600);
  while (!Serial); //Wait for the serial port to come online

  if (setupNano(38400) == false) //Configure nano to run at 38400bps
  {
    Serial.println(F("Module failed to respond. Please check wiring."));
    while (1); //Freeze!
  }

  nano.setRegion(REGION_NORTHAMERICA); //Set to North America

  nano.setReadPower(500); //5.00 dBm. Higher values may caues USB port to brown out
  //Max Read TX Power is 27.00 dBm and may cause temperature-limit throttling

  Serial.println(F("Press a key to begin scanning for tags."));
  while (!Serial.available()); //Wait for user to send a character
  Serial.read(); //Throw away the user's character

  nano.startReading(); //Begin scanning for tags
}

void loop()
{
  if (nano.check() == true) //Check to see if any new data has come in from module
  {
    byte responseType = nano.parseResponse(); //Break response into tag ID, RSSI, frequency, and timestamp

    if (responseType == RESPONSE_IS_KEEPALIVE)
    {
      Serial.println(F("Scanning"));
    }
    else if (responseType == RESPONSE_IS_TAGFOUND)
    {
      //If we have a full record we can pull out the fun bits
      int rssi = nano.getTagRSSI(); //Get the RSSI for this tag read

      long freq = nano.getTagFreq(); //Get the frequency this tag was detected at

      long timeStamp = nano.getTagTimestamp(); //Get the time this was read, (ms) since last keep-alive message

      byte tagEPCBytes = nano.getTagEPCBytes(); //Get the number of bytes of EPC from response

      Serial.print(F(" rssi["));
      Serial.print(rssi);
      Serial.print(F("]"));

      Serial.print(F(" freq["));
      Serial.print(freq);
      Serial.print(F("]"));

      Serial.print(F(" time["));
      Serial.print(timeStamp);
      Serial.print(F("]"));

      //Print EPC bytes, this is a subsection of bytes from the response/msg array
      Serial.print(F(" epc["));
      for (byte x = 0 ; x < tagEPCBytes ; x++)
      {
        if (nano.msg[31 + x] < 0x10) Serial.print(F("0")); //Pretty print
        Serial.print(nano.msg[31 + x], HEX);
        Serial.print(F(" "));
      }
      Serial.print(F("]"));

      Serial.println();
    }
    else if (responseType == ERROR_CORRUPT_RESPONSE)
    {
      Serial.println("Bad CRC");
    }
    else
    {
      //Unknown response
      Serial.print("Unknown error");
    }
  }
}

//Gracefully handles a reader that is already configured and already reading continuously
//Because Stream does not have a .begin() we have to do this outside the library
boolean setupNano(long baudRate)
{
  nano.begin(softSerial); //Tell the library to communicate over software serial port

  //Test to see if we are already connected to a module
  //This would be the case if the Arduino has been reprogrammed and the module has stayed powered
  softSerial.begin(baudRate); //For this test, assume module is already at our desired baud rate
  while (softSerial.isListening() == false); //Wait for port to open

  //About 200ms from power on the module will send its firmware version at 115200. We need to ignore this.
  while (softSerial.available()) softSerial.read();

  nano.getVersion();

  if (nano.msg[0] == ERROR_WRONG_OPCODE_RESPONSE)
  {
    //This happens if the baud rate is correct but the module is doing a ccontinuous read
    nano.stopReading();

    Serial.println(F("Module continuously reading. Asking it to stop..."));

    delay(1500);
  }
  else
  {
    //The module did not respond so assume it's just been powered on and communicating at 115200bps
    softSerial.begin(115200); //Start software serial at 115200

    nano.setBaud(baudRate); //Tell the module to go to the chosen baud rate. Ignore the response msg

    softSerial.begin(baudRate); //Start the software serial port, this time at user's chosen baud rate

    delay(250);
  }

  //Test the connection
  nano.getVersion();
  if (nano.msg[0] != ALL_GOOD) {return (false);} //Something is not right

  //The M6E has these settings no matter what
  nano.setTagProtocol(); //Set protocol to GEN2

  nano.setAntennaPort(); //Set TX/RX antenna ports to 1

  return (true); //We are ready to rock
}
I am following this one and not the one from your your post
#204857
I have dropped you a PM. This sketch is for reading directly the tags on the Arduino. It should work straight forward. All it does is try to read device info and expect a readable answer. you could try to add, before calling SetupNano from setup add a line: nano.enableDebugging(). This will show debug messages (sent and received ) with the Nano. also carefully move the switch between SW/HW communication couple of times. Had one time bad contact myself with that switch.