Giter Site home page Giter Site logo

sparkfun_simultaneous_rfid_tag_reader_library's Introduction

SparkFun Simultaneous RFID Tag Reader Library

SparkFun Simultaneous RFID Tag Reader - NANO M6E

SparkFun Simultaneous RFID Tag Reader - NANO M6E (SEN-14066)

This is a powerful shield capable of reading multiple RFID tags at the same time. It can also write to tags. Works with UHF Gen2 RFID tags.

Thanks to:

Note - Most examples make use of SoftwareSerial, which is not included in all platform cores. If you run into compilation errors due to this, you'll need to install an appropriate library for your platform (eg. ESPSoftwareSerial for ESP32), or replace softSerial in the examples with something that works for your platform (eg. Serial2 for ESP32 or Serial5 for teensy, see Advanced Example1).

Repository Contents

  • /examples - Example sketches for the library (.ino). Run these from the Arduino IDE.
  • /src - Source files for the library (.cpp, .h).
  • keywords.txt - Keywords from this library that will be highlighted in the Arduino IDE.
  • library.properties - General library properties for the Arduino package manager.

Documentation

License Information

This product is open source!

The code is beerware; if you see me (or any other SparkFun employee) at the local, and you've found our code helpful, please buy us a round!

Please use, reuse, and modify these files as you see fit. Please maintain attribution to SparkFun Electronics and release anything derivative under the same license.

Distributed as-is; no warranty is given.

  • Your friends at SparkFun.

sparkfun_simultaneous_rfid_tag_reader_library's People

Contributors

abcd-ca avatar nseidle avatar per1234 avatar sfe-sparkfro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sparkfun_simultaneous_rfid_tag_reader_library's Issues

TID length inconsistency

Hi,

I'm having an issue where the 12th byte of the tag TID randomly changes on each read.

Perhaps related - I noticed that the code says that TIDs are 20 bytes (line 10, Example9_Read_TID.ino), but the product page (and ThingMagic) say that the TIDs are 64 bits (https://www.sparkfun.com/products/14151).

Do you know what's going on here?

Thanks

FATAL error

CODE :
import com.fazecast.jSerialComm.*;
public class test
{
static{
// System.setProperty("java.library.path", "F:\Ur Challange\UHF RFID fixed reader\UHF\SDK\java\jSerialComm-master\src\main\resources\Windows\x86_64");
System.loadLibrary("jSerialComm");
}
//static public native test[] getCommPorts();
public static void main(String[] args) {
SerialPort[] s=SerialPort.getCommPorts();
//System.out.println(s[0]);
}
}

ERROR : ( Compiled Successfully)
Could not locate or access the native jSerialComm shared library.
If you are using multiple projects with interdependencies, you may need to fix your build settings to ensure that library resources are copied properly.

A fatal error has been detected by the Java Runtime Environment:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006ffefa96, pid=4860, tid=0x000000000000349c

JRE version: Java(TM) SE Runtime Environment (8.0_191-b12) (build 1.8.0_191-b12)

Java VM: Java HotSpot(TM) 64-Bit Server VM (25.191-b12 mixed mode windows-amd64 compressed oops)

Problematic frame:

V [jvm.dll+0x15fa96]

Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

An error report file with more information is saved as:

F:\Ur Challange\UHFRFIDfixedreader\UHF\SDK\java\jSerialComm-master\src\main\java\hs_err_pid4860.log

If you would like to submit a bug report, please visit:

http://bugreport.java.com/bugreport/crash.jsp

Module stops responding

I am by no means an expert, but after fussing with this thing for a few days I think I nailed down the problem and a possible solution. I will try to explain. (again. I am no expert and what I write here will reflect this.)

If anyone who is an expert can confirm this, suggest a better solution, or/and re-write this in a better/clearer way.... PLEASE!

When you reset the arduino without disconnecting power from the entire assembly (like when you update firmware) or if it "browns out" during a read, the module locks up and does not respond to commands.
From what I found in the datasheets and from by playing with their autonomous config tool this is a similar issue to when the module is in autonomous mode and needs to be reset. On thingmagic's other modules there is a reset pin to help with this, the nano does not.
At first I was stumped as to wtf could help with this. And almost began to pullout my hair. Then I remembered something in the datasheets about a bootloader. When the module is powered on the bootloader needs a little time(100-200ms) to do it's thing. After that the "lockedup" state is once again a pain in the fleshy parts used for sitting by humans. If you manage to run the setupNano() within the first ~200ms the module can be reset. I, however, had a long delay() to show a "loading.." message on an LCD before running it.(irony?)
Removing the delay let me reset the module after it became unresponsive by removing power from the entire contraption. This however did not help when I had my code try to reconfigure the module as part of the proccess.

My solution was to wire up a digital pin to the EN pin on the breakout writing a low for 200ms then a high to start it up again and calling the setup routine. this seems to have worked.

Problem using EPCwrite

I try to write (update) a Epc tag, apparentely it works but the when a read the tag again even if it is changed is done not in the way I expect. For example if I write, "Hello!",reading again the same tag its EPC doesn't contain any of the bytes of the orginal string, even if it appears different from the evalue read before the write....

Compile Errors - Error compiling for board SparkFun ESP32 Thing Plus.

Board: Sparkfun ESP32 Thing Plus
Arduino: 1.8.19
Library: 1.0.7
Example Code: Example1_HardwareSerial_Constant_Read.ino (Using Serial2 instead of Serial5)

C:\Users\Jon\Documents\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library\src\SparkFun_UHF_RFID_Reader.cpp: In member function 'bool RFID::begin(Stream&)':
C:\Users\Jon\Documents\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library\src\SparkFun_UHF_RFID_Reader.cpp:55:1: error: no return statement in function returning non-void [-Werror=return-type]
}
^

