'LoRaE5' does not name a type

pls help me solve this error

Arduino: 1.8.18 (Windows 10), Board: "XIAO_ESP32C3, Enabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 160MHz (WiFi), QIO, 80MHz, 4MB (32Mb), 921600, None"

Receiver:12:1: error: 'LoRaE5' does not name a type

LoRaE5 lora;

^~~~~~

Multiple libraries were found for "WebServer.h"

Used: C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.4\libraries\WebServer

Not used: C:\Users\User\Documents\Arduino\libraries\Webduino-master

Multiple libraries were found for "WiFi.h"

Used: C:\Users\User\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.4\libraries\WiFi

Not used: C:\Users\User\Documents\Arduino\libraries\WiFi

exit status 1

'LoRaE5' does not name a type

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Hi @akcoding26. Did you find this sketch code somewhere on the Internet? Or did you write it yourself?

If you found it on the Internet, please provide a link to where you found it in a reply here on this forum topic

Likewise, if you are following some tutorial or reference when writing the code yourself, please provide the link to that tutorial or reference.

That will provide valuable context that will allow the forum helpers to more effectively assist you.

There are two (maybe more) LoRaE5 libraries if I'm not mistaken. Which one did you install?

Did you check the examples that come with the library that you installed?

Next time, please post your code using code tags using the <CODE/> button in the reply window or by using Edit -> Copy for Forum in the IDE.

You can also use the <CODE> button for the errors that you get; it's usually easier for people to copy if needed.

code in post 1 looks like a modified example code p2p_rx.ino from idreamsi/LoRaE5 library

a version for ESP32

// ESP32 <> Grove-E5 LoRa module

// example p2p_rx.ino from  https://github.com/idreamsi/LoRaE5  

#include <LoRaE5.h>
unsigned char buffer[128] = {0, };

#define GROVE_TX 15//21
#define GROVE_RX 16//20

void setup(void)
{
    SerialUSB.begin(115200);
    delay(2000);
    Serial.println("ESP32 Grove-E5 receiver");
    lora.init(GROVE_RX, GROVE_TX);
    lora.init();
    char id[200]={0};
    char version[50]={0};
    lora.getVersion(version, 50);
    Serial.printf("Version = %s  \n",version);
    lora.getId(id, 200);
    Serial.printf("ID = %s\n", id);
    lora.initP2PMode(866, SF12, BW125, 12, 15, 14);
}

void loop(void)
{
    short length = 0;
    short rssi = 0;
    
    memset(buffer, 0, 128);
    length = lora.receivePacketP2PMode(buffer, 128,  &rssi, 1);
    
    if(length)
    {
        SerialUSB.print("Length is: ");
        SerialUSB.println(length);
        SerialUSB.print("RSSI is: ");
        SerialUSB.println(rssi);
        SerialUSB.print("Data is: ");
        for(unsigned char i = 0; i < length; i ++)
        {
            SerialUSB.print("0x");
            SerialUSB.print(buffer[i], HEX);
            SerialUSB.print(" ");
        }
        SerialUSB.println();
    }
}

serial monitor displays

ESP32 Grove-E5 receiver
Version =   
ID = +ID: DevAddr, 42:00:33:26
+ID: DevEui, 2C:F7:F1:20:42:00:33:26
+ID: AppEui, 80:00:00:00:00:00:00:06

not receiving at present - a configuration problem between transmitter (Adafruit Feather 32u4 LoRa module) and above code

EDIT: updated LoRaE5 module code to

// ESP32 <> Grove-E5 LoRa module

// example p2p_rx.ino from  https://github.com/idreamsi/LoRaE5  

#include <LoRaE5.h>
unsigned char buffer[128] = {0};

#define GROVE_TX 15//21
#define GROVE_RX 16//20

void setup(void)
{
    Serial.begin(115200);
    delay(2000);
    Serial.println("ESP32 Grove-E5 receiver");
    lora.init(GROVE_RX, GROVE_TX);
    lora.init();
    char id[200]={0};
    char version[50]={0};
    lora.getVersion(version, 50);
    Serial.printf("Version = %s  \n",version);
    lora.getId(id, 200);
    Serial.printf("ID = %s\n", id);
    lora.initP2PMode(866, SF7, BW125, 12, 8, 8);
}

