I need to add RTC clock support into my ESP8266 module. I found plugin here https://github.com/letscontrolit/ESPEas ... DS1307.ino.
1.Downloaded mega-20210503 source code from here https://github.com/letscontrolit/ESPEasy/releases
2.Followed these instructions to compile source code via Arduino IDE https://www.letscontrolit.com/wiki/inde ... are_Upload
*Esp core 2.3.0 doesn't worked so I tryed 2.5.2 , 2.7.4 and 3.0.1 versions
And all compiled and work fine.
After that I added _P156_DS1307.ino to the ESPEasy.ino containing folder.
*Uncomment string in the ESPEasy-Globals.h
Code: Select all
//build all plugins that are in test stadium
#define PLUGIN_BUILD_TESTING
-In the _P156_DS1307.ino changed
Code: Select all
Device[deviceCount].VType = SENSOR_TYPE_DUAL;
Code: Select all
Device[deviceCount].VType = Sensor_VType::SENSOR_TYPE_DUAL;
Code: Select all
Arduino: 1.6.12 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new aborts on oom), Disabled, All SSL ciphers (most compatible), 32KB cache + 32KB IRAM (balanced), Use pgm_read macros for IRAM/PROGMEM, 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
WARNING: Category 'LED' in library CHT16K33 LED Matrix Library is not valid. Setting to 'Uncategorized'
WARNING: Category 'Input' in library MechInputs is not valid. Setting to 'Uncategorized'
WARNING: Category 'Input' in library SerialSensors is not valid. Setting to 'Uncategorized'
WARNING: Category 'Network' in library lwIP_PPP is not valid. Setting to 'Uncategorized'
WARNING: Category 'Network' in library lwIP_enc28j60 is not valid. Setting to 'Uncategorized'
WARNING: Category 'Network' in library lwIP_w5500 is not valid. Setting to 'Uncategorized'
WARNING: Category 'Network' in library lwIP_w5500 is not valid. Setting to 'Uncategorized'
WARNING: library LiquidCrystal_I2C claims to run on [avr] architecture(s) and may be incompatible with your current board which runs on [esp8266] architecture(s).
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino: In function 'boolean Plugin_156(byte, EventStruct*, String&)':
_P156_DS1307:105: error: 'year' was not declared in this scope
105 | if ( (loctime > 0) && (year(loctime) > 2000) && (year(loctime) < 3000) ) {
| ^~~~
_P156_DS1307:152: error: expected unqualified-id before '.' token
152 | tm.Year = 48;
| ^
_P156_DS1307:153: error: expected unqualified-id before '.' token
153 | } else { tm.Year = year-1970;}
| ^
_P156_DS1307:154: error: expected unqualified-id before '.' token
154 | tm.Month = smonth.toInt();
| ^
_P156_DS1307:155: error: expected primary-expression before '.' token
155 | if ((tm.Month < 1) || (tm.Month > 12)) {
| ^
_P156_DS1307:155: error: expected primary-expression before '.' token
155 | if ((tm.Month < 1) || (tm.Month > 12)) {
| ^
_P156_DS1307:156: error: expected unqualified-id before '.' token
156 | tm.Month = 1;
| ^
_P156_DS1307:158: error: expected unqualified-id before '.' token
158 | tm.Day = sday.toInt();
| ^
_P156_DS1307:159: error: expected primary-expression before '.' token
159 | if ((tm.Day < 1) || (tm.Day > 31)) {
| ^
_P156_DS1307:159: error: expected primary-expression before '.' token
159 | if ((tm.Day < 1) || (tm.Day > 31)) {
| ^
_P156_DS1307:160: error: expected unqualified-id before '.' token
160 | tm.Day = 1;
| ^
_P156_DS1307:162: error: expected unqualified-id before '.' token
162 | tm.Hour = shour.toInt();
| ^
_P156_DS1307:163: error: expected primary-expression before '.' token
163 | if ((tm.Hour < 0) || (tm.Hour > 23)) {
| ^
_P156_DS1307:163: error: expected primary-expression before '.' token
163 | if ((tm.Hour < 0) || (tm.Hour > 23)) {
| ^
_P156_DS1307:164: error: expected unqualified-id before '.' token
164 | tm.Hour = 0;
| ^
_P156_DS1307:166: error: expected unqualified-id before '.' token
166 | tm.Minute = sminute.toInt();
| ^
_P156_DS1307:167: error: expected primary-expression before '.' token
167 | if ((tm.Minute < 0) || (tm.Minute > 59)) {
| ^
_P156_DS1307:167: error: expected primary-expression before '.' token
167 | if ((tm.Minute < 0) || (tm.Minute > 59)) {
| ^
_P156_DS1307:168: error: expected unqualified-id before '.' token
168 | tm.Minute = 0;
| ^
_P156_DS1307:170: error: expected unqualified-id before '.' token
170 | tm.Second = ssecond.toInt();
| ^
_P156_DS1307:171: error: expected primary-expression before '.' token
171 | if ((tm.Second < 0) || (tm.Second > 59)) {
| ^
_P156_DS1307:171: error: expected primary-expression before '.' token
171 | if ((tm.Second < 0) || (tm.Second > 59)) {
| ^
_P156_DS1307:172: error: expected unqualified-id before '.' token
172 | tm.Second = 0;
| ^
_P156_DS1307:174: error: expected primary-expression before ')' token
174 | DS1307_set(tm);
| ^
_P156_DS1307:175: error: 'nextSyncTime' was not declared in this scope
175 | nextSyncTime = 0;
| ^~~~~~~~~~~~
_P156_DS1307:178: error: cannot convert 'EventValueSource::Enum' to 'EventStruct*'
178 | SendStatus(event->Source, command);
| ~~~~~~~^~~~~~
| |
| EventValueSource::Enum
In file included from sketch\_Plugin_Helper.h:16,
from C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\ESPEasy.ino:104:
sketch\src/ESPEasyCore/Controller.h:57:37: note: initializing argument 1 of 'void SendStatus(EventStruct*, const String&)'
57 | void SendStatus(struct EventStruct *event, const String& status);
| ~~~~~~~~~~~~~~~~~~~~^~~~~
_P156_DS1307:197: error: 'nextSyncTime' was not declared in this scope
197 | nextSyncTime = 0;
| ^~~~~~~~~~~~
_P156_DS1307:203: error: cannot convert 'EventValueSource::Enum' to 'EventStruct*'
203 | SendStatus(event->Source, command);
| ~~~~~~~^~~~~~
| |
| EventValueSource::Enum
In file included from sketch\_Plugin_Helper.h:16,
from C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\ESPEasy.ino:104:
sketch\src/ESPEasyCore/Controller.h:57:37: note: initializing argument 1 of 'void SendStatus(EventStruct*, const String&)'
57 | void SendStatus(struct EventStruct *event, const String& status);
| ~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino: In function 'long unsigned int plugin_156_rtcnow()':
_P156_DS1307:233: error: 'prevMillis' was not declared in this scope
233 | const long msec_passed = timePassedSince(prevMillis);
| ^~~~~~~~~~
_P156_DS1307:235: error: 'sysTime' was not declared in this scope
235 | sysTime += seconds_passed;
| ^~~~~~~
_P156_DS1307:237: error: 'nextSyncTime' was not declared in this scope
237 | if (nextSyncTime <= sysTime) {
| ^~~~~~~~~~~~
_P156_DS1307:242: error: 'setTime' was not declared in this scope; did you mean 'setitimer'?
242 | setTime(t);
| ^~~~~~~
| setitimer
_P156_DS1307:247: error: expected primary-expression before ')' token
247 | breakTime(sysTime, tm);
| ^
_P156_DS1307:247: error: 'breakTime' was not declared in this scope
247 | breakTime(sysTime, tm);
| ^~~~~~~~~
_P156_DS1307:249: error: 'calcSunRiseAndSet' was not declared in this scope
249 | calcSunRiseAndSet();
| ^~~~~~~~~~~~~~~~~
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino: In function 'long unsigned int plugin_156_getRtcTime()':
_P156_DS1307:260: error: expected primary-expression before ')' token
260 | DS1307_get(tm);
| ^
_P156_DS1307:261: error: expected unqualified-id before '.' token
261 | if (tm.Year < 31) { // rtc read error?
| ^
_P156_DS1307:262: error: 'nextSyncTime' was not declared in this scope
262 | nextSyncTime = sysTime + 60;
| ^~~~~~~~~~~~
_P156_DS1307:262: error: 'sysTime' was not declared in this scope
262 | nextSyncTime = sysTime + 60;
| ^~~~~~~
_P156_DS1307:265: error: expected primary-expression before '.' token
265 | logs += (tm.Year+1970);
| ^
_P156_DS1307:267: error: expected primary-expression before '.' token
267 | logs += tm.Month;
| ^
_P156_DS1307:269: error: expected primary-expression before '.' token
269 | logs += tm.Day;
| ^
_P156_DS1307:271: error: expected primary-expression before '.' token
271 | logs += tm.Hour;
| ^
_P156_DS1307:273: error: expected primary-expression before '.' token
273 | logs += tm.Minute;
| ^
_P156_DS1307:275: error: expected primary-expression before '.' token
275 | logs += tm.Second;
| ^
_P156_DS1307:277: error: expected primary-expression before ')' token
277 | return makeTime(tm); // return unix time
| ^
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino: In function 'void plugin_156_rtccheckTime()':
_P156_DS1307:285: error: 'rtcnow' was not declared in this scope
285 | rtcnow();
| ^~~~~~
_P156_DS1307:286: error: expected unqualified-id before '.' token
286 | if (tm.Minute != PrevMinutes)
| ^
_P156_DS1307:289: error: 'PrevMinutes' was not declared in this scope
289 | PrevMinutes = tm.Minute;
| ^~~~~~~~~~~
_P156_DS1307:289: error: expected primary-expression before '.' token
289 | PrevMinutes = tm.Minute;
| ^
_P156_DS1307:295: error: 'weekday_str' was not declared in this scope
295 | event += weekday_str();
| ^~~~~~~~~~~
_P156_DS1307:297: error: 'hour' was not declared in this scope
297 | if (hour() < 10)
| ^~~~
_P156_DS1307:299: error: 'hour' was not declared in this scope
299 | event += hour();
| ^~~~
_P156_DS1307:301: error: 'minute' was not declared in this scope; did you mean 'finite'?
301 | if (minute() < 10)
| ^~~~~~
| finite
_P156_DS1307:303: error: 'minute' was not declared in this scope; did you mean 'finite'?
303 | event += minute();
| ^~~~~~
| finite
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino: In function 'void plugin_156_do_ntpsync()':
_P156_DS1307:313: error: 'nextSyncTime' was not declared in this scope
313 | nextSyncTime = 0;
| ^~~~~~~~~~~~
_P156_DS1307:315: error: 'getNtpTime' was not declared in this scope
315 | unsigned long t = getNtpTime(); // get time from ntp if available
| ^~~~~~~~~~
_P156_DS1307:318: error: 'toLocal' was not declared in this scope
318 | breakTime(toLocal(t), tm); // timezone is a major headache...
| ^~~~~~~
_P156_DS1307:318: error: expected primary-expression before ')' token
318 | breakTime(toLocal(t), tm); // timezone is a major headache...
| ^
_P156_DS1307:318: error: 'breakTime' was not declared in this scope
318 | breakTime(toLocal(t), tm); // timezone is a major headache...
| ^~~~~~~~~
_P156_DS1307:320: error: expected primary-expression before '.' token
320 | logs += (tm.Year+1970);
| ^
_P156_DS1307:322: error: expected primary-expression before '.' token
322 | logs += tm.Month;
| ^
_P156_DS1307:324: error: expected primary-expression before '.' token
324 | logs += tm.Day;
| ^
_P156_DS1307:326: error: expected primary-expression before '.' token
326 | logs += tm.Hour;
| ^
_P156_DS1307:328: error: expected primary-expression before '.' token
328 | logs += tm.Minute;
| ^
_P156_DS1307:330: error: expected primary-expression before '.' token
330 | logs += tm.Second;
| ^
_P156_DS1307:332: error: expected unqualified-id before '.' token
332 | if (tm.Year > 47) { // if time seems valid update RTC
| ^
_P156_DS1307:333: error: expected primary-expression before ')' token
333 | DS1307_set(tm);
| ^
_P156_DS1307:335: error: 'getUnixTime' was not declared in this scope
335 | logs += String(getUnixTime());
| ^~~~~~~~~~~
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino: In function 'long unsigned int plugin_156_initialize()':
_P156_DS1307:354: error: 'nextSyncTime' was not declared in this scope
354 | nextSyncTime = 0;
| ^~~~~~~~~~~~
_P156_DS1307:355: error: 'syncInterval' was not declared in this scope
355 | syncInterval = 1800;
| ^~~~~~~~~~~~
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino: In function 'bool DS1307_get(timeStruct&)':
_P156_DS1307:372: error: invalid use of incomplete type 'struct timeStruct'
372 | tml.Second = bcd2bin(sec & 0x7f);
| ^~~
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino:360:24: note: forward declaration of 'struct timeStruct'
360 | bool DS1307_get(struct timeStruct &tml)
| ^~~~~~~~~~
_P156_DS1307:373: error: invalid use of incomplete type 'struct timeStruct'
373 | tml.Minute = bcd2bin(Wire.read() );
| ^~~
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino:360:24: note: forward declaration of 'struct timeStruct'
360 | bool DS1307_get(struct timeStruct &tml)
| ^~~~~~~~~~
_P156_DS1307:374: error: invalid use of incomplete type 'struct timeStruct'
374 | tml.Hour = bcd2bin(Wire.read() & 0x3f);
| ^~~
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino:360:24: note: forward declaration of 'struct timeStruct'
360 | bool DS1307_get(struct timeStruct &tml)
| ^~~~~~~~~~
_P156_DS1307:375: error: invalid use of incomplete type 'struct timeStruct'
375 | tml.Wday = bcd2bin(Wire.read() );
| ^~~
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino:360:24: note: forward declaration of 'struct timeStruct'
360 | bool DS1307_get(struct timeStruct &tml)
| ^~~~~~~~~~
_P156_DS1307:376: error: invalid use of incomplete type 'struct timeStruct'
376 | tml.Day = bcd2bin(Wire.read() );
| ^~~
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino:360:24: note: forward declaration of 'struct timeStruct'
360 | bool DS1307_get(struct timeStruct &tml)
| ^~~~~~~~~~
_P156_DS1307:377: error: invalid use of incomplete type 'struct timeStruct'
377 | tml.Month = bcd2bin(Wire.read() );
| ^~~
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino:360:24: note: forward declaration of 'struct timeStruct'
360 | bool DS1307_get(struct timeStruct &tml)
| ^~~~~~~~~~
_P156_DS1307:378: error: invalid use of incomplete type 'struct timeStruct'
378 | tml.Year = ((bcd2bin(Wire.read()))+30);
| ^~~
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino:360:24: note: forward declaration of 'struct timeStruct'
360 | bool DS1307_get(struct timeStruct &tml)
| ^~~~~~~~~~
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino: At global scope:
_P156_DS1307:385: error: 'tml' has incomplete type
385 | bool DS1307_set(timeStruct tml)
| ~~~~~~~~~~~^~~
C:\Users\ToughCookie\Downloads\ESPEasy-mega-20210503\ESPEasy-mega-20210503\ESPEasy\_P156_DS1307.ino:360:24: note: forward declaration of 'struct timeStruct'
360 | bool DS1307_get(struct timeStruct &tml)
| ^~~~~~~~~~
Multiple libraries were found for "Servo.h"
Used: C:\Users\ToughCookie\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\3.0.1\libraries\Servo
Not used: C:\Users\ToughCookie\Downloads\arduino-1.6.12-windows\arduino-1.6.12P230\libraries\ServoESP32
Not used: C:\Users\ToughCookie\Downloads\arduino-1.6.12-windows\arduino-1.6.12P230\libraries\Servo
exit status 1
'year' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.