-
Notifications
You must be signed in to change notification settings - Fork 20
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
Time awareness and smarter logging #134
Conversation
sarfata
commented
Apr 26, 2018
•
edited
Loading
edited
- Make KBox/SK support time so we can parse it and pass it in an SKUpdate
- Parse time in GPS messages from NMEA
- Parse time in GPS messages from NMEA2000
- Implement a Time Manager Service that will set the time on the system
- Show time on the display when we have it
- Add a new option so that we only log when the time is set (default)
- Name the logfile after the time when it was started
- Properly log time in logfile
- Use the SignalK format with a ";" as a delimiter. Second field is the source - closes Log data to SDCard in SignalK update format #12
- Also log -debug- info and error messages in the log file.
- Make sure SDFat also gets the time.
- Parse N2K 129029 for time too
- Log the brand and model of devices on network when we discover them
And add the path navigation.datetime. This will allow us to parse and transmit time from GPS receivers.
- WallClock keeps track of time with a milliseconds resolution. - TimeService sets the time whenever we get a "navigation.datetime" value. - Bunch of tests to go with it.
@sarfata Great feature 👍 For logging of datas: please make it choosable by config settings.
Background: Note: @ Parse date and time in N2k 126992 sentences: |
We need to tell the SPI library what pins we use for MISO/MOSI/SCK because the SD library does not do it. Also log errors in hex format to make it easier to read them and find corresponding problems in SDInfo.h
This helps when you have a few dangling "phantom" devices.
No important changes for us - just staying current.
- You can now enable / disable logfiles - By default KBox will not log until it knows what is the current time - KBox will name the logfile with date/time when it starts logging And also: - Print time in ISO8601 basic format (used in logfile names) - Reduced startup delay from 1000ms to 200ms - Enable USB logging before we call KBoxHardware.setup() so we can log from there too
- Log proper timestamps in logfiles - Log in SignalK format - Auto-rotate file after 1GB
Thanks for taking a look @ronzeiller!
Do you have more details on the Actisense binary file format? What does it look like? We can always add more but I am afraid that if we support too many things we will not test them and they will slowly stop working and become abandoned. I would rather find one format that works for everyone. We could replace PCDIN by Actisense serialized format but I do not think it will be much smaller. I agree that on a modern boat, logging everything is very likely going to be way too much. Especially if we log the NME2000 message AND the translation into SignalK. I am going to do some more testing before I merge this and maybe I will disable logging by default. I think what most people really want is one CSV line per second with current boat data. Not all the NMEA2000 messages.
Did you already do that in your branch? Can I take it? |
No, because time in SKUpdate is new to me. Also see some general, very good informations from Timo here: |
Sorry, too fast writing without thinking.... No, the Actisense serialized format is larger than Seasmart. But we could save some bytes with a shorted message:
13 Bytes could be saved per sentence if we drop redundant "$PCDIN", all commas and the checksum UTC could be written in the first line of log file, then afterwards just millis() are needed as timestamp to get real time of each sentence. The basic question is what is really needed in a log file and what do users want to do with it? But you are definitely right if you say for that application it is just needed to write informations every 1....4 seconds. I was logging datas for years with Expedition, but the only thing which was really interesting was the "Playback" function to see the boat with speed and wind datas moving in a chart.
A completely other thing is testing KBox on different systems and here it is good to have all N2k-sentences of many real systems. |
- Only INFO and ERROR - Make system stats and wifi stats be INFO - Make this configurable
- By default KBox will not log the signalk representation of a NMEA or NMEA2000 message. - By default KBox will log SignalK data from IMU/ADC/Barometer but this can be disabled. - Add uptime, freeRam and usedRam in system log messages
@ronzeiller With the PR as it is we log every NMEA2000 messages but user can disable this. I am going to test this on my boat and see how it performs. Please let me know what you think too. The other important thing here is that we will have system logs and stats in the logfiles. Should make it a lot easier to understand some crashes in the future, especially WiFi module crashes. If you have some And, if you could share your giant log file that would be very appreciated. I can use this for testing in the future. I am also very interested in the visualization part. I think Expedition is what most people use to look at the data but there must be something better we can do! |
Make WiFi module log once every 5s and log the version when it boots.
https://github.com/ronzeiller/N2kLogReaderWriter
You will find this sentence in the log files RPC2018.log and RPC2018_xad.log (were the Garmin GPSMap 721 was turned on) Please note the Manufacturer and Product Informations in the log file. I was writing these informations the first 30 seconds into the log file. |
I would suggest to do autorotate of log file by end of day ? |
Going to merge this PR as-is. I have created tickets to not forget about your two suggestions.
That would be easy to add but right now the time is UTC based which means "ends of day" is kind of meaningless. Let's revisit this idea when we have a setting for the local timezone. |