Hi all,
first of all please pardon a noob if I use the wrong theme !
I try to compile a sketch for ESP32 with LoRa chip.
This sketch compiled without error before. After a few modifications it suddenly complains about an error at a line which isn't existing in the sketch. Please see for yourself.
I have uninstalled the Arduino IDE and deleted all related folders (e.g. libraries) except the sketch folder and re-installed the IDE.
Error remains the same.
I'm somewhat baffled what is happening.
If anybody has a (good ) tip for me I will be grateful !
Thanks Peter
Hi david_2018,
that's what bothers me and I can't get rid of it ! The code line of the serial error is somthing like 356 but my sketch has only some 130 lines of code. I looked with Ultrasearch in the files and find a "Serial0" only in a library file. I have no idea how this slips into the sketch code.
To answer your question: LILYGO T3 V1.6.1 LoRa Board with display.
I didn't realize that as I was wondering about the "Serial0" error in the 3rd line.
What do you think could help ? Delete the file and start a new sketch with the same text typed anew ?
I have not the slightest idea what could cause this mixup of files.
I had however problems before that - when trying to compile - the compiler suddenly grumbled about the "Serial"code word (not declared). This disappeared when I restarted the laptop.
In file included from C:\Users\Papa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\cores\esp32/Arduino.h:200,
from C:\Users\Papa\AppData\Local\Temp\arduino\sketches\34FC23C5058564B6647C96341D540EAE\sketch\ESP32_LoRa_Sender_10102024.ino.ino.cpp:1:
C:\Users\Papa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\cores\esp32/HardwareSerial.h:356:16: error: 'Serial' does not name a type
356 | #define Serial Serial
| ^~~~~~
C:\Users\Papa\Documents\Arduino\ESP32_LoRa_Sender_10102024.ino\ESP32_LoRa_Sender_10102024.ino.ino:140:1: note: in expansion of macro 'Serial'
140 | Serial.println("Going to sleep now");
| ^~~~~~
C:\Users\Papa\Documents\Arduino\ESP32_LoRa_Sender_10102024.ino\ESP32_LoRa_Sender_10102024.ino.ino:141:6: error: expected constructor, destructor, or type conversion before '(' token
141 | delay(500);
| ^
C:\Users\Papa\Documents\Arduino\ESP32_LoRa_Sender_10102024.ino\ESP32_LoRa_Sender_10102024.ino.ino:142:23: error: expected constructor, destructor, or type conversion before ';' token
142 | esp_deep_sleep_start();
| ^
C:\Users\Papa\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.5\cores\esp32/HardwareSerial.h:356:16: error: 'Serial' does not name a type
356 | #define Serial Serial
| ^~~~~~
C:\Users\Papa\Documents\Arduino\ESP32_LoRa_Sender_10102024.ino\ESP32_LoRa_Sender_10102024.ino.ino:144:1: note: in expansion of macro 'Serial'
144 | Serial.println("This will never be printed");
| ^~~~~~
exit status 1
Compilation error: expected constructor, destructor, or type conversion before '(' token
that was my guess also, that somewhere information is cached and I can't get rid of it, but I couldn't find any info where the cache files are.
I will do as you proposed and report.
Thanks !
BTW: is there any settings possibility to empty the cache every time before compiling a sketch ?
I copied the code from the NERDS website and it compiles fine. All your deleting, uninstallig and installing only confuses the issue. Uness their is CONCRETE evidence of a failed installation, none of those steps is needed. I wil now try with your copy of the code. From what you siad it sounds like you may have hand transcribed it rther than copy all and paste. Will update.
I have to clear one thing:
I'm a noob with c++, makes me enough headache !
Just to build a small project needs a lot of digging.
It's like learning a new language just to order a meal in a foreign restaurant. I'm almost 80 and not so firm any more with learning new things, so have mercy on me ...