RFID Reader M7E and ESP32C6 - strange answer with binary

Dear forum member,

This is my first help message here after 2 days of deep work on the RFID M7E reader and an ESP32C6.

For you understanding I am not a tech guy so I used AI to help me write the configuration.

I tried different code but I have many issues even with the smallest one.

Here for example, with this code:

#include <HardwareSerial.h>

HardwareSerial SerialRFID(0); // UART0 : RX=GPIO1, TX=GPIO2



void setup() {

Serial.begin(115200);

SerialRFID.begin(38400, SERIAL_8N1, 1, 2); // 115200 bauds

Serial.println("Test minimal : attente de données du M7HE Octo...");

}




void loop() {

if (SerialRFID.available()) {

    byte data = SerialRFID.read();

Serial.print("Donnée reçue: 0x");

Serial.println(data, HEX);

  }

}

I get only this kind of data:
16:44:41.078 → Donnée reçue: 0x62
16:44:41.078 → Donnée reçue: 0xFF
16:44:41.241 → Donnée reçue: 0x7D
16:44:43.611 → Donnée reçue: 0xFC
16:44:43.908 → Donnée reçue: 0x6F
16:44:47.568 → Donnée reçue: 0x0
16:44:47.568 → Donnée reçue: 0xFF

How can. I get the Tag ID + RSSI + Counter + Timestamp?

I also tried this but I have no answer at all:

#include <HardwareSerial.h>

#include "SparkFun_UHF_RFID_Reader.h" // Librairie SparkFun




// Déclarer l'UART pour le M7HE Octo (UART0 : RX=GPIO1, TX=GPIO2)

HardwareSerial rfidSerial(0);




// Créer une instance du module RFID

RFID rfidModule;




// Définir le type de module (M7E HECTO)

#define moduleType ThingMagic_M7E_HECTO




// Baud rate pour le M7HE Octo

#define rfidBaud 38400




// Buffer pour le mode binaire (fallback)

const int BUFFER_SIZE = 64;

byte binaryBuffer[BUFFER_SIZE];

int binaryBufferIndex = 0;




void setup() {

Serial.begin(115200); // Serial Monitor (PC)

while (!Serial); // Attendre que le port série soit prêt




  // Initialiser l'UART pour le M7HE Octo

rfidSerial.begin(rfidBaud, SERIAL_8N1, 1, 2); // RX=GPIO1, TX=GPIO2




  // Forcer le mode texte et réinitialiser le module

Serial.println("⚙️ Configuration du module en mode texte...");

rfidSerial.println("~CONFIG:TEXT,ON"); // Forcer le mode texte

delay(500);

rfidSerial.println("~RESET"); // Réinitialiser le module

delay(1000);




  // Vider le buffer

while (rfidSerial.available()) {

rfidSerial.read();

  }




  // Configurer le module RFID avec la librairie SparkFun

if (setupRfidModule(rfidBaud)) {

Serial.println("✅ Module configuré en mode texte !");

rfidModule.setRegion(REGION_EUROPE); // Remplacez par votre région

rfidModule.setReadPower(500); // 5 dBm

rfidModule.startReading(); // Démarrer la lecture

  } else {

Serial.println("⚠️ Échec de la configuration en mode texte. Passage en mode binaire...");

  }

}




void loop() {

  // Essayer de lire en mode texte (librairie SparkFun)

if (rfidModule.check() == true) {

    byte responseType = rfidModule.parseResponse();




if (responseType == RESPONSE_IS_KEEPALIVE) {

Serial.println("🔍 Scanning...");

    }

else if (responseType == RESPONSE_IS_TAGFOUND) {

int rssi = rfidModule.getTagRSSI();

long freq = rfidModule.getTagFreq();

long timeStamp = rfidModule.getTagTimestamp();

      byte tagEPCBytes = rfidModule.getTagEPCBytes();




Serial.print("🏷️ Tag détecté | RSSI: ");

Serial.print(rssi);

Serial.print(" dBm | Fréquence: ");

Serial.print(freq);

Serial.print(" kHz | Timestamp: ");

Serial.print(timeStamp);

Serial.print(" ms | EPC: ");




for (byte x = 0; x < tagEPCBytes; x++) {

if (rfidModule.msg[31 + x] < 0x10) Serial.print("0");

Serial.print(rfidModule.msg[31 + x], HEX);

Serial.print(" ");

      }

Serial.println();

    }

else if (responseType == ERROR_CORRUPT_RESPONSE) {

Serial.println("⚠️ Erreur CRC (données corrompues)");

    }

else if (responseType == RESPONSE_IS_HIGHRETURNLOSS) {

Serial.println("⚠️ Perte de retour élevée, vérifiez l'antenne !");

    }

  }

  // Si le mode texte échoue, lire en mode binaire

else {

readBinaryMode();

  }

}




