Open ostat opened 1 year ago
Thank you for reporting problem, I have checked and I found so far one issue with the system:
In case of no seconds value specified, the random garbage value got into the second variable, giving you 60/256 chance of it working properly.
A fix (along with self test) has been added: https://github.com/openshwprojects/OpenBK7231T_App/commit/2bd4bff5bad1ec911c73e908e9abd94995c434c2
Can you recheck, is there still any other issue?
Build 1.17.14 BK7231T device
I am still testing, I can see it working for the hh:mm so that appears fixed thanks. But I was getting some inconsistent results, so want to see if it is repeatable.
Reading the NTP_RunEvents code, I wonder if it is as intended.
ntp_eventsTime
is the previous trigger time, and the i
for the delta
loop starts at 0.
So the first loop will run for the previous trigger time, then all the way up to 1 second before the newTime
. NTP_RunEvents is always running 1 second behind, I guess it does not matter as long as NTP_RunEvents keeps being called?
if (ntp_events) {
// NTP resynchronization could cause us to skip some seconds in some rare cases?
delta = newTime - ntp_eventsTime;
// a large shift in time is not expected, so limit to a constant number of seconds
if (delta > 100)
delta = 100;
for (i = 0; i < delta; i++) {
NTP_RunEventsForSecond(ntp_eventsTime + i);
}
}
ntp_eventsTime = newTime;
Bit of an aside do you know why this might appear in the logs? Error:CMD:cmd Status NOT found (args 0)
?
@openshwprojects, did you have thoughts on the above comment regarding the loop being off by a second.
Otherwise I think this can be closed, your fix has resolved the issues. Thanks
Describe the bug While testing some automated lighting using the
autoexec.bat
file, I was getting inconsistent results relating to the clockevents. The events were meant to trigger lighting changes however they events appeared not to fire. Below is a simpler example.Firmware:
To Reproduce Steps to reproduce the behavior:
autoexec.bat
my output