[SOLVED] RTC Widget has appeared in today's Android update

Noticed the RTC widget has appeared in today’s Android update.

I have time library but the RTC example will not compile. Has the RTC widget been released?

Errors are:

In file included from C:\Users\Public\NewArduinoSketchesAndLibraries\RTCexample\RTCexample.ino:40:0:

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/WidgetRTC.h: In member function 'void WidgetRTC::setVPin(int)':

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/WidgetRTC.h:35:36: error: 'setSyncProvider' was not declared in this scope

     setSyncProvider(requestTimeSync);

                                    ^

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/WidgetRTC.h: In member function 'void WidgetRTC::onWrite(BlynkReq&, const BlynkParam&)':

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/WidgetRTC.h:52:26: error: 'setTime' was not declared in this scope

         setTime(blynkTime);             // Sync Time library clock to the value received from Blynk

Google Play indicates we can now delete historical data from the graphs, how is this done as I couldn’t see any way to do it?

I’ve got answer for your second question, just slide from right to left on the Graph, a message “Clear history” will appear.
Regards

I was just playing with it a few minutes ago

1 Like

Thanks @psoro that’s cool. I’m liking the new coloured messages (red for clear history and yellow for reconnecting to the server etc).

I’m not so sure about the 1980’s computer style green on black widget graphics. Not a problem for the widgets but even the new user interface buttons are green on black (or whatever colour you allocated to the button).

1 Like

@Costas please use latest Blynk library 0.3.3. Your Blynk library seems outdated.

@Dmitriy I guess that means RTC has been released.

I downloaded 0.3.3 earlier today. Initially I just copied the RTC cpp and h files to my working system. Then all of 0.3.3 but still failing to compile. I will remove all the Blynk and try again.

Yes. RTC has been released. I just checked it locally - code compiles, so probably something with your setup.

Has anyone used RTC widget with Blynk cloud server?

I tried with the latest 0.3.3 version of Blynk but still no joy. Previously I was using 0.3.3 beta but I have tried to remove all traces of it.

Does your code compiles? Or widget doesn’t work?

Still not compiling @Dmitriy.

@Costas same error? What IDE? @vshymanskyy suggestions?

1.6.7 IDE, Generic ESP standalone. I have tried shuffling the functions to cover the strange behaviour introduced from IDE 1.6.6 onwards.

With this RTC example sketch:

/**************************************************************
 * Blynk is a platform with iOS and Android apps to control
 * Arduino, Raspberry Pi and the likes over the Internet.
 * You can easily build graphic interfaces for all your
 * projects by simply dragging and dropping widgets.
 *
 *   Downloads, docs, tutorials: http://www.blynk.cc
 *   Blynk community:            http://community.blynk.cc
 *   Social networks:            http://www.fb.com/blynkapp
 *                               http://twitter.com/blynk_app
 *
 * Blynk library is licensed under MIT license
 * This example code is in public domain.
 *
 **************************************************************
 * Blynk can provide your device with time data, like an RTC.
 * Please note that the accuracy of this method is up to several seconds.
 *
 * App dashboard setup:
 *   RTC widget on V5
 *
 * WARNING :
 * For this example you'll need SimpleTimer library:
 *   https://github.com/jfturcot/SimpleTimer
 *
 * And also this Time keeping library:
 *   https://github.com/PaulStoffregen/Time
 *
 * This code is based on an example from the Time library:
 *   https://github.com/PaulStoffregen/Time/blob/master/examples/TimeSerial/TimeSerial.ino
 *
 **************************************************************/

#define BLYNK_PRINT Serial    // Comment this out to disable prints and save space
#include <SPI.h>
#include <Ethernet.h>
#include <BlynkSimpleEthernet.h>
#include <SimpleTimer.h>
#include <Time.h>
#include <WidgetRTC.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";

SimpleTimer timer;

WidgetRTC rtc;

BLYNK_ATTACH_WIDGET(rtc, V5)

void setup()
{
  Serial.begin(9600); // See the connection status in Serial Monitor
  Blynk.begin(auth);

  while (Blynk.connect() == false) {
    // Wait until connected
  }

  // Display digital clock every 10 seconds
  timer.setInterval(10000L, clockDisplay);
}

// Digital clock display of the time
void clockDisplay()
{
  // You can call hour(), minute(), ... at any time
  // Please see Time library examples for details
  BLYNK_LOG("Current time: %02d:%02d:%02d %02d %02d %d",
            hour(), minute(), second(),
            day(), month(), year());
}

void loop()
{
  Blynk.run();
  timer.run();
}

I get the following error which indicates Time.h is not being picked up. When I run Time examples that uses TimeLib.h the serial time compiles ok.

