-->
Page 1 of 2

Timezone.h problem [SOLVED]

PostPosted: Mon Aug 17, 2015 1:56 pm
by katz
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;
  }
}

Re: Timezone.h problem

PostPosted: Mon Aug 17, 2015 2:19 pm
by martinayotte
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.

Re: Timezone.h problem

PostPosted: Tue Aug 18, 2015 2:58 pm
by katz
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.

Re: Timezone.h problem

PostPosted: Tue Aug 18, 2015 3:11 pm
by martinayotte
You can get it from there https://github.com/JChristensen/Timezone
Don't forget to comment eeprom stuff in this library too.