Time library problem?

Hi,
after spending a whole day trying to figure out the cause of my problem, I gave up and posted what follows:
I've a sketch that, in December, was perfectly OK. IDE 2 compiled it, with some minor warning, and downloaded to a D1 R2 Mini ESP8266 based mini module. It is a Thermometer + Hygrometer and NTP watch with a DHT22 sensor and an OLED display. It works fine, since then, in a small plexiglas cube on my desk.
The sketch is a merge of a few pieces I got from Randomnerds and Instructables, and that I've adjusted and polished to my needs. I'm not an absolute beginner but not an expert.
Yesterday I decided to build another one, with a few changes in mind, and loaded the sketch, without any modifications, and IDE now exits with error 1. Being the entire log quite long, here below I've pasted the linker output.
Now I'm looking for somebody to shed some light on this obscure error. Many thanks to the person that will help me to understand and to solve this annoying issue.
Thank you

Linking everything together...
/Users/fabriziobianchi/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I /Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/tools/mkdir.py -p /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/ld_h/
/Users/fabriziobianchi/Library/Arduino15/packages/esp8266/tools/python3/3.7.2-post1/python3 -I /Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/tools/cp.py /Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/tools/sdk/ld/eagle.flash.4m2m.ld /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/ld_h/local.eagle.flash.ld.h
/Users/fabriziobianchi/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/xtensa-lx106-elf-gcc -CC -E -P -DVTABLES_IN_FLASH -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/ld_h/local.eagle.flash.ld.h -o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/local.eagle.flash.ld
/Users/fabriziobianchi/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/xtensa-lx106-elf-gcc -CC -E -P -DVTABLES_IN_FLASH -DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 /Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/tools/sdk/ld/eagle.app.v6.common.ld.h -o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/local.eagle.app.v6.common.ld
/Users/fabriziobianchi/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/xtensa-lx106-elf-gcc -fno-exceptions -Wl,-Map -Wl,/private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/D1_ESP8266_Mini_DHT22_OLED_Clock_Rev2.ino.map -g @/Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/tools/warnings/more-gcc -Os -nostdlib -Wl,--no-check-sections -u app_entry -u _printf_float -u _scanf_float -Wl,-static -L/Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/tools/sdk/lib -L/Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/tools/sdk/lib/NONOSDK22x_190703 -L/private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44 -L/Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/tools/sdk/libc/xtensa-lx106-elf/lib -Tlocal.eagle.flash.ld -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read -o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/D1_ESP8266_Mini_DHT22_OLED_Clock_Rev2.ino.elf -Wl,--start-group /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/sketch/D1_ESP8266_Mini_DHT22_OLED_Clock_Rev2.ino.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESP8266WiFi/ESP8266WiFi.a /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESPAsyncTCP/AsyncPrinter.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESPAsyncTCP/ESPAsyncTCP.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESPAsyncTCP/ESPAsyncTCPbuffer.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESPAsyncTCP/SyncClient.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESPAsyncTCP/tcp_axtls.c.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESPAsyncWebServer/AsyncEventSource.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESPAsyncWebServer/AsyncWebSocket.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESPAsyncWebServer/SPIFFSEditor.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESPAsyncWebServer/WebAuthentication.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESPAsyncWebServer/WebHandlers.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESPAsyncWebServer/WebRequest.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESPAsyncWebServer/WebResponses.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/ESPAsyncWebServer/WebServer.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/Hash/Hash.a /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/NTPClient/NTPClient.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/DHT_sensor_library/DHT.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/DHT_sensor_library/DHT_U.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/Adafruit_GFX_Library/Adafruit_GFX.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/Adafruit_GFX_Library/Adafruit_GrayOLED.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/Adafruit_GFX_Library/Adafruit_SPITFT.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/Adafruit_GFX_Library/glcdfont.c.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/Adafruit_BusIO/Adafruit_BusIO_Register.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/Adafruit_BusIO/Adafruit_I2CDevice.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/Adafruit_BusIO/Adafruit_SPIDevice.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/Wire/Wire.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/SPI/SPI.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/Adafruit_SH110X/Adafruit_SH1106G.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/Adafruit_SH110X/Adafruit_SH1107.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/Adafruit_SH110X/Adafruit_SH110X.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/libraries/Adafruit_Unified_Sensor/Adafruit_Sensor.cpp.o /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/core/core.a -lhal -lphy -lpp -lnet80211 -llwip2-536-feat -lwpa -lcrypto -lmain -lwps -lbearssl -lespnow -lsmartconfig -lairkiss -lwpa2 -lstdc++ -lm -lc -lgcc -Wl,--end-group -L/private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44
/Users/fabriziobianchi/Library/Arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/3.1.0-gcc10.3-e5f9fec/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/core/core.a(time.cpp.o): in function `_Z12getLocalTimeP2tmj':
/Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/cores/esp8266/time.cpp:28: multiple definition of `_Z12getLocalTimeP2tmj'; /private/var/folders/jm/8ykp7mhd767fgdf5t617f21c0000gn/T/arduino-sketch-C0616E2E5E9747F18CFD6EFC37B6CA44/sketch/D1_ESP8266_Mini_DHT22_OLED_Clock_Rev2.ino.cpp.o:/Users/fabriziobianchi/Documents/Arduino/D1_ESP8266_Mini_DHT22_OLED_Clock_Rev2/D1_ESP8266_Mini_DHT22_OLED_Clock_Rev2.ino:118: first defined here
collect2: error: ld returned 1 exit status
Multiple libraries were found for "Hash.h"
  Used: /Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/libraries/Hash
  Not used: /Users/fabriziobianchi/Documents/Arduino/libraries/AsyncElegantOTA
