Hi all I'm trying to get the tutorial 'Wifi RTC' to run and I am running into compilation errors. I've literally copy/pasted the tutorial code into the sketch changing only ssid, password, and time zone.
I've done quite a bit of searching but nothing seems to solve anything.
The errors are below:
Arduino: 1.6.10 (Windows 7), Board: "Arduino/Genuino MKR1000"
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp: In member function 'uint32_t RTCZero::getEpoch()':
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:365:13: error: aggregate 'RTCZero::getEpoch()::tm tm' has incomplete type and cannot be defined
struct tm tm;
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:377:20: error: 'mktime' was not declared in this scope
return mktime(&tm);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp: In member function 'void RTCZero::setAlarmEpoch(uint32_t)':
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:393:31: error: 'gmtime' was not declared in this scope
struct tm* tmp = gmtime(&t);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:395:21: error: invalid use of incomplete type 'struct RTCZero::setAlarmEpoch(uint32_t)::tm'
setAlarmDate(tmp->tm_year - EPOCH_TIME_YEAR_OFF, tmp->tm_mon + 1, tmp->tm_mday);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:393:12: error: forward declaration of 'struct RTCZero::setAlarmEpoch(uint32_t)::tm'
struct tm* tmp = gmtime(&t);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:395:57: error: invalid use of incomplete type 'struct RTCZero::setAlarmEpoch(uint32_t)::tm'
setAlarmDate(tmp->tm_year - EPOCH_TIME_YEAR_OFF, tmp->tm_mon + 1, tmp->tm_mday);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:393:12: error: forward declaration of 'struct RTCZero::setAlarmEpoch(uint32_t)::tm'
struct tm* tmp = gmtime(&t);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:395:74: error: invalid use of incomplete type 'struct RTCZero::setAlarmEpoch(uint32_t)::tm'
setAlarmDate(tmp->tm_year - EPOCH_TIME_YEAR_OFF, tmp->tm_mon + 1, tmp->tm_mday);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:393:12: error: forward declaration of 'struct RTCZero::setAlarmEpoch(uint32_t)::tm'
struct tm* tmp = gmtime(&t);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:396:21: error: invalid use of incomplete type 'struct RTCZero::setAlarmEpoch(uint32_t)::tm'
setAlarmTime(tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:393:12: error: forward declaration of 'struct RTCZero::setAlarmEpoch(uint32_t)::tm'
struct tm* tmp = gmtime(&t);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:396:35: error: invalid use of incomplete type 'struct RTCZero::setAlarmEpoch(uint32_t)::tm'
setAlarmTime(tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:393:12: error: forward declaration of 'struct RTCZero::setAlarmEpoch(uint32_t)::tm'
struct tm* tmp = gmtime(&t);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:396:48: error: invalid use of incomplete type 'struct RTCZero::setAlarmEpoch(uint32_t)::tm'
setAlarmTime(tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:393:12: error: forward declaration of 'struct RTCZero::setAlarmEpoch(uint32_t)::tm'
struct tm* tmp = gmtime(&t);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp: In member function 'void RTCZero::setEpoch(uint32_t)':
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:408:31: error: 'gmtime' was not declared in this scope
struct tm* tmp = gmtime(&t);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:410:36: error: invalid use of incomplete type 'struct RTCZero::setEpoch(uint32_t)::tm'
RTC->MODE2.CLOCK.bit.YEAR = tmp->tm_year - EPOCH_TIME_YEAR_OFF;
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:408:12: error: forward declaration of 'struct RTCZero::setEpoch(uint32_t)::tm'
struct tm* tmp = gmtime(&t);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:411:37: error: invalid use of incomplete type 'struct RTCZero::setEpoch(uint32_t)::tm'
RTC->MODE2.CLOCK.bit.MONTH = tmp->tm_mon + 1;
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:408:12: error: forward declaration of 'struct RTCZero::setEpoch(uint32_t)::tm'
struct tm* tmp = gmtime(&t);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:412:35: error: invalid use of incomplete type 'struct RTCZero::setEpoch(uint32_t)::tm'
RTC->MODE2.CLOCK.bit.DAY = tmp->tm_mday;
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:408:12: error: forward declaration of 'struct RTCZero::setEpoch(uint32_t)::tm'
struct tm* tmp = gmtime(&t);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:413:36: error: invalid use of incomplete type 'struct RTCZero::setEpoch(uint32_t)::tm'
RTC->MODE2.CLOCK.bit.HOUR = tmp->tm_hour;
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:408:12: error: forward declaration of 'struct RTCZero::setEpoch(uint32_t)::tm'
struct tm* tmp = gmtime(&t);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:414:38: error: invalid use of incomplete type 'struct RTCZero::setEpoch(uint32_t)::tm'
RTC->MODE2.CLOCK.bit.MINUTE = tmp->tm_min;
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:408:12: error: forward declaration of 'struct RTCZero::setEpoch(uint32_t)::tm'
struct tm* tmp = gmtime(&t);
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:415:38: error: invalid use of incomplete type 'struct RTCZero::setEpoch(uint32_t)::tm'
RTC->MODE2.CLOCK.bit.SECOND = tmp->tm_sec;
^
F:\Arduino\libraries\RTCZero\src\RTCZero.cpp:408:12: error: forward declaration of 'struct RTCZero::setEpoch(uint32_t)::tm'
struct tm* tmp = gmtime(&t);
^
exit status 1
Error compiling for board Arduino/Genuino MKR1000.
There must be something simple?