In file included from C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk\examples\Widgets\RTC\RTC.ino:40:0:

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/WidgetRTC.h: In member function 'void WidgetRTC::setVPin(int)':

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/WidgetRTC.h:35:36: error: 'setSyncProvider' was not declared in this scope

     setSyncProvider(requestTimeSync);

                                    ^

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/WidgetRTC.h: In member function 'void WidgetRTC::onWrite(BlynkReq&, const BlynkParam&)':

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/WidgetRTC.h:52:26: error: 'setTime' was not declared in this scope

         setTime(blynkTime);             // Sync Time library clock to the value received from Blynk

                          ^

In file included from C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/Blynk/BlynkApi.h:15:0,

                 from C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/BlynkApiArduino.h:14,

                 from C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/Adapters/BlynkEthernet.h:18,

                 from C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/BlynkSimpleEthernet.h:20,

                 from C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk\examples\Widgets\RTC\RTC.ino:37:

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk\examples\Widgets\RTC\RTC.ino: In function 'void clockDisplay()':

RTC:71: error: 'hour' was not declared in this scope

             hour(), minute(), second(),

                  ^

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/Blynk/BlynkDebug.h:89:73: note: in definition of macro 'BLYNK_LOG'

         #define BLYNK_LOG(msg, ...)  blynk_dbg_print(BLYNK_PSTR(msg), ##__VA_ARGS__)

                                                                         ^

RTC:71: error: 'minute' was not declared in this scope

             hour(), minute(), second(),

                            ^

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/Blynk/BlynkDebug.h:89:73: note: in definition of macro 'BLYNK_LOG'

         #define BLYNK_LOG(msg, ...)  blynk_dbg_print(BLYNK_PSTR(msg), ##__VA_ARGS__)

                                                                         ^

RTC:71: error: 'second' was not declared in this scope

             hour(), minute(), second(),

                                      ^

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/Blynk/BlynkDebug.h:89:73: note: in definition of macro 'BLYNK_LOG'

         #define BLYNK_LOG(msg, ...)  blynk_dbg_print(BLYNK_PSTR(msg), ##__VA_ARGS__)

                                                                         ^

RTC:72: error: 'day' was not declared in this scope

             day(), month(), year());

                 ^

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/Blynk/BlynkDebug.h:89:73: note: in definition of macro 'BLYNK_LOG'

         #define BLYNK_LOG(msg, ...)  blynk_dbg_print(BLYNK_PSTR(msg), ##__VA_ARGS__)

                                                                         ^

RTC:72: error: 'month' was not declared in this scope

             day(), month(), year());

                          ^

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/Blynk/BlynkDebug.h:89:73: note: in definition of macro 'BLYNK_LOG'

         #define BLYNK_LOG(msg, ...)  blynk_dbg_print(BLYNK_PSTR(msg), ##__VA_ARGS__)

                                                                         ^

RTC:72: error: 'year' was not declared in this scope

             day(), month(), year());

                                  ^

C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk/Blynk/BlynkDebug.h:89:73: note: in definition of macro 'BLYNK_LOG'

         #define BLYNK_LOG(msg, ...)  blynk_dbg_print(BLYNK_PSTR(msg), ##__VA_ARGS__)

                                                                         ^

Using library SPI at version 1.0 in folder: C:\Users\maja\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0-rc2\libraries\SPI 
Using library Ethernet at version 1.0.4 in folder: C:\Users\maja\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.1.0-rc2\libraries\Ethernet 
Using library Blynk at version 0.3.3 in folder: C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\Blynk 
Using library SimpleTimer in folder: C:\Users\Public\NewArduinoSketchesAndLibraries\libraries\SimpleTimer (legacy)
exit status 1
'hour' was not declared in this scope

Please try again using Blynk from the latest master.
I suspect you may be using Windows, and “time.h” clashes with the system library.

1 Like

@vshymanskyy yes we are using Windows (8.1).

Downloaded the RTCExample.ino you uploaded to github today and the new WidgetRTC.h header file. It compiles fine now, thanks.

Off to play with the RTC now.

48 hours later and I am still playing with RTC.:cry:

@vshymanskyy was the RTC tested on ESP standalone?

With my ESP-01’s, ESP-12EX’s and WeMos D1 Mini’s the standard sketch crashes the devices unless I comment out BLYNK_ATTACH_WIDGET(rtc, V3) line.

1 Like

Same on my ESP-12, crashes with BLYNK_ATTACH_WIDGET(rtc, V5) line

1 Like

I can’t even get the RTC to compile on the ESP8266. I have no problem compiling for Uno / Nano. It adding the header libraries one at a time to my basic ESP8266 template, it’s the WidgetRTC.h file that seems to kill it.

@chrome1000 did you take the latest files from Github or are you using the latest release (0.3.3)? You need the github files not the latest release.

@Costas. Sure enough. That was the problem. Thanks.:cocktail:

@chrome1000 now that it compiles for your ESP does the RTC actually run on your ESP?

@chrome1000 if it is working on your ESP which ESP do you have, which IDE (including OS) and which ESP core? Finally local or cloud server?