TIMESYNC messages always returns with ts1=0

I’m attempting to time sync arducopter with a companion computer using the mavlink TIMESYNC message.
I the ts1 field to the local (companion computer) time in microseconds and wait for a TIMESYNC message, for some reason the ts1 field always comes back zero. Btw, I am sending the TIMESYNC message from the companion computer at 10Hz.
Any ideas?

Are you sure it’s responding to your message, rather than probing for
anybody who might like to respond to its own timesync requests? We send
the latter probe every 10 seconds.


Yes, I am sure. I am receiving them at 10 hz. I have determined that the reason for this is the mavlink library I’m using - mavlink.net , when I use the standard c library, this problem doesn’t occur.
The mavlink.net library assumes the payload length is 16 bytes,

 internal override void DeserializeBody(BinaryReader s)
                this.mTc1 = s.ReadInt64();
                this.mTs1 = s.ReadInt64();

but the message I am receiving can be smaller than 16, which causes the second ReadInt64() to throw an exception, the c library pre-allocates 264 bytes for the payload, so it has no problem casting whatever is in the payload to int64.

Hi @danielh,
I have the same problem as you. If you find a way, it could be really nice !
If you need help for a specific task, do not hesitate :wink:

I think I should be using mavgen, since it is supported and maintained as opposed to mavlink.net.