C:\Users\Jon\Documents\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library\src\SparkFun_UHF_RFID_Reader.cpp: In member function 'void RFID::printMessageArray()':
C:\Users\Jon\Documents\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library\src\SparkFun_UHF_RFID_Reader.cpp:847:20: warning: comparison is always false due to limited range of data type [-Wtype-limits]
if (amtToPrint > MAX_MSG_SIZE)
^

C:\Users\Jon\Documents\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library\src\SparkFun_UHF_RFID_Reader.cpp: In member function 'uint8_t RFID::parseResponse()':
C:\Users\Jon\Documents\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library\src\SparkFun_UHF_RFID_Reader.cpp:710:1: error: control reaches end of non-void function [-Werror=return-type]
}
^

cc1plus.exe: some warnings being treated as errors
exit status 1
Error compiling for board SparkFun ESP32 Thing Plus.

Made the following changes in SparkFun_UHF_RFID_Reader.cpp, and the compiler stopped complaining.

Added "return true;" after line 52 (not sure if this is the best idea, but it works.... not sure what it is actually supposed to be returning)

//Initialize the Serial port
bool RFID::begin(Stream &serialPort)
{
  _nanoSerial = &serialPort; //Grab which port the user wants us to use
  return true;
  //_nanoSerial->begin(); //Stream has no .begin() so the user has to do a whateverSerial.begin(xxxx); from setup()
}

and, added "return (RESPONSE_IS_UNKNOWN);" after line 709

  //Check the CRC on this response
  uint16_t messageCRC = calculateCRC(&msg[1], msgLength - 3); //Ignore header (start spot 1), remove 3 bytes (header + 2 CRC)
  if ((msg[msgLength - 2] != (messageCRC >> 8)) || (msg[msgLength - 1] != (messageCRC & 0xFF)))
  {
    return (ERROR_CORRUPT_RESPONSE);
  }

  if (opCode == TMR_SR_OPCODE_READ_TAG_ID_MULTIPLE) //opCode = 0x22
  {
    //Based on the record length identify if this is a tag record, a temperature sensor record, or a keep-alive?
    if (msg[1] == 0x00) //Keep alive
    {
      //We have a Read cycle reset/keep-alive message
      //Sent once per second
      uint16_t statusMsg = 0;
      for (uint8_t x = 0; x < 2; x++)
        statusMsg |= (uint32_t)msg[3 + x] << (8 * (1 - x));

      if (statusMsg == 0x0400)
      {
        return (RESPONSE_IS_KEEPALIVE);
      }
      else if (statusMsg == 0x0504)
      {
        return (RESPONSE_IS_TEMPTHROTTLE);
      }
    }
    else if (msg[1] == 0x08) //Unknown
    {
      return (RESPONSE_IS_UNKNOWN);
    }
    else if (msg[1] == 0x0a) //temperature
    {
      return (RESPONSE_IS_TEMPERATURE);
    }
    else //Full tag record
    {
      //This is a full tag response
      //User can now pull out RSSI, frequency of tag, timestamp, EPC, Protocol control bits, EPC CRC, CRC
      return (RESPONSE_IS_TAGFOUND);
    }
  }
  else
  {
    if (_printDebug == true)
    {
      _debugSerial->print(F("Unknown opcode in response: 0x"));
      _debugSerial->println(opCode, HEX);
    }
    return (ERROR_UNKNOWN_OPCODE);
  }
  return (RESPONSE_IS_UNKNOWN);
}

Module failed to respond. Please check wiring. ESP32 Serialsoftware

