-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Scrolling Text with Matrix Panel and #HHMM format in a Segment, Time gets wrong with -8 hour offset once in a while #3515
Comments
Scrolling Text uses system time, so if a display is incorrect it means system time is incorrect. If there is no response for NTP server, WLED will keep its internal count of time which may get skewed with long running without NTP as the internal crystal frequency is not guaranteed to be precise. |
I checked my NTP servers (Local ones) and they are working fines.
This is not the behaviour I observed since it suddenly jumps 8hrs in the past. What frequency or events make the queryings happening exactly? There must be some checks in the code to prevent bad query responses (No response or too much gap from previous query should be discarded)? Thanks |
Well it depends. Your NTP server should implement the NTP protocol, and only return a time response if it's own time queries do converge. WLED will use the server response as-is, and just subtract 1/2 of the "roundtrip time".
Twice per day, with retries each 10 seconds (if no response).
Nope, a valid NTP response implies a valid time was provided from the server. Relevant code is in wled00/ntp.cpp Line 242 in 1dab26b
Please run a wled debug build, and use serial monitor (via USB) to track debug messages. If network time is the problem, this should be clearly visible in the debug output. @blazoncek hi, I'm back :-) |
Thank you for your help... Yes my local NTP server is alway online as far as I know and have been used for many years with other devices (HA, Tasmota, etc)... First it was a Windows PC running HA in a VM... Then a week ago I setup my wleds to use my Router local NTP server, But same problem happens. Last night, I put back the original NTP server that comes with Wled fw. We'll see how it goes. Also, I wonder why while the problem is there and when I go in the UI, info screen and change the main brightness slider, it corrects the time. Thanks for all the detailed answers. Yves |
Not directly, but possibly indirectly. UI changes trigger a call to But there is no direct generation of NTP requests on UI interactions. |
@softhack007 thank you. I have to figure out what I have to do to try it :-) Ok just saw that 0_14_1 has been updated while I was updating my post :-) Yves |
NTP validation, and rejecting malformed responses (related to #3515)
@YvesLev Yes I've just merged the changes into 0_14_1. It's best if you build the firmware from source code, however it might also work to use one of the "artifacts" created by the automated github build: https://github.com/Aircoookie/WLED/actions/runs/6935308439, then scroll down to find the list of "artifacts". |
I have 2 Led Panels I use with WLED as wall clocks. I was having the clock offset issue on both occasionally. I have not noticed the bug since I removed all my WLED devices (including the wall clocks) from Home Assistant. Anyway, I compiled successfully the 0.14.1 Beta 1 code and OTA it to one of the clock. Both clock are configured with my Asus Router NTP server. For now everything is working fine but it needs more time to really tell... Thanks again. Yves |
Slightly offtopic but i been trying to figure out how to display just the time in my segment and this issue post mentioning "#HHMM" achieved exactly what i wanted to do. Is there any documentation anywhere that lists all the variables that can be used in a segment? |
Yes. KB |
NTP validation, and rejecting malformed responses (related to Aircoookie#3515)
NTP validation, and rejecting malformed responses (related to Aircoookie#3515)
Never saw the info in any wled KB myself (even the one linked by blazoncek)... It must be hidden somewhere. |
Let's ask @scottrbailey if he can update KB but if he is busy ATM then why don't you @YvesLev make the change? It is as easy as forking WLED-Docs, making a change and doing a PR. |
Yes, I’ll do it. I also want to document making text larger by using segment grouping. Scott BaileyOn Nov 22, 2023, at 11:13 PM, Blaž Kristan ***@***.***> wrote:
Let's ask @scottrbailey if he can update KB but if he is busy ATM then why don't you @YvesLev make the change? It is as easy as forking WLED-Docs, making a change and doing a PR.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
* purge old (not yet processes) NTP responses * validate server responses before updating WLED time * purge receive buffer when package is rejected (avoids mem leak on esp32)
* purge old (not yet processes) NTP responses * validate server responses before updating WLED time * purge receive buffer when package is rejected (avoids mem leak on esp32)
* purge old (not yet processes) NTP responses * validate server responses before updating WLED time * purge receive buffer when package is rejected (avoids mem leak on esp32)
What happened?
This happens once every day sometime once every few days.
This happens on 2 differents Led Panel setup (WS2812b) consisting of 16 X 32 leds.
It seems to happen less often on the Panel in the Kitchen, But this one has a Usermod (BH1750) and a Node-Red automation to auto dim (change the intensity) according to ambiant light. Also has MQTT enabled. But the problem exists also.
One segment has scrolling text effect to display the Time with #HHMM format in the Segment description.
Segment 2 display the outdoor temperature using REST command from HA.
The time gets wrong by itself. -8 Hour (-7h since daylight saving). It is not exactly 8/7 hour.
Exemple: Panel shows 10:40. Real time is 17:37.
It does not seems to correct by itself.
To correct the time, I go in the UI, click on info, I see the time is wrong, then, while in the info window, I changed the intensity, it corrects the time immediatly.
Going in any config menu and just pressing save with no modif. will correct the problem.
Also, re-selecting the preset that is already running will fix the time.
I'm using an ESP32-Mini on both clock panel.
My Time Zone US-EST/EDT.
To Reproduce Bug
I cannot reproduce the bug.
It just happen.
I notice it when I look at the clock.
Expected Behavior
WLED Internal Time gets off by about 8 hours (7 hours since daylight saving is active).
Install Method
Binary from WLED.me
What version of WLED?
0.14.0 Release
Which microcontroller/board are you seeing the problem on?
ESP32
Relevant log/trace output
No response
Anything else?
I'm using my local NTP server (Which is my Router).
Before I was using another Local NTP server (A windows workstation).
I just put back the default ntp server (0.wled.pool.ntp.org) and will report back.
Code of Conduct
The text was updated successfully, but these errors were encountered: