Post topics, source code that relate to the Arduino Platform

User avatar
By katz
#26283 Hi all,

In my ESP8266, I am trying to get Daylight-Savings-Time (DST) to work with the Time.h library. Below is a short clip of code that works just fine. But when I un-comment the second line and '#include <Timezone.h>' then it will no longer compile. I get this error message: 'fatal error: avr/eeprom.h: No such file or directory #include <avr/eeprom.h>'

How do I get rid of the error and get the code to run so that I can use the Timezone methods??

Regards, Peter.

Code: Select all#include <Time.h>
//#include <Timezone.h>

unsigned long wait=0UL;

void setup(){
  Serial.begin(115200);
  Serial.println("\nTime Example");
  setTime(23,55,0,8,8,2015); //   setTime(hh,mm,ss,dd,mm,yyyy)
}

void loop(){
  if(millis()>wait){
      Serial.print((String)day()+"-"+(String)month()+"-"+(String)year()+" ");
      Serial.println((String)hour()+":"+(String)minute()+":"+(String)second());
      wait=millis()+1000UL;
  }
}
Last edited by katz on Fri Aug 21, 2015 4:00 am, edited 1 time in total.
User avatar
By martinayotte
#26286 Is seems that Timezone library has not been ported yet to be compatible with ESP EEPROM library.
If you don't need to persist any thing in EEPROM, you can simply comment out all the EEPROM related code.
User avatar
By katz
#26402 Ah ... you are right. ESP-EEPROM is still under development.

Indeed, I don't particularly need any EEPROM-calls but I cannot find the Timezone.h file. Do you know where/how the Arduino IDE installs it? I used the 'Manage libraries ...' option to install Timezone.h.

Regards, Peter.