Hello, i am trying to communicate the module nano m6e with the esp32 via the software serial, i installed the ESPsoftwareSerial plerup/EspSoftwareSerial@^6.12.1.
i used the example1 "constant _read", but the module failed to respond, Module failed to respond. Please check wiring.
i checked all the wires but everything is allright,

NB :i used the Redboard Arduino, and i can read tags so everthing is good ,

Any help, thanks

compile with Arduino MKR1000

Trying to get this library running with an Arduino MKR1000 but it fails with the following errors:


C:\Users\X\Documents\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library\src\SparkFun_UHF_RFID_Reader.cpp:277:63: error: invalid conversion from 'char*' to 'uint8_t* {aka unsigned char*}' [-fpermissive]

   return (writeData(bank, address, newID, newIDLength, timeOut));

                                                               ^

In file included from C:\Users\X\Documents\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library\src\SparkFun_UHF_RFID_Reader.cpp:42:0:

C:\Users\X\Documents\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library\src\SparkFun_UHF_RFID_Reader.h:119:10: error:   initializing argument 3 of 'uint8_t RFID::writeData(uint8_t, uint32_t, uint8_t*, uint8_t, uint16_t)' [-fpermissive]

  uint8_t writeData(uint8_t bank, uint32_t address, uint8_t *dataToRecord, uint8_t dataLengthToRecord, uint16_t timeOut = COMMAND_TIME_OUT);

          ^

exit status 1
Error compiling for board Arduino/Genuino MKR1000.

Even if the Sketch is complete empty, the line #include "SparkFun_UHF_RFID_Reader.h" steps into this failure.

All the Versions are the latests:

Arduino 1.8.6
Arduino SAMD Boards 1.6.19
SparkFun_Simultaneous_RFID_Tag_Reader_Library 1.0.4

Some sort of workaround or even better a fix?
Thanks in advance

Trying to do a constant read with the SparkFun M6E Nano and a Raspberry Pico

Has anyone tried to connect the SparkFun M6E Nano with a Raspberry Pico using the Arduino IDE? I am trying to run the constant read example. I used the Software Serial example, and it fails to connect and goes to "Please check wiring" error. I'm not sure if I have any better luck using the hardware serial example instead. If someone has tried it. How were you guys able to fix it?

Send a standard Class−1 Generation−2 UHF Select command

I need to read the temperature from my RFID temperature sensor. For reading the temperature, 2 step process requiring standard UHF Select and Read commands.

Send a standard Class−1 Generation−2 UHF Select command with the parameters described in Table 6 to initialize the temperature sensor and calculate a Temperature Code. The Select command to be followed by 2 ms of continuous wave before the reader issues any further commands. This pause
gives the temperature sensor circuit time to run. The reader must not power down at any time between the Select and Read commands.

Send a standard Class−1 Generation−2 UHF Read command to retrieve the Temperature Code from the sensor tag memory at the location given in Table 7.

Is this SparkFun Simultaneous RFID Tag Reader Library for Arduino support to send the Select command? i only able to send the read command follow the example provided by sparkfun on Arduino.

Examples on ESP8266

Hi,

I am trying to run your examples on ESP8266 nodemcu , and got error.
There are changes which needed when using ESP8266 ?
There is another implementation for ESP ? what could be the problem?

Please advise.
Idan.

Setting a session

Is there any chance someone knows how to send a “S0” to the reader via the Arduino/Red Board?

If you use the URA, you can set it up in the options on the right. I believe that if there is a way to do this in continuous read mode it will minimize reading the same tags too often.

Cant compile expamles

D:\Documents\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library\src\SparkFun_UHF_RFID_Reader.cpp: In member function 'uint8_t RFID::writeTagEPC(char*, uint8_t, uint16_t)':

D:\Documents\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library\src\SparkFun_UHF_RFID_Reader.cpp:277:63: error: invalid conversion from 'char*' to 'uint8_t* {aka unsigned char*}' [-fpermissive]

return (writeData(bank, address, newID, newIDLength, timeOut));

                                                           ^

In file included from D:\Documents\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library\src\SparkFun_UHF_RFID_Reader.cpp:42:0:

D:\Documents\Arduino\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library\src\SparkFun_UHF_RFID_Reader.h:119:10: note: initializing argument 3 of 'uint8_t RFID::writeData(uint8_t, uint32_t, uint8_t*, uint8_t, uint16_t)'

uint8_t writeData(uint8_t bank, uint32_t address, uint8_t *dataToRecord, uint8_t dataLengthToRecord, uint16_t timeOut = COMMAND_TIME_OUT);

      ^

exit status 1
Error compiling for board Arduino/Genuino Uno.

Reading Tag EPC in ASCII?