void loop(void)
{
    short length = 0;
    short rssi = 0;
    
    memset(buffer, 0, 128);
    length = lora.receivePacketP2PMode(buffer, 128,  &rssi, 1);
    
    if(length)
    {
        Serial.print("Length is: ");
        Serial.println(length);
        Serial.print("RSSI is: ");
        Serial.println(rssi);
        Serial.print("Data is: ");
        for(unsigned char i = 0; i < length; i ++)
        {
            Serial.print("0x");
            Serial.print(buffer[i], HEX);
            Serial.print(" ");
        }
        Serial.println();
    }
}

using a Heltec_WiFi_LoRa32_V2 as transmitter

// Heltec ESP32 LoRa (V2) SX1278 transmitter

/*******************************************************************************************************
  Programs for Arduino - Copyright of the author Stuart Robinson - 20/01/20

  This program is supplied as is, it is up to the user of the program to decide if the program is
  suitable for the intended purpose and free from errors.
*******************************************************************************************************/


/*******************************************************************************************************
  Program Operation - This is a simple LoRa test transmitter for an ESP32 device. A packet containing
  ASCII text is sent according to the frequency and LoRa settings specified in the 'Settings.h' file.
  The pins to access the SX127X need to be defined in the 'Settings.h' file also.

  The program also has the option of using a logic pin to control the power to the lora and SD card
  devices, which can save power in sleep mode. If the hardware is fitted to your board these devices are
  powered on by setting the VCCPOWER pin low. If your board does not have this feature set VCCPOWER to -1.

  The details of the packet sent and any errors are shown on the Serial Monitor, together with the transmit
  power used, the packet length and the CRC of the packet. The matching receive program, '4_LoRa_Receive'
  can be used to check the packets are being sent correctly, the frequency and LoRa settings (in Settings.h)
  must be the same for the Transmit and Receive program. Sample Serial Monitor output;

  10dBm Packet> {packet contents*}  BytesSent,23  CRC,DAAB  TransmitTime,54mS  PacketsSent,1

  Serial monitor baud rate is set at 9600
*******************************************************************************************************/

#include <SPI.h>                                               //the SX127X device is SPI based so load the SPI library                                         
#include <SX127XLT.h>                                          //include the appropriate library  
#include "Settings.h"                                          //include the setiings file, frequencies, LoRa settings etc   

SX127XLT LT;                                                   //create a library class instance called LT

uint8_t TXPacketL;
uint32_t TXPacketCount, startmS, endmS;

uint8_t buff[] = "0Hello World 1234567890";

void loop()
{
  Serial.print(TXpower);                                       //print the transmit power defined
  Serial.print(F("dBm "));
  Serial.print(F("Packet> "));
  Serial.flush();

  TXPacketL = sizeof(buff);                                    //set TXPacketL to length of array
  buff[TXPacketL - 1] = '*';                                   //replace null character at buffer end so its visible on reciver

  LT.printASCIIPacket(buff, TXPacketL);                        //print the buffer (the sent packet) as ASCII

  digitalWrite(LED1, HIGH);
  startmS =  millis();                                         //start transmit timer
  if (LT.transmit(buff, TXPacketL, 5000, TXpower, WAIT_TX))    //will return packet length sent if OK, otherwise 0 if transmit error
  {
    endmS = millis();                                          //packet sent, note end time
    TXPacketCount++;
    packet_is_OK();
  }
  else
  {
    packet_is_Error();                                 //transmit packet returned 0, there was an error
  }

  digitalWrite(LED1, LOW);
  Serial.println();
  // increment buff[0] or reset to '0'
  if(buff[0]=='9') buff[0]='0'; 
  else buff[0]++;
  delay(5000);//packet_delay);                                 //have a delay between packets
}


void packet_is_OK()
{
  //if here packet has been sent OK
  uint16_t localCRC;

  Serial.print(F("  BytesSent,"));
  Serial.print(TXPacketL);                             //print transmitted packet length
  localCRC = LT.CRCCCITT(buff, TXPacketL, 0xFFFF);
  Serial.print(F("  CRC,"));
  Serial.print(localCRC, HEX);                              //print CRC of sent packet
  Serial.print(F("  TransmitTime,"));
  Serial.print(endmS - startmS);                       //print transmit time of packet
  Serial.print(F("mS"));
  Serial.print(F("  PacketsSent,"));
  Serial.print(TXPacketCount);                         //print total of packets sent OK
}


void packet_is_Error()
{
  //if here there was an error transmitting packet
  uint16_t IRQStatus;
  IRQStatus = LT.readIrqStatus();                  //read the the interrupt register
  Serial.print(F(" SendError,"));
  Serial.print(F("Length,"));
  Serial.print(TXPacketL);                         //print transmitted packet length
  Serial.print(F(",IRQreg,"));
  Serial.print(IRQStatus, HEX);                    //print IRQ status
  LT.printIrqStatus();                             //prints the text of which IRQs set
}


