Dear Sirs,
I have constantly a problem regarding RTC. (By the way all other widgets I tested are working fine).
First of all my environment: Windows 7 64Bit, Arduino version 1.6.9 (tested also with 1.6.7 , 1.6.8 same result), ESP8266 Community version 2.2.0, Blynk version 0.3.7, Android Blynk App version 1.12.2
My MCU is WeMos D1 mini.
As you can see in the attached picture, at Android Blynk App, I can see correct date and time updating just fine at the specific Value Display widgets. No matter how long I have waited, never, never saw RTC widget shows something different than the analog clock logo on it.
Is there something to do in order to have RTC widget shows time/date on it???
The testing sketch is the following but it is near the same like the demo RTC sketch that coming with the blynk library:
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <SPI.h>
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <SimpleTimer.h>
#include <TimeLib.h>
#include <WidgetRTC.h>
char ssid[] = "correct ssid"; // your network SSID (name)
char pass[] = "correct pass"; // your network password
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "correct auth key";
SimpleTimer timer;
WidgetRTC rtc;
BLYNK_ATTACH_WIDGET(rtc, V5);
// Utility function for digital clock display: prints preceding colon and leading 0
void printDigits(int digits)
{
Serial.print(":");
if(digits < 10) {
Serial.print('0');
}
Serial.print(digits);
}
// Digital clock display of the time
void clockDisplay()
{
// You can call hour(), minute(), ... at any time
// Please see Time library examples for details
String currentTime = String(hour()) + ":" + minute() + ":" + second();
String currentDate = String(day()) + " " + month() + " " + year();
Serial.print("Current time: ");
Serial.print(currentTime);
Serial.print(" ");
Serial.print(currentDate);
Serial.println();
// Send time to the App
Blynk.virtualWrite(V1, currentTime);
// Send date to the App
Blynk.virtualWrite(V2, currentDate);
}
void setup()
{
Serial.begin(9600); // See the connection status in Serial Monitor
///Blynk.begin(auth);
// We start by connecting to a WiFi network
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, pass);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
Blynk.config(auth);
while (Blynk.connect() == false) {
// Wait until connected
}
// Begin synchronizing time
rtc.begin();
// Other Time library functions can be used, like:
// timeStatus(), setSyncInterval(interval)...
// Read more: http://www.pjrc.com/teensy/td_libs_Time.html
// Display digital clock every 10 seconds
timer.setInterval(10000L, clockDisplay);
}
void loop()
{
Blynk.run();
timer.run();
}
Please help me. I have blowed out my brainā¦
Thanks and Best Regards,
Mike Kranidis