With the details you have provided we don’t know if you have all the code for the RTC widget i.e. do you have rtc.begin() in setup()?
I don’t understand “But i cannot link the in app RTC widget to anything, there is only a delete option” as prior to this you say you connected it to V1. Please explain further including details of Smartphone OS (Android or the other one).
For 0.3.4 (not 0.3.5 beta) on Android the RTC has pin assignment available.
Maybe you have everything set up ok because we have noticed that RTC is now very unreliable. Less than 50% of our requests for time are ignored, similar with sync feature. Don’t know if it is an app change, server location change or library change.
#include <Time.h>
#include <TimeLib.h>
#include <SimpleTimer.h>
#include <stdio.h> // for function sprintf
#define BLYNK_PRINT Serial // Comment this out to disable prints and save space
#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>
#include <WidgetRTC.h>
char auth[] = "xxxxxxxxxxxxx";
WidgetRTC rtc;
WidgetTerminal terminal(V0);
SimpleTimer timer;
BLYNK_ATTACH_WIDGET(rtc, V1);
void getTime() {
Serial.println("timeIn");
int Vhour = hour();
int Vminute = minute();
char Vtime[10];
sprintf(Vtime, "%02d:%02d", Vhour, Vminute);
Serial.println(Vtime);
// BLYNK_LOG("%02d:%02d", hour(), minute());
}
void setup()
{
Serial.begin(9600);
Blynk.begin(auth, "xxxxxx", "xxxxxxxxxx");
while (Blynk.connect() == false) {
// Wait until connected
}
rtc.begin();
timer.setInterval(10000L, getTime);
// This will print Blynk Software version to the Terminal Widget when
// your hardware gets connected to Blynk Server
terminal.println(F("Blynk v" BLYNK_VERSION ": Device started"));
terminal.println("-------------");
terminal.flush();
}
BLYNK_WRITE(V0)
{
terminal.print("echo: ");
terminal.write(param.getBuffer(), param.getLength());
terminal.println("");
Serial.println(param.asStr());
terminal.flush();
}
BLYNK_WRITE(V2)
{
int R = param[0].asInt() >> 3;
int G = param[1].asInt() >> 2;
int B = param[2].asInt() >> 3;
Serial.println("colorRGB");
long RGB = (R << 11) | (G << 5) | B;
Serial.println(RGB);
}
void loop()
{
Blynk.run();
timer.run();
}
The sketch is uploaded to an ESP8266-12, using an iPhone 6 ios 9.3
when i try to connect the RTC widget on my iPhone to any pin (like i would do with for example a button) there is no option for this. The RTC example states:
19 * App project setup:
20 * RTC widget on V5
So i assumed you had to connect the widget in the app to a virtual pin.