ropg / ESP32_RTC_EEPROM

EEPROM for ESP32 that uses Real-Time Clock RAM instead of NVS flash as a store. Survives ESP32's deep sleep, not reset or power-cycle. Can back up to flash.
GNU Lesser General Public License v2.1
3 stars 1 forks source link

Error compiling for board ESP32S3 Dev Module #1

Open mofm opened 7 months ago

mofm commented 7 months ago

I wanted to try this lib in my project to test it. But while compiling it on Arduino IDE, I got the following error:

/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::EEPROMClass()':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:31: multiple definition of `EEPROMClass::EEPROMClass()'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:37: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::EEPROMClass()':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:31: multiple definition of `EEPROMClass::EEPROMClass()'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:37: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::EEPROMClass(unsigned int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:40: multiple definition of `EEPROMClass::EEPROMClass(unsigned int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:41: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::EEPROMClass(unsigned int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:40: multiple definition of `EEPROMClass::EEPROMClass(unsigned int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:41: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::begin(unsigned int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:63: multiple definition of `EEPROMClass::begin(unsigned int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:101: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::read(int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:157: multiple definition of `EEPROMClass::read(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:128: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::write(int, unsigned char)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:168: multiple definition of `EEPROMClass::write(int, unsigned char)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:135: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::commit()':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:183: multiple definition of `EEPROMClass::commit()'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:141: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::end()':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:141: multiple definition of `EEPROMClass::end()'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:125: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::~EEPROMClass()':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:59: multiple definition of `EEPROMClass::~EEPROMClass()'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:46: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::~EEPROMClass()':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:59: multiple definition of `EEPROMClass::~EEPROMClass()'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:46: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::getDataPtr()':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:206: multiple definition of `EEPROMClass::getDataPtr()'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:145: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::length()':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:215: multiple definition of `EEPROMClass::length()'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:152: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readByte(int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:284: multiple definition of `EEPROMClass::readByte(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:160: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readChar(int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:290: multiple definition of `EEPROMClass::readChar(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:166: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readUChar(int)':
EEPROM.cpp:(.text._ZN11EEPROMClass9readUCharEi+0x0): multiple definition of `EEPROMClass::readUChar(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:ESP32_RTC_EEPROM.cpp:(.text._ZN11EEPROMClass9readUCharEi+0x0): first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readShort(int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:302: multiple definition of `EEPROMClass::readShort(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:178: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readUShort(int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:308: multiple definition of `EEPROMClass::readUShort(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:184: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readInt(int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:314: multiple definition of `EEPROMClass::readInt(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:190: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readUInt(int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:320: multiple definition of `EEPROMClass::readUInt(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:196: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readLong(int)':
EEPROM.cpp:(.text._ZN11EEPROMClass8readLongEi+0x0): multiple definition of `EEPROMClass::readLong(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:ESP32_RTC_EEPROM.cpp:(.text._ZN11EEPROMClass8readLongEi+0x0): first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readULong(int)':
EEPROM.cpp:(.text._ZN11EEPROMClass9readULongEi+0x0): multiple definition of `EEPROMClass::readULong(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:ESP32_RTC_EEPROM.cpp:(.text._ZN11EEPROMClass9readULongEi+0x0): first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readLong64(int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:338: multiple definition of `EEPROMClass::readLong64(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:214: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readULong64(int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:344: multiple definition of `EEPROMClass::readULong64(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:220: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readFloat(int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:350: multiple definition of `EEPROMClass::readFloat(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:226: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readDouble(int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:356: multiple definition of `EEPROMClass::readDouble(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:232: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readBool(int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:362: multiple definition of `EEPROMClass::readBool(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:238: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readString(int, char*, unsigned int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:368: multiple definition of `EEPROMClass::readString(int, char*, unsigned int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:244: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readString(int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:392: multiple definition of `EEPROMClass::readString(int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:268: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::readBytes(int, void*, unsigned int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:411: multiple definition of `EEPROMClass::readBytes(int, void*, unsigned int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:287: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeByte(int, unsigned char)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:435: multiple definition of `EEPROMClass::writeByte(int, unsigned char)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:311: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeChar(int, signed char)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:440: multiple definition of `EEPROMClass::writeChar(int, signed char)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:316: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeUChar(int, unsigned char)':
EEPROM.cpp:(.text._ZN11EEPROMClass10writeUCharEih+0x0): multiple definition of `EEPROMClass::writeUChar(int, unsigned char)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:ESP32_RTC_EEPROM.cpp:(.text._ZN11EEPROMClass10writeUCharEih+0x0): first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeShort(int, short)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:450: multiple definition of `EEPROMClass::writeShort(int, short)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:326: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeUShort(int, unsigned short)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:455: multiple definition of `EEPROMClass::writeUShort(int, unsigned short)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:331: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeInt(int, int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:460: multiple definition of `EEPROMClass::writeInt(int, int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:336: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeUInt(int, unsigned int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:465: multiple definition of `EEPROMClass::writeUInt(int, unsigned int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:341: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeLong(int, int)':
EEPROM.cpp:(.text._ZN11EEPROMClass9writeLongEii+0x0): multiple definition of `EEPROMClass::writeLong(int, int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:ESP32_RTC_EEPROM.cpp:(.text._ZN11EEPROMClass9writeLongEii+0x0): first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeULong(int, unsigned int)':
EEPROM.cpp:(.text._ZN11EEPROMClass10writeULongEij+0x0): multiple definition of `EEPROMClass::writeULong(int, unsigned int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:ESP32_RTC_EEPROM.cpp:(.text._ZN11EEPROMClass10writeULongEij+0x0): first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeLong64(int, long long)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:480: multiple definition of `EEPROMClass::writeLong64(int, long long)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:356: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeULong64(int, unsigned long long)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:485: multiple definition of `EEPROMClass::writeULong64(int, unsigned long long)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:361: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeFloat(int, float)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:490: multiple definition of `EEPROMClass::writeFloat(int, float)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:366: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeDouble(int, double)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:495: multiple definition of `EEPROMClass::writeDouble(int, double)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:371: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeBool(int, bool)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:500: multiple definition of `EEPROMClass::writeBool(int, bool)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:376: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeString(int, char const*)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:507: multiple definition of `EEPROMClass::writeString(int, char const*)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:383: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeString(int, String)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:528: multiple definition of `EEPROMClass::writeString(int, String)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:403: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o: in function `EEPROMClass::writeBytes(int, void const*, unsigned int)':
/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:533: multiple definition of `EEPROMClass::writeBytes(int, void const*, unsigned int)'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:408: first defined here
/home/xxx/.arduino15/packages/esp32/tools/xtensa-esp32s3-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32s3-elf/8.4.0/../../../../xtensa-esp32s3-elf/bin/ld: libraries/EEPROM/EEPROM.cpp.o:/home/xxx/.arduino15/packages/esp32/hardware/esp32/2.0.11/libraries/EEPROM/src/EEPROM.cpp:557: multiple definition of `EEPROM'; libraries/ESP32_RTC_EEPROM/ESP32_RTC_EEPROM.cpp.o:/home/xxx/Arduino/libraries/ESP32_RTC_EEPROM/src/ESP32_RTC_EEPROM.cpp:429: first defined here
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board ESP32S3 Dev Module.
ropg commented 7 months ago

Hard to tell without knowing what you're compiling. You are not also including the ESP32 EEPROM.h, are you? You can only include one of the two as they both offer the EEPROM instance, which is by design: this is to make existing code compatible.

mofm commented 7 months ago

Hi @ropg ,

First of all, thank you for your quick answer.

Yes, including only ESP32_RTC_EEPROM.

Sample Code:

#include <RadioLib.h>
#include <Wire.h>
#include <SPI.h>
#include <ESP32_RTC_EEPROM.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include "boards.h"

// The same network data that you used in the LoRaWAN_TTN example.
uint64_t joinEUI = 0x0000000000000000;
uint64_t devEUI =  0x0000000000000000;
uint8_t nwkKey[] = { 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--,   
                      0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x-- };
uint8_t appKey[] = { 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--,   
                      0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x--, 0x-- };

// Pause between sends in seconds, so this is every 30 minutes.
#define MINIMUM_DELAY 1800 

// Create a backup copy of the RTC RAM to flash every so many times
#define BACKUP_EVERY 100

// The LoRaWAN specification provides a port field (FPort) to distinguish
// between different types of messages on the receiving end. It's one byte, but
// FPort 0 is reserved for LoRaWAN-internal MAC messages, and values 224 through
// 255 (0xE0…0xFF) are reserved for future standardized application extensions,
// so don't use those.
#define FPORT 10

// create the node instance on the EU-868 band using the radio module and the
// encryption key make sure you are using the correct band based on your
// geographical location!
LoRaWANNode node(&radio, &EU868);

// for fixed bands with subband selection such as US915 and AU915, you must
// specify the subband that matches the Frequency Plan that you selected on your
// LoRaWAN console LoRaWANNode node(&radio, &US915, 2);

// Variables that are placed in RTC RAM survive deep sleep. This counter tells
// us how many times we've booted since the last reset or power loss.
RTC_DATA_ATTR int count = 1;

// This flag is set when we receive a downlink packet, so we can save to flash.
bool gotDownlink = false;

void helper_deep_sleep(int seconds = 0) {
  // It seems to make no sense to do a .begin() here, but in case the radio is
  // not interacted with at all before sleep, it will not respond to just
  // .sleep() and then consumes 800 µA more than it should in deep sleep.
  radio.begin();
  // 'false' here is to not have a warm start, we re-init the after sleep.
  radio.sleep(false);
  u8g2->sleepOn();
  SPI.end();
  SDSPI.end();
  pinMode(RADIO_CS_PIN, INPUT);
  pinMode(RADIO_RST_PIN, INPUT);
  pinMode(RADIO_DIO1_PIN, INPUT);
  pinMode(RADIO_BUSY_PIN, INPUT);
  pinMode(I2C_SDA, INPUT);
  pinMode(I2C_SCL, INPUT);
  pinMode(RADIO_SCLK_PIN, INPUT);
  pinMode(RADIO_MISO_PIN, INPUT);
  pinMode(RADIO_MOSI_PIN, INPUT);

  // Set timer wakeup if applicable
  if (seconds > 0) {
    esp_sleep_enable_timer_wakeup(seconds * 1000000);
  }
  // and off to bed we go
  esp_deep_sleep_start();
}

void setup() {
  initBoard();

  bme.begin();

  // initialize radio
  Serial.println("Radio init");
  RADIOLIB(radio.begin());
  if (_radiolib_status != RADIOLIB_ERR_NONE) {
    goToSleep();  // Does not return, program starts over next round
  }

  // Manages uplink intervals to the TTN Fair Use Policy
  node.setDutyCycle(true, 1250);

  // We tell the LoRaWAN code about our battery level in case the network
  // asks for battery-level and SNR with a MAC_DEV_STATUS message.
  // ( 0 for external power source, 1 for lowest battery, 254 for highest battery,
  // 255 for unable to measure.)
  uint8_t battLevel = 146;
  node.setDeviceStatus(battLevel);

  // Join the network, or resume previous saved session
  if (count == 1) {
    // If this is the first boot, we woke up with a wiped RTC RAM. We assume we
    // were rebooted, have lost RTC RAM (and thus the uplink packet counter
    // FCntUp) and need to join the network again with our keys and nonces saved
    // in flash.
    Serial.printf("Joining (forced)\n");
    RADIOLIB(node.beginOTAA(joinEUI, devEUI, nwkKey, appKey, RADIOLIB_LORAWAN_DATA_RATE_UNUSED, true));
  } else {
    // If we woke up with RTC RAM intact, continue with what we have.
    Serial.printf("Joining\n");
    RADIOLIB(node.beginOTAA(joinEUI, devEUI, nwkKey, appKey));
  }

  // Let's see what happened when we tried to join
  if (_radiolib_status != RADIOLIB_ERR_NONE && _radiolib_status != RADIOLIB_LORAWAN_MODE_OTAA) {
    Serial.printf("Join failed, trying again next time.");
    goToSleep();   // Does not return, program starts over next round
  }

  // If we're still here, it means we joined, and we can send something
  sendPacket();
  goToSleep();    // Does not return, program starts over next round
}

void loop() {

  // This is never called. There is no repetition: we always go back to deep
  // sleep one way or the other at the end of setup()

}

void sendPacket() {
  // 5-byte packet
  uint8_t packet[5] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF};

  // Reading temperature or humidity takes about 250 milliseconds!
  // Sensor readings may also be up to 2 seconds 'old' (it's a very slow sensor)
  float h = bme.readHumidity();
  // Read temperature as Celsius (the default)
  float t = bme.readTemperature();

  // Temperatue and Humidity
  if (isnan(h) || isnan(t)) {
    Serial.println("Failed to read from BME sensor!");
    // just leaves the 0xFFs in the packets
  } else {
    Serial.printf("Temperature %.2f°C, Relative humidity %.2f%%\n", t, h);
    packet[0] = int(t);
    packet[1] = int((float)(t - packet[0]) * 100);
    packet[2] = int(h);
    packet[3] = int((float)(h - packet[2]) * 100);
  }

  // Send the packet. If no RX_TIMEOUT, it may mean we got a downlink packet, so
  // we store to flash before going to sleep.
  if (node.sendReceive(packet, 5, FPORT) == RADIOLIB_ERR_NONE) {
    gotDownlink = true;
  }
}

void goToSleep() {

  // allows recall of the session after deepsleep
  node.saveSession();

  // If we woke up with wiped RTC RAM, or received a message, or we've
  // reached BACKUP_EVERY, we back it up to flash before going to sleep.
  if (count == 1 || gotDownlink == true || count % BACKUP_EVERY == 0) {
    Serial.println("RTC RAM -> flash.");
    EEPROM.toNVS();
  }

  // Raise the boot counter, kept in RTC RAM
  count++;

  // Calculate minimum duty cycle delay (per FUP & law!)
  uint32_t interval = node.timeUntilUplink();

  // And then pick it or our MINIMUM_DELAY, whichever is greater
  uint32_t delayMs = max(interval, (uint32_t)MINIMUM_DELAY * 1000);

  Serial.printf("Next TX in %i s\n", delayMs/1000);

  Serial.println("Deep sleep now");
  // Make sure this still prints before sleep
  delay(10);

  // And off to bed we go
  helper_deep_sleep((delayMs / 1000) - 5);

}