// Fonction pour lire en mode binaire (fallback)

void readBinaryMode() {

while (rfidSerial.available() && binaryBufferIndex < BUFFER_SIZE) {

binaryBuffer[binaryBufferIndex++] = rfidSerial.read();

  }




  // Rechercher le motif 0xFF 0xFE (début de trame)

for (int i = 0; i < binaryBufferIndex - 1; i++) {

if (binaryBuffer[i] == 0xFF && binaryBuffer[i+1] == 0xFE) {

Serial.println("\n--- Début de trame binaire détecté ---");

Serial.print("Données brutes : ");

for (int j = i; j < min(i + 14, binaryBufferIndex); j++) {

if (binaryBuffer[j] < 0x10) Serial.print("0");

Serial.print(binaryBuffer[j], HEX);

Serial.print(" ");

      }

Serial.println();




      // Extraire le RSSI (supposons qu'il est à l'octet i+8)

int8_t rssi = (int8_t)binaryBuffer[i+8];

Serial.print("RSSI : ");

Serial.print(rssi);

Serial.println(" dBm");




      // Extraire le Tag ID (supposons qu'il commence à i+2, longueur 8 octets)

Serial.print("Tag ID : ");

for (int j = i+2; j < i+10; j++) {

if (binaryBuffer[j] < 0x10) Serial.print("0");

Serial.print(binaryBuffer[j], HEX);

Serial.print(" ");

      }

Serial.println();




      // Réinitialiser le buffer

      binaryBufferIndex = 0;

break;

    }

  }




  // Réinitialiser le buffer s'il est plein

if (binaryBufferIndex >= BUFFER_SIZE) {

    binaryBufferIndex = 0;

Serial.println("\nBuffer plein, réinitialisation...");

  }

}




// Fonction pour configurer le module RFID (mode texte)

boolean setupRfidModule(long baudRate) {

rfidModule.begin(rfidSerial, moduleType); // Initialiser la communication




  // Tester si le module est déjà configuré

rfidSerial.begin(baudRate);

delay(100);




  // Ignorer les messages de démarrage

while (rfidSerial.available()) {

rfidSerial.read();

  }




  // Vérifier la version du module

rfidModule.getVersion();

if (rfidModule.msg[0] == ERROR_WRONG_OPCODE_RESPONSE) {

rfidModule.stopReading();

Serial.println("⚠️ Module en lecture continue. Arrêt en cours...");

delay(1500);

  } else {

rfidSerial.begin(115200);

rfidModule.setBaud(baudRate);

rfidSerial.begin(baudRate);

delay(250);

  }




  // Tester la connexion

rfidModule.getVersion();

if (rfidModule.msg[0] != ALL_GOOD) {

return false;

  }




rfidModule.setTagProtocol(); // Protocole GEN2

rfidModule.setAntennaPort(); // Ports TX/RX à 1

return true;

}

I think everything would be easier working in a text mode instead of a binary mode. How can I do that?

In addition I need to let the tag over the reader quite a long time to get an answer and to shake the tags to get the different binary data…

Thanks in advance for your help.

Have a nice day

Maxime

The first code’s output is in hex because the AI had you use that for some reason (the line that says “data, hex” is setting what is being read and its output format)

I’d recommend starting with the Universal Reader Assistant first and then after getting tags to read go back to trying to interact with the library - be sure to click ‘examples’ after getting it set up and run example 1 which has RSSI, EPC code, time, freq, etc

