cpvalente / ontime

Free, open-source time keeping for live events
https://www.getontime.no
Other
391 stars 45 forks source link

Problem with auxiliary timer #975

Closed filiview closed 1 month ago

filiview commented 1 month ago

I have recently discovered Ontime and, well, thank you for the great job. I have found out how to setup and start the auxiliary timer, both from the editor and from QLab, through OSC. I can see it running inside the editor, but when I try to read it from remote using the Ontime Viewer Template, the relevant field is always null. What am I missing? As an aside: the only way for a remote viewer to keep updating its timers is by polling the server, right?

Thank you for your help.

cpvalente commented 1 month ago

Hi @filiview, thank you for your kind words and for reaching out.

Ontime UI is a control interface for the server, everything the interface does, users can do as well. This also means that, if the timer is running in the editor, the server is streaming this data.

I believe that this might be an issue of bad documentation, but there is of course, room for some endpoint offering stale data.

How are you getting data from Ontime? the Ontime Viewer Template uses websocket which continuously reads the stream

As an aside: the only way for a remote viewer to keep updating its timers is by polling the server, right? You can poll data at intervals, but there are other ways. You could use websockets which would keep an open connection to your client and continuously stream the timer data You can use the integration feature to push OSC or HTTP out of ontime into your application

I have just realised that the Auxiliary Timer data is not documented in the new docs and will try and fix. Meanwhile, this is a snapshot of a test I did now

{
  "type": "ontime-auxtimer1",
  "payload": {
    "duration": 0,
    "current": -16030,
    "playback": "start",
    "direction": "count-down"
  }
}

If you let us know your data source or if you have some code for us to look at I am happy to try and spot any issues

filiview commented 1 month ago

Ok, I opened the javascript console to see what ontime was sending me and found it. Problem was the Viewer Template (which I downloaded following the link in the Make custom views page) did not expect the aux timer at all. I saw the secondaryTimer in the Timer object and thought that was the aux timer.

cpvalente commented 1 month ago

Thank you. Glad you found your way.

I have created a task for the documentation repo https://github.com/cpvalente/ontime-docs/issues/36 and will fix this there