I am reading through the constant_read.ino file and I see we the code will return the HEX of each byte. My question is, how do we read ASCII data?

Say I have a tag name TestTrackTag01, ...02, ...03 and so on? Not really something wrong in code just my lack of knowledge.

Intermittent communications with M6E nano

Hi there;

Had all my code working on the weekend, but now it alternately passes and fails the nano.check function, and sometimes comes up with an unknown error; as below:
8.478 -> Bad CRC
19:21:28.478 -> nano check failed
19:21:30.438 -> nano.check Suceeded
19:21:30.438 -> Unknown errornano check failed
19:21:32.453 -> nano.check Suceeded
19:21:32.453 -> Unknown errornano check failed
19:21:34.422 -> nano.check Suceeded
19:21:34.422 -> Unknown errornano check failed
19:21:36.438 -> nano.check Suceeded
19:21:36.438 -> Bad CRC

Sometimes it does work, but often will detect "bad CRC" when there are no tags nearby, and often when a tag is at readable range.

Using Bluno (Arduino Uno) to communicate. Seems to only work now at 115200 baud; other baud rates don't seem to communicate properly any more.

What could be causing these problems? Please help! Need this working for a University project :(

Reading multiple RFID tags.docx

Doesn't build: line 676

Currently line 676 reads:

else if (this.msg[1] == 0x0a) //temperature

This is throwing an error. The fix seemed to be easy - I removed the "this", per the prior code:

else if (msg[1] == 0x0a) //temperature

Protocol reference

Hi, would it be possible to include a link in the readme to the protocol reference you used to implement this?

Set Power Mode?

The documentation for the ThingMagic module describes various Power Modes. They look like an ideal solution for managing thermal issues, especially in cases like mine where i'll be needing to read only occasionally.

But I can't find any way to set the Power Mode via the Arduino API. Can you suggest any solution/workaround that would allow me to set the Power Mode?

Duty cycle parameters

How would one set asynchOffTime and asynchOnTime for the reader? There are functions to set baudrate and some other parameters, but not everything. Will these be implemented?

Using other options for startReading()

I'm currently working with the SRTR and I want to be able to constant read the TID. I dug a little into the library, and noticed that the startReading() function has a blob that is sent to the module. I don't really know how the blob works. I've been looking through URA and running transport logs, but it doesn't make much sense to me. Can you explain the meaning behind the blob and how I can modify it to read TID? Thanks!

Adding support for GS1 Gen2 untraceable command

Hi there,

I am looking to add support for some Gen2 commands like the untraceable command. I am not too experienced with C, so I am a bit lost. I hope you can point me in the right direction.

For starters, I am a bit confused whether the Sparkfun Library uses the Mercury API? From the M6E documentation:
"ThingMagic does not support bypassing the MercuryAPI to send commands to the ThingMagic Nano module directly, but some information about this interface is useful when troubleshooting and debugging applications which interface with the MercuryAPI."

Again, not an expert, but it looks like you are sending opcodes directly to the M6E device? Or are you using the Mercury API SDK under the hood, having compiled something from that?

Do you happen to know where I could find more documentation around the opcodes M6E supports? So far, I have been looking at the Mercury API SDK code snippets to see if I can learn something from that. Not very quick I suppose.

Vague questions I suppose, but any pointer in the right direction could help me :-)

Thanks and best,
Lex

ESP32 seems RX is ok but not TX

Hi,
i am trying to wire the RFID module to an ESP32 devkit.
I use a BSS138 level shifter (and also tried with a 4050 level shifter)

I can receive communication from the RFID module, but any attempt to send seems to fail.

Code:
`#include <Arduino.h>
#include <SparkFun_UHF_RFID_Reader.h>

RFID nano;

void setup()
{
Serial.begin(115200);
nano.enableDebugging(Serial);

Serial1.begin(115200);
nano.begin(Serial1);
}

void loop()
{
nano.getVersion();
}`

The log says:
sendCommand: [FF] [00] [03] [1D] [0C]
Time out 1: No response from module

If i reset the RFID module by grounding enable pin i can see:
sendCommand: [FF] [00] [03] [1D] [0C]
response: [FF] [14] [04] [00] [00] [14] [12] [08] [00] [30] [00] [00] [02] [20] [22] [08] [04] [01] [0B] [01] [25] [00] [00] [00] [10]
Wrong opcode response

which i guess is the firmware version sent at boot (as mentioned in examples).
The "wrong opcode response" is logical since it was asking for getVersion and got something else instead.
It shows that RFID -> ESP32 serial is working.

So it seems that my ESP32 can receive data from the module,
but any command sent does timeout without answer...

Any clue ?
Thanks !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.