void led_Flash(uint16_t flashes, uint16_t delaymS)
{
  uint16_t index;
  for (index = 1; index <= flashes; index++)
  {
    digitalWrite(LED1, HIGH);
    delay(delaymS);
    digitalWrite(LED1, LOW);
    delay(delaymS);
  }
}


void setup()
{
  pinMode(LED1, OUTPUT);                               //setup pin as output for indicator LED
  led_Flash(2, 125);                                   //two quick LED flashes to indicate program start

  if (VCCPOWER >= 0)
  {
    pinMode(VCCPOWER, OUTPUT);                  //For controlling power to external devices
    digitalWrite(VCCPOWER, LOW);                //VCCOUT on. lora device on
  }

  Serial.begin(115200);
  delay(3000);
  Serial.println();
  Serial.println(F("3_LoRa_Transmitter_ESP32 Starting"));

  //SPI.begin();                                //default setup can be used be used
  SPI.begin(SCK, MISO, MOSI);                   //alternative format for SPI3, VSPI; SPI.begin(SCK,MISO,MOSI,SS)

  //SPI beginTranscation is normally part of library routines, but if it is disabled in library
  //a single instance is needed here, so uncomment the program line below
  //SPI.beginTransaction(SPISettings(8000000, MSBFIRST, SPI_MODE0));

  //setup hardware pins used by device, then check if device is found
  if (LT.begin(NSS, NRESET, DIO0, LORA_DEVICE))
  {
    Serial.println(F("LoRa Device found"));
    led_Flash(2, 125);                                   //two further quick LED flashes to indicate device found
    delay(1000);
  }
  else
  {
    Serial.println(F("No device responding"));
    while (1)
    {
      led_Flash(50, 50);                                 //long fast speed LED flash indicates device error
    }
  }

  //The function call list below shows the complete setup for the LoRa device using the information defined in the
  //Settings.h file.
  //The 'Setup LoRa device' list below can be replaced with a single function call;
  //LT.setupLoRa(Frequency, Offset, SpreadingFactor, Bandwidth, CodeRate, Optimisation);

  //***************************************************************************************************
  //Setup LoRa device
  //***************************************************************************************************
  LT.setMode(MODE_STDBY_RC);                              //got to standby mode to configure device
  LT.setPacketType(PACKET_TYPE_LORA);                     //set for LoRa transmissions
  LT.setRfFrequency(Frequency, Offset);                   //set the operating frequency
  LT.calibrateImage(0);                                   //run calibration after setting frequency
  LT.setModulationParams(SpreadingFactor, Bandwidth, CodeRate, LDRO_AUTO);  //set LoRa modem parameters
  LT.setBufferBaseAddress(0x00, 0x00);                    //where in the SX buffer packets start, TX and RX
  LT.setPacketParams(8, LORA_PACKET_VARIABLE_LENGTH, 255, LORA_CRC_ON, LORA_IQ_NORMAL);  //set packet parameters
  LT.setSyncWord(LORA_MAC_PRIVATE_SYNCWORD);              //syncword, LORA_MAC_PRIVATE_SYNCWORD = 0x12, or LORA_MAC_PUBLIC_SYNCWORD = 0x34
  LT.setHighSensitivity();                                //set for highest sensitivity at expense of slightly higher LNA current
  LT.setDioIrqParams(IRQ_RADIO_ALL, IRQ_TX_DONE, 0, 0);   //set for IRQ on RX done
  //***************************************************************************************************

  Serial.println();
  LT.printModemSettings();                                //reads and prints the configured LoRa settings, useful check
  Serial.println();
  LT.printOperatingSettings();                            //reads and prints the configured operating settings, useful check
  Serial.println();
  Serial.println();
  LT.printRegisters(0x00, 0x4F);                          //print contents of device registers, normally 0x00 to 0x4F
  Serial.println();
  Serial.println();

  Serial.print(F("Transmitter ready"));
  Serial.println();
}

Heltec_WiFi_LoRa32_V2 serial monitor output

