You are not only making a timer. You are using Blynk.
If I remember right blynk doesn't like traffic at short intervalls.
updating via blinkserver once per second is a to high frequency.
imagine each and every of the hundred-thousands of Blynk-users are doing this. That would be almost a DdoS-attack.
That's the reason why Blynk is limiting this
Is blynk a substantial requirement of your project or can you throw it out?
This will block the code, and the clock update, for 18 seconds: delay(18000) = Ooops..
EDIT: And this int temps = second() is run before the clock has been initialized, you should check what value you get there - if it is 7, the code will block for 18 seconds in each iteration of loop()...
I actually don't have a value, so I placed my function int time = seconds(); after the rtc.begin(); but I still have no value. Maybe my timing is wrong.
But the only other solution I see is to call a cycle end time (in this case when second equals 25) I will work with hour but seconds is better for testing
The problem is not there, I have a dozen sensors that send data every 0.5 seconds and everything works
I also specify that I am on a local server
You need to update the value of temps frequently, each time through loop() would be good, not use blocking code anywhere in the sketch, and test its value as frequently as you update its value
mean?
temps like time?
and if it is time what kind of time?
seconds?, minutes?, hours?, daily hour?
I did not expect that you use things like delay(18000) in your code if you want to have an RTC-clock.
There is a very different approach for timing. Non-blocking timing
It is so completely different that you have to think really new.
As long as you try to think of this non-blocking timing it is a delay-similar thing
you will block yourself and it is just confusing. Because it is really different.
Here is a tutorial that explains the basic principle:
It can look to see whether temps equals 7 as long as you want but if you don't update the value of temps then how will it ever equal 7 ?
Suppose that you had an old fashioned wind up clock that was not running and you set it to a time of 1 o'clock. How long do you think it would be until the clock showed 7 o'clock ?
You are using an ESP8266. If this ESP8266 is connected to WiFi the onboard RTC will be updated by the WiFi-connection in the backround.
RTC is more precise than function millis().
But your problem is at an
other place
your basic code is
unable to work for timing!
there is only
one place
where you assign a value to variable "temps"
it is this line
int temps = second();
in all the rest of the code your variables "temps" gets
If the intent is to have the pin HIGH for 7 seconds/hours and LOW for 25, that is not what the code does. It will become HIGH whenever the second/hour is 7 and LOW again when it becomes 25 (hour will never become 25). If the goal is to have the pin HIGH for 18 seconds/hours and LOW for 25, you could use a one-shot timer to turn it LOW.
I know very little about Blynk but shouldn't you have 2 timer objects if you want to call 2 separate functions at the end of the period ?
To me, those 2 lines of code say "run the clockDisplay function every second. No, sorry, I have changed my mind. Run the cycle1 function every second" In other words, never call the clockDisplay function