Hello Russell,

I confirme you it works very well with the URA on my laptop. The software is really good.

I previously tried to run an example without success. This morning I tried again and this time I have a message error. “Module failed to respond. Please check wiring.” and in the meantime I have still this strange answer while reading tags with other code. I put #define rfidSerial Serial1 // Hardware serial (eg. ESP32 or Teensy) and also #define rfidBaud 115200. Then I tried to put #define rfidBaud 38400 which is not recommended for ESP32.

Still the same error message.

For wiring, I put ESP32 GND on M7E GND, GPIO1 to M7E TX and GPIO2 to M7E RX.

Have a nice day

I assume you also connected the +5v from the ESP to the M7E VCC.

can you share the exact sketch you used ?

Hello Paul, I use my computer to power the ESP32 with its USB-C port and a 5V/3A power supply through the USB-C connector of the M7E. The switch on the M7E is on serial. On my ESP32C6 I use the GPIO1 and GPIO2, maybe it’s the issue.

you indeed try to assign Serial1 to other pins like D6 and D7 As in the example on Pin Multiplexing With Seeed Studio XIAO ESP32C6 | Seeed Studio Wiki

I tried with lots of hope but it did not work. I also tried this code to check the connexion without success:

#define RX_PIN 16
#define TX_PIN 17

int baudRates = {9600, 19200, 38400, 57600, 115200};
int currentBaudIndex = 0;

void setup() {
Serial.begin(115200);
testNextBaudRate();
}

void testNextBaudRate() {
if (currentBaudIndex < 5) {
Serial1.end();
Serial1.begin(baudRates[currentBaudIndex], SERIAL_8N1, RX_PIN, TX_PIN);
Serial.print(“Test à “);
Serial.print(baudRates[currentBaudIndex]);
Serial.println(” bauds…”);

// Envoyer une commande simple
Serial1.println("~GET:VERSION");
currentBaudIndex++;

}
}

