Recently I have tried to look into my log files to increase flight performance, but a thing that is not working correctly is the logged flight time. I know that through
SDLOG_UTC_OFFSET it is possible to add / substract minutes and hours from the UTC time to your local time. What bothers me though is that it is not exactly one or two hours off, but approx 14 minutes (and some seconds). Is it possible I am missing some parameter? Does anyone know how px4 determines the times that it puts in the logfiles?
I am using a holybro pixhawk v4, running the latest version of px4 master, and qgroundcontrol.
So are you using the OFFSET parameter and if so what number have you set it to?
No I wasn’t using the
OFFSET parameter yet, which is why it seemed strange to me that the time was off. Is it common that the time is off, and do you know how time is kept/synchronized in PX4?
An easy fix would off course be to set the
OFFSET parameter to 14 min, but I am afraid this 14 min was a random number and could change on later reboots?
When this happened did you have a GPS connected and GPS signal? I believe without this you are not actually expected to have an accurate time source.
I did have GPS connected, even had an RTK connection.
Ok, that’s odd. Is this problem repeatable? If yes, can you try to debug where the wrong time is coming from? E.g. you can add printfs in the gps driver to see if it’s being parsed correctly.
I just did another flight, before it it changed the
OFFSET parameter to 74 minutes (60 because of time zone + 14 min because of emperical findings). Now it did log the times correctly. This time I also had a stable GPS and RTK connection. What exactly do you mean with:
you can add printfs in the gps driver to see if it’s being parsed correctly.
If I run
gps status in the mavlink, it returns:
I meant that if you are compiling the firmware yourself you could add some printfs in the code and debug it to see at which point the error of 14 minutes is introduced.
Which GPS are you using?
It seems the problem is resolved by changing the
offset parameter. The offset is also constant at 14 min, so we stopped investigating it.
We are using a Drotek Serius RTK unit, which runs a Ublox M8P.
Thanks for your help,