VOXL2 Time Sources
-
Hello,
Recently, PX4 saved log files with a timestamp that was several days old. E.g., March 12th was the flight date, but files were saved under an existing March 9th directory. The flights were successful. PX4 itself was not running in the background but was stopped and started via terminal "voxl-px4 -d".
So, I'm trying to understand 1) how this may be the case and 2) generally, how time is set
Can you please verify the following sources? Also, can you provide a time hierarchy -- assuming multiple time sources are active, what would be the order of implementation?
Sources:
-
NTP - if voxl2 is connected to the internet, will ping ntp. How is time forwarded to PX4?
-
Mavlink SYSTEM_TIME message - can be sent from the GCS, but is not required. This message will be consumed by voxl-mavlink-server::mavlink_services_handle_system_time to set the system time. How is PX4 time updated?
-
GPS data - Assuming GPS is enabled in PX4 configuration file and is valid lock, PX4 will publish mavlink message MAVLINK_MSG_ID_GPS_RAW_INT which is handled in voxl-mavlink-server. voxl-mavlink-server will correct time and send onto MPA. Do any services use this data to set system time?
-
Prior saved point - if none of the above exist, time is loaded from a prior saved point
It seems like VOXL2 app can update PX4 system time and vice versa. Can you describe the various pathways time can be updated?
Can you describe time setting hierarchy in the case that multiple sources are active? I'm assuming that the same delta check between received time and current system time is used across multiple locations?
-
-
@shawn_ricardo A couple of quick points. First of all, PX4 just queries the Linux system time so there's no mechanism to set a separate notion of system time in PX4. If the VOXL 2 is connected to the internet then, yes, it will update the Linux system time with NTP. But VOXL 2 has no battery backed RTC so if it cannot get system time from NTP then it uses the last saved time which is typically the last time there was a connection to an NTP server. Also, in newer versions of our PX4 we get rid of the
-toption when starting the logger module so it will not use the system time. Instead it will just create session directories and log files within them in increasing numerical order. So, highest numbered log file in highest numbered session directory is the latest log.