void loop() {
if (Serial1.available()) {
String response = Serial1.readStringUntil(‘\n’);
Serial.print("Réponse à “);
Serial.print(baudRates[currentBaudIndex - 1]);
Serial.print(” bauds: ");
Serial.println(response);

// Si on reçoit une réponse valide, on arrête les tests
if (response.indexOf("VERSION:") != -1) {
  Serial.print("✅ Vitesse en bauds correcte: ");
  Serial.println(baudRates[currentBaudIndex - 1]);
  while (1); // Arrêter le programme
}

}

// Changer de vitesse en bauds après 2 secondes sans réponse
static unsigned long lastTime = millis();
if (millis() - lastTime > 2000 && currentBaudIndex < 5) {
lastTime = millis();
testNextBaudRate();
}
}

you are using the wrong pins. 16 is UART0-TX, 17 UART0-RX. That is used for USB communication.

Try using pin D8 (that is pin 19) and D9 (that is pin 20).

Use example 1:

#define rfidSerial Serial1

#define RX_PIN D8
#define TX_PIN D9

in setup :

Serial1.begin(115000, SERIAL_8N1, RX_PIN, TX_PIN);

ps I have done an edit.. the XIAO is confusing…

I tried and use this code but still nothing whereas I have changed accordingly the wires positon on the ESP32C6…

/*

Lecture de tags RFID avec ESP32-C6 et M7HE Octo

Adapté pour UART1 avec GPIO16 (RX) et GPIO17 (TX) à 115200 bauds

*/

#include “SparkFun_UHF_RFID_Reader.h”

// Définir les broches UART1 pour ESP32-C6

#define RX_PIN D8 // Broche RX (connectée à TX du M7HE Octo)

#define TX_PIN D9 // Broche TX (connectée à RX du M7HE Octo)

// Définir l’instance HardwareSerial pour UART1

HardwareSerial rfidSerial(1); // UART1

// Définir le type de module

#define moduleType ThingMagic_M7E_HECTO

#define rfidBaud 115200 // Vitesse en bauds (115200)

RFID rfidModule;

void setup() {

Serial.begin(115200); // Serial Monitor (PC)

while (!Serial); // Attendre que le port série soit prêt

// Initialiser UART1 avec les broches RX_PIN et TX_PIN

rfidSerial.begin(rfidBaud, SERIAL_8N1, RX_PIN, TX_PIN);

if (setupRfidModule(rfidBaud) == false) {

Serial.println(F(“:cross_mark: Erreur : Module RFID non détecté. Vérifiez le câblage et la vitesse en bauds !”));

while (1); // Bloquer en cas d’erreur

}

// Configurer la région (à adapter selon votre pays)

rfidModule.setRegion(REGION_EUROPE); // Remplacez par REGION_NORTHAMERICA si nécessaire

// Configurer la puissance de lecture (5 dBm par défaut)

rfidModule.setReadPower(500); // 5.00 dBm (max : 27 dBm)

Serial.println(F(“:white_check_mark: Module RFID prêt ! Appuyez sur une touche pour commencer la lecture…”));

while (!Serial.available()); // Attendre que l’utilisateur appuie sur une touche

Serial.read(); // Lire et ignorer le caractère

rfidModule.startReading(); // Démarrer la lecture continue des tags

}

void loop() {

if (rfidModule.check() == true) { // Vérifier si de nouvelles données sont disponibles

byte responseType = rfidModule.parseResponse();  // Analyser la réponse

if (responseType == RESPONSE_IS_KEEPALIVE) {

Serial.println(F(“:magnifying_glass_tilted_left: Scanning…”));

}

else if (responseType == RESPONSE_IS_TAGFOUND) {

int rssi = rfidModule.getTagRSSI(); // RSSI (dBm)

long freq = rfidModule.getTagFreq(); // Fréquence (kHz)

long timeStamp = rfidModule.getTagTimestamp(); // Timestamp (ms)

  byte tagEPCBytes = rfidModule.getTagEPCBytes();  // Nombre d'octets de l'EPC

Serial.print(F(":label: Tag détecté | RSSI: "));

Serial.print(rssi);

Serial.print(F(" dBm | Fréquence: "));

Serial.print(freq);

Serial.print(F(" kHz | Timestamp: "));

Serial.print(timeStamp);

Serial.print(F(" ms | EPC: "));

  // Afficher l'EPC en hexadécimal

for (byte x = 0; x < tagEPCBytes; x++) {

if (rfidModule.msg[31 + x] < 0x10) Serial.print(F(“0”)); // Formatage pour les valeurs < 0x10

Serial.print(rfidModule.msg[31 + x], HEX);

Serial.print(F(" "));

  }

Serial.println();

}

else if (responseType == ERROR_CORRUPT_RESPONSE) {

Serial.println(F(“:warning: Erreur CRC (données corrompues)”));

}

else if (responseType == RESPONSE_IS_HIGHRETURNLOSS) {

Serial.println(F(“:warning: Perte de retour élevée, vérifiez l’antenne !”));

}

else {

Serial.println(F(“:cross_mark: Erreur inconnue”));

}

}

}

// Fonction pour configurer le module RFID

boolean setupRfidModule(long baudRate) {

rfidModule.begin(rfidSerial, moduleType); // Initialiser la communication avec le module

// Tester si le module est déjà configuré et en lecture continue

rfidSerial.begin(baudRate, SERIAL_8N1, RX_PIN, TX_PIN); // Démarrer l’UART à la vitesse choisie

delay(100); // Attendre que le port s’ouvre

// Ignorer les messages de démarrage (firmware version)

while (rfidSerial.available()) {

rfidSerial.read();

}

// Vérifier la version du module

rfidModule.getVersion();

if (rfidModule.msg[0] == ERROR_WRONG_OPCODE_RESPONSE) {

// Le module est en lecture continue, on l'arrête

rfidModule.stopReading();

Serial.println(F(“:warning: Module en lecture continue. Arrêt en cours…”));

delay(1500);

}

else {

// Le module vient d'être allumé, on configure le baud rate

rfidSerial.begin(115200, SERIAL_8N1, RX_PIN, TX_PIN); // Démarrer à 115200 bauds (par défaut)

rfidModule.setBaud(baudRate); // Demander au module de passer à la vitesse choisie

rfidSerial.begin(baudRate, SERIAL_8N1, RX_PIN, TX_PIN); // Démarrer à la vitesse choisie

delay(250);

}

// Tester la connexion

rfidModule.getVersion();

if (rfidModule.msg[0] != ALL_GOOD) {

return false;

}

rfidModule.setTagProtocol(); // Protocole GEN2

rfidModule.setAntennaPort(); // Ports TX/RX à 1

return true;

}

I also tried to test the connexion with this code :

#define RX_PIN D8

#define TX_PIN D9

int baudRates[] = {9600, 19200, 38400, 57600, 115200};

int currentBaudIndex = 0;

void setup() {

Serial.begin(115200);

testNextBaudRate();

}

void testNextBaudRate() {

if (currentBaudIndex < 5) {

Serial1.end();

Serial1.begin(baudRates[currentBaudIndex], SERIAL_8N1, RX_PIN, TX_PIN);

Serial.print("Test à ");

Serial.print(baudRates[currentBaudIndex]);

Serial.println(" bauds…");

// Envoyer une commande simple

Serial1.println(“~GET:VERSION”);

currentBaudIndex++;

}

}

void loop() {

if (Serial1.available()) {

String response = Serial1.readStringUntil('\\n');

Serial.print("Réponse à ");

Serial.print(baudRates[currentBaudIndex - 1]);

Serial.print(" bauds: ");

Serial.println(response);

// Si on reçoit une réponse valide, on arrête les tests

if (response.indexOf(“VERSION:”) != -1) {

Serial.print(":white_check_mark: Vitesse en bauds correcte: ");

Serial.println(baudRates[currentBaudIndex - 1]);

while (1); // Arrêter le programme

}

}

// Changer de vitesse en bauds après 2 secondes sans réponse

static unsigned long lastTime = millis();

if (millis() - lastTime > 2000 && currentBaudIndex < 5) {

lastTime = millis();

testNextBaudRate();

}

}

Then I got these answers with strange characters:

15:07:31.397 -> Réponse à 115200 bauds: �{����&����:@����������������������a �` ����������@p�� A �w�����������������6v�������t7F�������o�A@7�����������&�&7������7�D������������������������@���������������|��Z�
���	@���:��������"���`� ��������� @@������?��!������ �������

15:07:32.417 -> Réponse à 115200 bauds: '��������z��x�������������������������O�'�������@��������0`�H��,g��@@���������| @����@����@��g����������������:�����?����������������������	�������/���a�@@$@��@��0��������M����� �

15:07:32.777 -> Réponse à 115200 bauds: @ ��������������y������7�����C���������� ���������� |0@�����AD����������a`��  @@@����@���������@@`a���������@������������@� ��	���������B@@@��!������{�����8���߈o�����T��@�����B����������������� �?���`>��=��������	��������� ��������������	����?���

15:07:32.811 -> Réponse à 115200 bauds: a��@@@8��0

15:07:33.009 -> Réponse à 115200 bauds: ���e����@@���U���?�
7����a�6������������E������*\��������<�@@+�����|�E�?��=a@�@�������%����}�����������?������	��@Q����� ��������P���

15:07:33.009 -> Réponse à 115200 bauds: ����@@8@ 

I don’t know what you expect from the M7E with sending : Serial1.println(“~GET:VERSION”);

This is NOT a known command for the M7E.

USE Example 1 according to the instructions given. If you get an error message:

Remove and reapply power to the M7E and try again.

Make sure the switch is in Serial

Try swapping the TX and RX line for test and try again.

after Serial.begin() add : rfidModule.enableDebugging(Serial); Compile and try again. Share the debug message you get.

I get 16:26:23.913 -> Module failed to respond. Please check wiring even after removing power several times.

My code: 
/*
  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
*/

// Library for controlling the RFID module
#include "SparkFun_UHF_RFID_Reader.h"

// Create instance of the RFID module
RFID rfidModule;

// By default, this example assumes software serial. If your platform does not
// support software serial, you can use hardware serial by commenting out these
// lines and changing the rfidSerial definition below
// #include <SoftwareSerial.h>
// SoftwareSerial softSerial(2, 3); //RX, TX

// Here you can specify which serial port the RFID module is connected to. This
// will be different on most platforms, so check what is needed for yours and
// adjust the definition as needed. Some examples are provided below
// #define rfidSerial softSerial // Software serial (eg. Arduino Uno or SparkFun RedBoard)
#define rfidSerial Serial1 // Hardware serial (eg. ESP32 or Teensy)

// Here you can select the baud rate for the module. 38400 is recommended if
// using software serial, and 115200 if using hardware serial.
// #define rfidBaud 38400
#define rfidBaud 115200

// Here you can select which module you are using. This library was originally
// written for the M6E Nano only, and that is the default if the module is not
// specified. Support for the M7E Hecto has since been added, which can be
// selected below
// #define moduleType ThingMagic_M6E_NANO
#define moduleType ThingMagic_M7E_HECTO

#define RX_PIN D8
#define TX_PIN D9

void setup()
{
  Serial.begin(115200); // Serial Monitor (PC) à 115200 bauds
  Serial1.begin(115200, SERIAL_8N1, RX_PIN, TX_PIN); // UART pour le module RFID
  while (!Serial); //Wait for the serial port to come online

  if (setupRfidModule(rfidBaud) == false)
  {
    Serial.println(F("Module failed to respond. Please check wiring."));
    while (1); //Freeze!
  }

  rfidModule.setRegion(REGION_EUROPE); //Set to Europe

  rfidModule.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

  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

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

void loop()
{
  if (rfidModule.check() == true) //Check to see if any new data has come in from module
  {
    byte responseType = rfidModule.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 = rfidModule.getTagRSSI(); //Get the RSSI for this tag read

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

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

      byte tagEPCBytes = rfidModule.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 (rfidModule.msg[31 + x] < 0x10) Serial.print(F("0")); //Pretty print
        Serial.print(rfidModule.msg[31 + x], HEX);
        Serial.print(F(" "));
      }
      Serial.print(F("]"));

      Serial.println();
    }
    else if (responseType == ERROR_CORRUPT_RESPONSE)
    {
      Serial.println(F("Bad CRC"));
    }
    else if (responseType == RESPONSE_IS_HIGHRETURNLOSS)
    {
      Serial.println(F("High return loss, check antenna!"));
    }
    else
    {
      //Unknown response
      Serial.println(F("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 setupRfidModule(long baudRate)
{
  rfidModule.begin(rfidSerial, moduleType); //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
  rfidSerial.begin(baudRate); //For this test, assume module is already at our desired baud rate
  delay(100); //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 (rfidSerial.available())
    rfidSerial.read();

  rfidModule.getVersion();

  if (rfidModule.msg[0] == ERROR_WRONG_OPCODE_RESPONSE)
  {
    //This happens if the baud rate is correct but the module is doing a continuous read
    rfidModule.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
    rfidSerial.begin(115200); //Start serial at 115200

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

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

    delay(250);
  }

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

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

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

  return true; //We are ready to rock
}

Answer: -> Module failed to respond. Please check wiring.

Then I swapper the TR and RX on the M7E and tried again even after unpluging power. 
-> Module failed to respond. Please check wiring.

I also tried again with #define RX_PIN D7

#define TX_PIN D6

just in case…

Each time the same answer and I use a 5V/3A power for the M7E…

I tried to understand the pins here. I have already tried D6, D7, D8, D9, 16, 17…

Once the M7E is “lost”, it stays “lost”, hence removing / reapplying the power in between test. The 5V /3A is necessary once you start reading/writing with high dBm. Before that time it is basic communication, where the power can be taken from the 5V of the ESP32.

have you tried the enable debug? What does it say

Else:

What happens if you enable debugging, but connect Serial1 TX and RX together (no M7E). What do you get ?

Please also solder header pins on the M7E…leaving the dupont cables loose/tension-fit in the PTH holes will always be an unstable connection for both power and data transmission; both devices need headers in place when using serial communication