my companion computer is a Raspberry Pi which operates mostly offline. I’m wondering if is possible to get real time clock from Pixhauk 4 using a python script in order to use it on my project. I did some research but couldn’t find a working solution. In any case, I do not want to rely on Raspberry Pi’s clock.
Sorry about the delay on getting back to you on this. I spoke to our software team about it and @williangalvani mentioned that QGC uses TIMESYNC mavlink messages to synchronise the clocks. It’s likely that the correct way to enable using the Pixhawk clock instead for that is to enable HW in the BRD_RTC_TYPES parameter:
but Willian did try this and wasn’t successful with his test.
We haven’t extensively used or tested the Pixhawk 4 though (Willian’s test was on a Pixhawk 1, which is currently the only board we fully support), so it’s possible it works for your board where it didn’t for the Pixhawk 1.