I am currently working on a project and i wanna display the curent time on an LCD. To achieve that i am taking part of Rui Santos code from this project: https://RandomNerdTutorials.com/esp32-date-time-ntp-client-server-arduino/
I get an error at this part of the code:
void printLocalTime(){
struct tm timeinfo;
if(!getLocalTime(&timeinfo)){
Serial.println("Failed to obtain time");
return;
}
}
And the error message i get above the timeinfo is : aggregate 'tm timeinfo' has incomplete type and cannot be defined
I saw on some thread that it might be the library that i’m using but since i dont download them and just use this:
lib_deps =
WiFi
ESP Async WebServer
Adafruit Unified Sensor
DHT sensor library
LiquidCrystal_I2C
NTPClient
Wire
Time
in the platformio.ini, i dont understand how i could modify its name? Or maybe I’m not using the right library? i tried #include <time.h>
, #include <Time.h>
, #include <TimeLib.h>
and none of them are working.