Thanks for quick response! RxTx are correct as evidenced by being able to receive from the module on startup
Sketch is below, followed by a startup printout (I added a few print statements to let me know how far it was getting)
/*
Reading multiple RFID tags, simultaneously!
By: Nathan Seidle @ SparkFun Electronics
Date: October 3rd, 2016
https://github.com/sparkfun/Simultaneous_RFID_Tag_Reader
Single shot read - Ask the reader to tell us what tags it currently sees. And it beeps!
If using the Simultaneous RFID Tag Reader (SRTR) shield, make sure the serial slide
switch is in the 'SW-UART' position.
*/
#include "SparkFun_UHF_RFID_Reader.h" //Library for controlling the M6E Nano module
// define the serial port to use (E.g. softSerial, Serial1 etc)
#define NanoSerial Serial2
RFID nano; //Create instance
void setup()
{
Serial.begin(115200);
NanoSerial.begin(115200);
while (!Serial);
Serial.println();
Serial.println("Initializing...");
delay(400); // Wait for the module to send version on power-up and display it
while (NanoSerial.available())
{
Serial.print(NanoSerial.read(), HEX);
Serial.print(" ");
}
Serial.println("(Power-up Version)");
if (setupNano(115200) == false) //Configure nano to run at 115200
{
Serial.println("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 cause USB port to brown out
//Max Read TX Power is 27.00 dBm and may cause temperature-limit throttling
}
void loop()
{
Serial.println(F("Press a key to scan for a tag"));
while (!Serial.available()); //Wait for user to send a character
Serial.read(); //Throw away the user's character
byte myEPC[12]; //Most EPCs are 12 bytes
byte myEPClength;
byte responseType = 0;
while (responseType != RESPONSE_SUCCESS)//RESPONSE_IS_TAGFOUND)
{
myEPClength = sizeof(myEPC); //Length of EPC is modified each time .readTagEPC is called
responseType = nano.readTagEPC(myEPC, myEPClength, 500); //Scan for a new tag up to 500ms
Serial.println(F("Searching for tag"));
}
//Print EPC
Serial.print(F(" epc["));
for (byte x = 0 ; x < myEPClength ; x++)
{
if (myEPC[x] < 0x10) Serial.print(F("0"));
Serial.print(myEPC[x], HEX);
Serial.print(F(" "));
}
Serial.println(F("]"));
}
boolean setupNano(long baudRate)
{
nano.enableDebugging(Serial);
nano.begin(NanoSerial); //Tell the library to communicate over 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
//NanoSerial.begin(nBaud); //For this test, assume module is already at our desired baud rate
//while(!NanoSerial); //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(NanoSerial.available()) NanoSerial.read();
Serial.println("Beginning getVersion");
nano.getVersion();
Serial.println("Finished 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
NanoSerial.begin(baudRate); //Start serial
nano.setBaud(baudRate); //Tell the module to go to the chosen baud rate. Ignore the response msg
NanoSerial.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
}
Here’s what we get on startup
Initializing...
0 FF 14 4 0 0 14 12 8 0 30 0 0 2 20 19 6 10 1 9 1 11 0 0 0 10 B5 11 (Power-up Version)
Beginning getVersion
sendCommand:
[FF] [00] [03] [1D] [0C]
Time out 1: No response from module
Finished getVersion
sendCommand:
[FF] [04] [06] [00] [01] [C2] [00] [A4] [60]
Time out 1: No response from module
sendCommand:
[FF] [00] [03] [1D] [0C]
Time out 1: No response from module
Module failed to respond. Please check wiring.
All looks like I would expect it. I have taken your sketch and just tested that on my Mega2560 (unmodified). I am running version 19 if firmware and do not see the firmware level display, but the commands provide the results as expected. Your connection all look correct as well.
This is a weird one… but some thoughts
Could it be an issue with Nano-RX line? Maybe the command that is sent is somehow not coming through.
–Check the soldering to not making a unwanted connection.
– try Serial1 or serial3
– different wire… (crazy idea… but it could be)
Is this a power issue? The Nano is sensitive to that, but I have only seen that been an issue once start reading reading.
– measure that it is really 5V.
– what happens after a triggering a reset (warm boot)
– maybe an external power supply (if you have one)
Maybe you have USB/Serial converter? In that case you could try to access with the URA on Windows?
Well, your ‘crazy idea’ worked in the end. Tried a new jumper for Rx - no change. Hooked a scope up to Rx and lo and behold it worked.
Long story short, the scope probe angled the connector slightly…
Replaced all jumpers with soldered connections and we’re in business!
BTW I’m using a library I think you upgraded last year - very nice. Ultimately I’ll need to modify it even more to make it non-blocking but that’s another story.