Transmitter ready
10dBm Packet> 0Hello World 1234567890*  BytesSent,24  CRC,3382  TransmitTime,62mS  PacketsSent,1
10dBm Packet> 1Hello World 1234567890*  BytesSent,24  CRC,481  TransmitTime,62mS  PacketsSent,2
10dBm Packet> 2Hello World 1234567890*  BytesSent,24  CRC,5D84  TransmitTime,62mS  PacketsSent,3
10dBm Packet> 3Hello World 1234567890*  BytesSent,24  CRC,6A87  TransmitTime,62mS  PacketsSent,4
10dBm Packet> 4Hello World 1234567890*  BytesSent,24  CRC,EF8E  TransmitTime,62mS  PacketsSent,5
10dBm Packet> 5Hello World 1234567890*  BytesSent,24  CRC,D88D  TransmitTime,62mS  PacketsSent,6
10dBm Packet> 6Hello World 1234567890*  BytesSent,24  CRC,8188  TransmitTime,62mS  PacketsSent,7
10dBm Packet> 7Hello World 1234567890*  BytesSent,24  CRC,B68B  TransmitTime,62mS  PacketsSent,8
10dBm Packet> 8Hello World 1234567890*  BytesSent,24  CRC,9BBB  TransmitTime,62mS  PacketsSent,9
10dBm Packet> 9Hello World 1234567890*  BytesSent,24  CRC,ACB8  TransmitTime,62mS  PacketsSent,10
10dBm Packet> 0Hello World 1234567890*  BytesSent,24  CRC,3382  TransmitTime,62mS  PacketsSent,11
10dBm Packet> 1Hello World 1234567890*  BytesSent,24  CRC,481  TransmitTime,62mS  PacketsSent,12
10dBm Packet> 2Hello World 1234567890*  BytesSent,24  CRC,5D84  TransmitTime,62mS  PacketsSent,13
10dBm Packet> 3Hello World 1234567890*  BytesSent,24  CRC,6A87  TransmitTime,62mS  PacketsSent,14
10dBm Packet> 4Hello World 1234567890*  BytesSent,24  CRC,EF8E  TransmitTime,62mS  PacketsSent,15
10dBm Packet> 5Hello World 1234567890*  BytesSent,24  CRC,D88D  TransmitTime,62mS  PacketsSent,16
10dBm Packet> 6Hello World 1234567890*  BytesSent,24  CRC,8188  TransmitTime,62mS  PacketsSent,17

LoRaE5 serial monitor output

ESP32 Grove-E5 receiver
Version =   
ID = +ID: DevAddr, 42:00:33:26
+ID: DevEui, 2C:F7:F1:20:42:00:33:26
+ID: AppEui, 80:00:00:00:00:00:00:06
+TEST: LEN:24, RSSI:-33, SNR:12
+TEST: RX "3048656C6C6F20576F726C6420313233343536373839302A"

Length is: 24
RSSI is: -33
Data is: 0x31 0x48 0x65 0x6C 0x6C 0x6F 0x20 0x57 0x6F 0x72 0x6C 0x64 0x20 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x2A 
Length is: 24
RSSI is: -34
Data is: 0x32 0x48 0x65 0x6C 0x6C 0x6F 0x20 0x57 0x6F 0x72 0x6C 0x64 0x20 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x2A 
Length is: 24
RSSI is: -35
Data is: 0x33 0x48 0x65 0x6C 0x6C 0x6F 0x20 0x57 0x6F 0x72 0x6C 0x64 0x20 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x2A 
Length is: 24
RSSI is: -33
Data is: 0x34 0x48 0x65 0x6C 0x6C 0x6F 0x20 0x57 0x6F 0x72 0x6C 0x64 0x20 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x2A 
Length is: 24
RSSI is: -33
Data is: 0x35 0x48 0x65 0x6C 0x6C 0x6F 0x20 0x57 0x6F 0x72 0x6C 0x64 0x20 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x2A 
Length is: 24
RSSI is: -33
Data is: 0x36 0x48 0x65 0x6C 0x6C 0x6F 0x20 0x57 0x6F 0x72 0x6C 0x64 0x20 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x2A 
Length is: 24
RSSI is: -33
Data is: 0x37 0x48 0x65 0x6C 0x6C 0x6F 0x20 0x57 0x6F 0x72 0x6C 0x64 0x20 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x2A 
Length is: 24
RSSI is: -33
Data is: 0x38 0x48 0x65 0x6C 0x6C 0x6F 0x20 0x57 0x6F 0x72 0x6C 0x64 0x20 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x2A 
Length is: 24
RSSI is: -33
Data is: 0x39 0x48 0x65 0x6C 0x6C 0x6F 0x20 0x57 0x6F 0x72 0x6C 0x64 0x20 0x31 0x32 0x33 0x34 0x35 0x36 0x37 0x38 0x39 0x30 0x2A 
Length is: 24
RSSI is: -33

NOTE: if the transmitter transmits too fast, e.g. once a second, the receiver crashes with a reset