Skip to content

Time Sync Question #1741

Open
Open
@jsimpso81

Description

@jsimpso81

I have a question about time syncing protocol. Here the way it appears to work.

Server runs on the robot and waits for requests from clients on UDP port 5810
The format of the request is (10 bytes in all):
Version = 1 byte
ID = 1 byte (ping)
client time int64 (8 bytes)

The server responds with send a reply UDP message directly back to the sender IP address on port 5810
The format of the response is (18 bytes):
Version = 1 byte
ID = 2 byte (pong)
as received client time int64 (8 bytes)
server time from FPGA int64 (8 bytes)

Is this correct ? If not could you correct the protocol packets.

When trying this on a raspberry PI image (unrelated but so many things work, like identification of the co-proc as a raspberry pi) the pings are received and responded to but they appear not to be read or processed. There aren't any error messages and the NT variables from the co-processor indicate no PONGs have been received. (I've tested the protocol with a PC based client without issue.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationAnything relating to https://docs.photonvision.org

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions