Reading Data From Device In Every 30 Minutes - Helped Home » Arduino Tmelements_t Tm Error » Reading Data From Device In Every 30 Minutes - Helped Maybe your like Arduino Tp4056 Tutorial Arduino Train Junior Arduino Train Junior Lite Arduino Tv Out Bitmap Arduino U4_t Reading Data from Device in every 30 minutes Community Help With My Project Helped shramik_salgaonkar June 15, 2018, 6:17pm 21 You get the entire timestamp. 1 Like harunsivasli June 16, 2018, 1:42pm 22 im having issues by implementing RTC module to arduino. Watchdog resets the module if i add RTC module to nodemcu, having following message on Serial monitor and cant find the solution wdt reset load 0x4010f000, len 1384, room 16 tail 8 chksum 0x2d csum 0x2d v614f7c32 ~ld EDIT: i was using pins 6-7-8 and it was causing reset ESP9266 changed pins to 2-3-4 but now cant get the true time from RTC it gives me output like Current Date / Time: 45/25/2165 45:85:85 Maybe because RTC needs 5v instead of 3.3v from Nodemcu ? shramik_salgaonkar June 16, 2018, 3:09pm 23 can you give a try with this code Arduino Playground - DS1302RTC 1 Like harunsivasli June 16, 2018, 3:39pm 24 I tried this code many times but i could not let the code work neither with arduino nor with Nodemcu Getting exceptions always with this library In file included from C:\Users\Harun\Documents\Arduino\libraries\DS1302RTC\examples\DS1302_Serial\DS1302_Serial.ino:17:0: C:\Users\Harun\Documents\Arduino\libraries\DS1302RTC/DS1302RTC.h:97:26: error: 'tmElements_t' has not been declared static uint8_t read(tmElements_t &tm); ^ C:\Users\Harun\Documents\Arduino\libraries\DS1302RTC/DS1302RTC.h:98:27: error: 'tmElements_t' has not been declared static uint8_t write(tmElements_t &tm); ^ C:\Users\Harun\Documents\Arduino\libraries\DS1302RTC\examples\DS1302_Serial\DS1302_Serial.ino: In function 'void loop()': DS1302_Serial:61: error: 'tmElements_t' was not declared in this scope tmElements_t tm; ^ DS1302_Serial:61: error: expected ';' before 'tm' tmElements_t tm; ^ DS1302_Serial:66: error: expected primary-expression before ')' token if (! RTC.read(tm)) { ^ DS1302_Serial:68: error: expected primary-expression before '.' token print2digits(tm.Hour); ^ DS1302_Serial:70: error: expected primary-expression before '.' token print2digits(tm.Minute); ^ DS1302_Serial:72: error: expected primary-expression before '.' token print2digits(tm.Second); ^ DS1302_Serial:74: error: expected primary-expression before '.' token Serial.print(tm.Day); ^ DS1302_Serial:76: error: expected primary-expression before '.' token Serial.print(tm.Month); ^ DS1302_Serial:78: error: expected primary-expression before '.' token Serial.print(tmYearToCalendar(tm.Year)); ^ DS1302_Serial:78: error: 'tmYearToCalendar' was not declared in this scope Serial.print(tmYearToCalendar(tm.Year)); ^ DS1302_Serial:80: error: expected primary-expression before '.' token Serial.print(tm.Wday); ^ exit status 1 'tmElements_t' was not declared in this scope shramik_salgaonkar June 16, 2018, 4:05pm 25 harunsivasli: Maybe because RTC needs 5v instead of 3.3v from Nodemcu ? try connecting RTC vcc to vin pin of Nodemcu. 1 Like harunsivasli June 16, 2018, 4:30pm 26 something weird with Nodemcu, it semes there are some pins device dont let you use, if you use it makes Wdt reset. For example i use pins 678 for RTC i get WDT reset. I use pins 123 RTC works but Blue light on ESP8266 runs continiueusly and the RTC gives wrong date- time Now testing all pins. going to be crazy… harunsivasli June 16, 2018, 5:57pm 27 i give up Trying RTC and started NTP somebody from community shared a code for getting time from NTP but i can not configure it for Nodemcu ESP8266 Timestamped data Bring Your Own Thing (MQTT) You can send your own time with extra virtualwrite’s. Just note the time when you read your sensor, and the delay in internet travel and the variance in delay are avoided. Conceivably they could add a “time” field, just like a “unit” field, which would be better. Here is some code (arduino code for 8266) // ~~~~~ declarations ~~~~~ #include <time.h> int timezone = -6; // -6 for daylight savings, -7 regular mountain struct tm * timeinfo; time_t boottime; time_t now; // ~~~~~ setup ~~… harunsivasli June 16, 2018, 8:31pm 28 im closed with this code using time library. #include <ESP8266WiFi.h> #include <time.h> const char* ssid = “xxx”; const char* password = “xxx”; int timezone = 3; int dst = 0; void setup() { Serial.begin(115200); Serial.setDebugOutput(true); WiFi.mode(WIFI_STA); WiFi.begin(ssid, password); Serial.println(“\nConnecting to WiFi”); while (WiFi.status() != WL_CONNECTED) { Serial.print(“.”); delay(1000); } configTime(timezone * 3600, dst * 0, “pool.ntp.org”, “time.nist.gov”); Serial.println(“\nWaiting for time”); while (!time(nullptr)) { Serial.print(“.”); delay(1000); } Serial.println(“”); } void loop() { time_t now = time(nullptr); Serial.println(ctime(&now)); delay(1000); } but it gives output like Sat Jun 16 23:27:57 2018 i just need to parse it like Hour - minute on github page it tells how there are avalible functions for it but i could not find out how to use it GitHub - PaulStoffregen/Time: Time library for Arduino Time library for Arduino. Contribute to PaulStoffregen/Time development by creating an account on GitHub. Here are the functions i need from readme.md time_t t = now(); // store the current time in time variable t hour(t); // returns the hour for the given time t minute(t); // returns the minute for the given time t second(t); // returns the second for the given time t day(t); // the day for the given time t weekday(t); // day of the week for the given time t month(t); // the month for the given time t year(t); // the year for the given time t void loop() { time_t now; struct tm * timeinfo; time(&now); timeinfo = localtime(&now); Serial.println(timeinfo->tm_hour); delay(1000); } i could parse just hour with this code but i dont know if i can send "timeinfo->tm_hour " like that Cayenne.virtualWrite(2,timeinfo->tm_hour , “Time”, “HHMM.SS”); like that adam June 20, 2018, 4:02pm 29 It looks like you got it working, but I’m not sure. Should I mark your thread as helped? harunsivasli June 20, 2018, 6:17pm 30 it does not work exactly how i want but its ok. you can mark as helped. thank you 1 Like ← previous page Related topics Topic Replies Views Activity Device goes offline- Bugs / Issues 19 2842 June 22, 2018 Dht22 / cayenne Helped 72 4343 May 24, 2018 DS1302 Setup Community Help With My Project 31 2601 July 24, 2020 Adding a New Device using MQTT The Library 58 10794 July 19, 2020 Temperature measurement Helped 115 4838 May 20, 2019 Cayenne Community Home Projects Docs Supported Hardware ☰ Home Projects Docs Supported Hardware Tag » Arduino Tmelements_t Tm Error DS1307RTC TmElements_t Tm Errors - Arduino Forum TmElements_t Has Not Been Declared · Issue #122 · Esp8266/Arduino TmElements_t Has Not Been Declared · Issue #10 - GitHub 'tmElements_t' Does Not Name A Type - Arduino Stack Exchange Arduino: Osepp DS1307 RTC Program Error (tmElements_t Tm TimeLib & DS1307RTC - Savvy Solutions DS1307RTC Library, For Accessing Real Time Clock (RTC) Chips Arduino DS3232RTC Library V1.0 — Sming Documentation How To Do Daily Tasks With Arduino - Random Nerd Tutorials Using A Real Time Clock With Arduino | DroneBot Workshop Settime Real Time Clock Module DS1307 - ArduinoAll Module Mạch Thời Gian Thực RTC DS1307 | Shopee Việt Nam Wierd Errors With Arduino 1.6.9 And ESP2866 Platform