Using library ESP8266WiFi at version 1.0 in folder: /Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/libraries/ESP8266WiFi 
Using library ESP AsyncTCP at version 1.2.2 in folder: /Users/fabriziobianchi/Documents/Arduino/libraries/ESPAsyncTCP 
Using library ESP Async WebServer at version 1.2.3 in folder: /Users/fabriziobianchi/Documents/Arduino/libraries/ESPAsyncWebServer 
Using library Hash at version 1.0 in folder: /Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/libraries/Hash 
Using library NTPClient at version 3.1.0 in folder: /Users/fabriziobianchi/Documents/Arduino/libraries/NTPClient 
Using library DHT sensor library at version 1.4.4 in folder: /Users/fabriziobianchi/Documents/Arduino/libraries/DHT_sensor_library 
Using library Adafruit GFX Library at version 1.11.5 in folder: /Users/fabriziobianchi/Documents/Arduino/libraries/Adafruit_GFX_Library 
Using library Adafruit BusIO at version 1.14.1 in folder: /Users/fabriziobianchi/Documents/Arduino/libraries/Adafruit_BusIO 
Using library Wire at version 1.0 in folder: /Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/libraries/Wire 
Using library SPI at version 1.0 in folder: /Users/fabriziobianchi/Library/Arduino15/packages/esp8266/hardware/esp8266/3.1.1/libraries/SPI 
Using library Adafruit SH110X at version 2.1.8 in folder: /Users/fabriziobianchi/Documents/Arduino/libraries/Adafruit_SH110X 
Using library Adafruit Unified Sensor at version 1.1.7 in folder: /Users/fabriziobianchi/Documents/Arduino/libraries/Adafruit_Unified_Sensor 
exit status 1

Compilation error: exit status 1
'''

This is the error. The name is defined in esp8266 core ( time.cpp ), and obviously you defined it again in your sketch D1_ESP8266_Mini_DHT22_OLED_Clock_Rev2.ino

Well... that was fast. Many thanks MicroBaher.
Actually I was looking for _Z12getLocalTimeP2tmj in the sketch and didn't find it.
However I found the definition of getLocalTime and commenting it it compiles and links without any problem.
Still remains to me a question: why before Xmas the same sketch compiled and linked with no errors and now, approx two months later and without any change it doesn't?
Could it be an update to a library that happened in that time interval?

It's hard to say, but an update could be a cause.

Well, tomorrow I'll load the compiled sketch on the protoboard with the D1 Mini, the DHT22 and with the OLED display and see se it's still working. I'll keep this post updated whatever will be the result (fingers crossed as I have a few things I want to add and I need it functional )
Many thanks again
Fabrizio

The day began almost in the right way!
Now the sketch works fine with just one glitch that, in the past, was just occasional but now it happens regularly. I forgot to mention that this little thermometer - hygrometer can also be interrogated from the web and should return a simple screen with temperature and humidity on any browser .
In the past, sometimes, accessing its web server caused a panic condition and the reset of the MCU.
Being purely casual and rare I didn't spend time to understand ( well above my knowledge and experience) the causes. I just increased the stack size and let it work peacefully. Having a display the web access was almost non necessary.
Today the MCU panics at any web access and here below is the output on the serial monitor
Possibly this post should be considered as solved and closed and I should open a new one
In case I will do.
Many thanks again to anybody willing to help me
Have a good day


User exception (panic/abort/assert)
--------------- CUT HERE FOR EXCEPTION DECODER ---------------

Panic core_esp8266_main.cpp:191 __yield

>>>stack>>>

ctx: sys
sp: 3fffeb30 end: 3fffffb0 offset: 0000
3fffeb30:  00000003 00000001 3fffed00 4020be57  
3fffeb40:  000000fe 00000000 00000000 00000000  
3fffeb50:  00000000 00000000 00000000 00000000  
.
.
the stack dump goes on for many lines and then it ends
.
.
3fffff90:  3ffeee54 7501a8c0 feefeffe 3ffef214  
3fffffa0:  3fffdad0 00000000 3ffef1e8 3ffef214  
<<<stack<<<

--------------- CUT HERE FOR EXCEPTION DECODER ---------------

 ets Jan  8 2013,rst cause:2, boot mode:(3,6)


load 0x4010f000, len 3424, room 16 
tail 0
chksum 0x2e
load 0x3fff20b8, len 40, room 8 
tail 0
chksum 0x2b
csum 0x2b
v000518e0
~ld
Connecting Wifi...

WiFi connected to
Vodafone-xyxyxyxyx
IP address:	 
192.168.1.117

Please keep all Questions regarding one project in one thread.

let's start with something simple:
for NTP on an ESP8266 you don't need any external library.
NTP is included in the ESP Core.
Don't use a 3rd party library for NTP on the ESP (ESP8266 and ESP32).

There is a demo sketch in the IDE.
This is a shorter version of the IDE Example:

https://werner.rothschopf.net/202011_arduino_esp8266_ntp_en.htm

Many thanks, I'll look into it. For the time being I'll close this post and, in case, open a new one on the subject.
What's weird is that, since a few hours, nothing changed, the "panic" doesn't happens anymore.
I wonder if there might be a link with the behaviour of the home WLAN.
Thanks again for the suggestion
Ciao
Fabrizio

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.