M6E Nano with hardware serial

Hi everyone,

I recently bougth this board

i would like to know if it can be configured with hardware serial, i would like to use an arduino due but it doesnt have a sofware library.

thanks for your time

This link says yes Simultaneous RFID Tag Reader Hookup Guide - learn.sparkfun.com

Of course the Due has a serial library.

I cheked that tutorial but all the examples uses the sofware serial library, when i try to compile the sketch from the constant read example it shows this error only when a due board on programming port its selected

Arduino:1.6.12 (Windows 10), Tarjeta:“Arduino Due (Programming Port)”

D:\GoogleDrive\arduino-1.6.12\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library-master\examples\Example1_Constant_Read\Example1_Constant_Read.ino:13:66: fatal error: SoftwareSerial.h: No such file or directory

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

^

compilation terminated.

exit status 1
Error compilación en tarjeta Arduino Due (Programming Port).

Este reporte podría tener más información con
“Mostrar salida detallada durante la compilación”
opción habilitada en Archivo → Preferencias.

here are the screenshots

The Due has four hardware serial ports, there is no need to use software serial at all.
In fact as you have found software serial will not work on the Due. This is because the timer structure is different and so is not compatible.

Just use Serial1, Serial2 or Serial3 in place of the software serial.

itried to change the sofserial part to serial2 heres the program

/*
  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(115200);
  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(Serial2); //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
  Serial2.begin(baudRate); //For this test, assume module is already at our desired baud rate
  while(!Serial2); //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(Serial2.available()) Serial2.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
    Serial2.begin(115200); //Start software serial at 115200

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

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

  //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
}

but i got this error with write data

Arduino:1.6.12 (Windows 10), Tarjeta:“Arduino Due (Programming Port)”

Opciones de compilación cambiadas, reconstruyendo todo
D:\GoogleDrive\arduino-1.6.12\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library-master\src\SparkFun_UHF_RFID_Reader.cpp: In member function ‘uint8_t RFID::writeTagEPC(char*, uint8_t, uint16_t)’:

D:\GoogleDrive\arduino-1.6.12\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library-master\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:\GoogleDrive\arduino-1.6.12\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library-master\src\SparkFun_UHF_RFID_Reader.cpp:42:0:

D:\GoogleDrive\arduino-1.6.12\libraries\SparkFun_Simultaneous_RFID_Tag_Reader_Library-master\src\SparkFun_UHF_RFID_Reader.h:119:12: 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 compilación en tarjeta Arduino Due (Programming Port).

Este reporte podría tener más información con
“Mostrar salida detallada durante la compilación”
opción habilitada en Archivo → Preferencias.

if i comment the softserial and compile it with arduino uno board it seems to compile correctly so maybe its something i have to define on the serial regarding the type of data

This error looks to me like a library bug, caused by conditional compilation for the Due. Send the error message to SparkFun and ask for a fix.

i post the issue on the sparkfun forum

maybe i can check what does the library send from the uno to the module and replicate that on the DUE i couldnt find the specifics command that has to be send only the mercury API.

Does someone know where i can find a document with the configuration commands?

Hi
Do you have some news ?
I'm trying to connect the ME6 NANO using the hardware Serial too.
For the configuration commands you can see it in the header file gave by Sparkfun.

I implemented the ME6 Nano as a shield on a Mega 2560, and IIRC, to get 115.2kbps, I had to switch to SW_UART, as well as solder pin 2 (on the nano shield) to pin 11 (that could handle high speed software serial)… Otherwise it locks up the HW serial (RX0 TX0 (D0 & ) as shared with USB. (classic arduino USB/serial conflict)

After that… it worked like a champ.

Some of this is documented in the detailed HOWTO on Sparkfun here:
https://learn.sparkfun.com/tutorials/simultaneous-rfid-tag-reader-hookup-guide/all

(I forget where I got the ping D2 to pin D11 hack)

and then in my mode, set it up as such:

//////////////////////  RFID Variables /////////////////////////
#include <SoftwareSerial.h> //Used for transmitting to the device
// TWW - Using with the Mega, have to wire the nano's pin D2 to D11 for swserial to work
SoftwareSerial softSerial(11, 3);     //RX,TX
#include "SparkFun_UHF_RFID_Reader.h" //Library for controlling the M6E Nano module
RFID nano;                            //Create M6E Nano module

Good luck…

T.weeks