-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add an option for Millisecond timestamping **in Console log** #10152
Comments
Hi, Tasmota is not a real time software, so the result of your request won't be accurate. Tasmota has several tasks in background that are controlled by the Espressif SDK like the wifi radio. Also Tasmota has a dynamic sleep function that reduces the power consumption while it is not being used. Besides this, each cycle of the main scheduler is 50msec, reducing more the accuracy of that time difference measurement. So, sorry but the result of msec used will randomly depends on wifi, sensors polling, etc. Besides, this request is more oriented to debugging? In that case, you don't need a runtime command, just modify the code for your tests. An user don't need this.
Please, can you explain a bit further this? |
If we use the current time just before printing that might be a small effort. For sure it is not cristal accurate, but for sure better than the 1 second resolution. A also had the use-case in my shutter to get it a bit more specific than just on the second level. I would vote for it. |
Additionally, I would vote for the TIME command and not an additional loglevel. It could make a lot of sense also for a lower loglevel to get the timestamp of the print |
Learn to use syslog and you'll have any timestamp you like. Additional timestamps in console takeup too much log buffer space.which we do not have. Do not suggest it's just a uint32 as it needs processing too. Won't implement. |
note that syslog traditionally uses second resolution timestamps (RFC3164),
there is a new timestamp RFC (5424) that includes a high resolution timestamp.
I'm not sure which format tasmota uses, but if it's the original format, the
sub-second data is lost.
David Lang
On Wed, 16 Dec 2020, Theo Arends wrote:
… Learn to use syslog and you'll have any timestamp you like.
|
What I do when I'd like to see subsecond timing is to subscribe to the MQTT messages (possibly including MqttLog) using a tool able to timestamp the output. It seems that the current version of mosquitto_sub has gained an option for output formatting including timestamp. Of course, this is not the Tasmota timestamp, but from the client subscribing, but my experience is that with a reasonably running network, this does not cause issues. In any case, the non-realtime nature of Tasmota will likely induce more deviations in timing, meaning that in both cases doing millisecond calculations is just "too many digits" to pore over. |
Thanks for all the answers, here are some comments: @ascillato I would like to reproduce a problem that I have often observed when stopping (shutterstop) roller shutters. In this case, the shutter stops and then moves backwards a little. The whole thing only occurs sporadically and with weblog 4 there is a lot of output within a second, so you can't see exactly what happens when (only the sequence, but not the exact time course).
@ALL: Thanks for helping me out here, and thanks again for maintaining Tasmota. I really like it the more I get my nose into it! Sebastian |
That is explained at #9906 (comment) Closing as #10152 (comment) |
@ascillato2 I will read it. @sfromis I would still appreciate a quick help for the mosquitto_sub command. |
@arendst I set up the syslog server on my synology nas. There are two formats: BSD and IETF. I don't find any information in the documentation witch format I should choose. If I activate |
Open a new issue with answers to all questions asked |
About the failure to get milliseconds from MQTT, my suggestion was not about all those other things you looked at, but specifically about the command mosquitto_sub, where you can read the man page and find output format, including Unix timestamp with nanoseconds. Note that this is for newest Mosquitto, not older versions. |
Add milliseconds to console output (#10152)
OMG:
|
Nice. We can now optimize to the millisecond |
@arendst Thanks! about: |
Have you looked for this feature in other issues and in the docs?
Yes
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is.
I'd like to look at some timing issues I'm observing. For this I have turned on
weblog 4
to look at more information. I would like to see how long each component takes to execute code, or what delays they cause.Currently there is only the output in seconds in the console, via
Time 4
you can activate an output of milliseconds (implemented with #8537), but this does not change the display in the console.Describe the solution you'd like
A clear and concise description of what you want to happen.
Could
time 4
also influence the output in the console so that the milliseconds are also included there:e.g. like this:
Or another possibility (e.g.
weblog 5
=weblog 4
+ Milliseconds) to include the millisecond information in the console output.Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.
I didn't find any alternative for that.
Additional context
Add any other context or screenshots about the feature request here.
(Please, remember to close the issue when the problem has been addressed)
The text was updated successfully, but these errors were encountered: