TriggerGate
TriggerGate reads contestant buttons and other trigger inputs and reports every press to show-control software over the network. In a faceoff it decides who pressed first, second and third, and it reports the order to every connected client as it happens.
Objectives¶
If absolute fairness matters, your choice in buzzer system matters.
Results as fair as they can be. Every platform is carefully tested to establish its Accuracy. Differences as short as 50 µs are enough to establish who buzzed first. Even beyond these technical limits - picking up differences shorter than a 300th of one TV field - TriggerGate offers options for unrivalled fairness. You can choose whether to call it a tie or accept TriggerGate's winner, chosen without bias. If you're using a buzzer system that hasn't documented these details, it's not because they don't exist, it's because they're easier to ignore.
Adaptable to many architectures. The same hub and the same web page run as a Windows service for X-keys keypads and Advantech digital-input cards, on an Advantech UNO, and as firmware on an ESP32 board. An application connects with the .NET client library or directly to the hub, in the same way on each. See Platforms and devices.
Auditable. Every edge carries its own time stamp. The Windows and UNO services log every edge, faceoff and tie decision, and any time range can be downloaded; an ESP32 board keeps a shorter log in memory. After each faceoff a health report lists stray activity on every input, and a guided check tests each button before the show. When a result is questioned, the record shows what happened. See Device log, Input diagnostics and Button health check.
Features¶
-
Precise order, no hidden bias
Each faceoff entry gets a place (1st, 2nd, 3rd and so on) and a high-precistion timestamp. The system is never over-confident with its judgement. If required, it will break ties in the fairest way possible and let the operator, integrator, or producer decide how to handle the black swan event.
-
Pre-faceoff lockouts
Triggate handles the classic scenario of discouraging contestants from buzzing before the prescibed moment. A contestant who presses to early is locked out for a configured time, which might stop them beating their competitor who played fair. Productions using TriggerGate benefit from years of GameShow experience rather than learning difficult lessons during the first episode!
-
One hub on every platform
A Windows service for X-keys keypads and Advantech digital-input cards, an Advantech UNO-220, and a wESP32 board all serve the same SignalR hub and the same web page.
-
Found on the network
Every server advertises its hub over mDNS, so the find button in a client application lists it without typing an address. On a Windows PC with X-keys and Advantech, or several keypads, a client or the web page chooses the platform and device it connects to. See Platforms and devices.
-
The web page
Every server serves the same web page: live input levels, a log of edges and faceoff places, faceoff controls, test triggers that check the path to the clients, and the device's settings. It runs in the browser and uses the same hub as any client. See The web page.
-
OSC on the win
A client can attach OSC messages to each input's win and loss. The Windows and Uno services send them themselves the moment the result is known, with no round trip through the client.
-
Clocks and time
Sometimes it's logistically simpler to spread TriggerGate devices around. TriggerGate supports synchronization so your system can still reliably establish who buzzed when. See Clocks and time.
-
Input diagnostics and faceoff health
When a button develops a fault, it may not be obvious just by using it in normal gameplay. Dirty and bent contacts can generate millions of events every second, bamboozling a simple buzzer system. TriggerGate offers has the diagnostics you need to be alarted to these problems early during gameplay and run more in-depth tests during set-up or troubleshoting.
-
Device log on demand
The Windows and Uno services log every edge, command, faceoff and connection, and an ESP32 board keeps a shorter log in memory. Download any time range from the web page or a .NET client, for example to see what happened during one game. See Device log.
-
HTTPS without a public certificate
Using secure web connections on a local network is a long-standing issue many users will be familiar with. TriggerGate tackles that issue head on, with the ability to create its own certificates you can install to stop your browser from nagging you.
How it fits together¶
graph LR
HUB(["SignalR hub<br/>same API on each"])
XK[X-keys keypads] -->|USB| WIN[Windows service]
DAQ[Advantech DAQ cards] -->|DAQNavi| WIN
UNOIN[UNO-220 inputs] -->|I²C expander| UNO[Uno service]
ESPIN[wESP32 inputs] -->|GPIO interrupts| ESP[ESP32 firmware]
WIN --> HUB
UNO --> HUB
ESP --> HUB
HUB <-->|HTTPS| WEB[Web page in a browser]
HUB <-->|HTTP port 9090| LIB["Show-control application<br/>(.NET client library)"]
WIN -->|OSC| OSC[OSC receivers]
UNO -->|OSC| OSC
Each service, and the firmware on each board, hosts its own hub and serves the web page itself. The web page is a .NET WebAssembly app that runs in the browser and connects back to the hub like any other client. Browsers start it only on a secure page, so from another computer it is opened over HTTPS. Programs that use the .NET client library connect over plain HTTP on port 9090.
How close can two presses be?¶
The smallest measured or configured gap between two presses that each platform puts in order, best first, with a few familiar durations for scale. On the UNO, presses found by one read tie and different reads are ordered, so this measured boundary is not a fixed guard. The reasons and evidence limits behind each figure are in Accuracy.
Drawn to scale: a blink is 3,000 times the ESP32 board's figure, so the fastest bars are slivers. Figures are for clean electrical edges; a real button's bounce adds its own uncertainty.
Quick start¶
TriggerGate is in pre-release, and packages are supplied on request: get in touch.
Chocolatey installs the TriggerGate.Windows package as a Windows service. For Advantech cards, install Advantech's DAQNavi runtime first; X-keys keypads need nothing beyond their HID driver. Run these commands in an elevated PowerShell, with the package source you were given added to Chocolatey.
Chocolatey also installs the .NET 11 and ASP.NET Core 11 runtimes. The service, also named TriggerGate.Windows, starts automatically, runs as NT AUTHORITY\LocalService and is allowed through the firewall on private networks. Settings and logs are kept in %ProgramData%\GameshowPro\TriggerGate.
Open http://localhost:9090/ on that computer. From another computer, open http://<host>-triggergate.local:9090/, which takes you through installing the certificate once and on to the secure address. See Install on Windows.
Chocolatey stops the service before it changes any files. Settings and logs in %ProgramData%\GameshowPro\TriggerGate are not part of the package.
The Uno edition is one Debian package, triggergate_<version>_arm64.deb for Raspberry Pi OS Lite 64-bit (recommended and device-tested) or triggergate_<version>_armhf.deb for 32-bit Bookworm or later (container-tested only), installed with apt. The package enables I2C and prepares the device on first install; restart the device when it asks. Advantech driver packages are not needed.
Copy the package to the device, then on the device:
This installs the program in /usr/lib/triggergate and the systemd service triggergate.service, which starts at boot. Settings and logs are kept in /var/lib/GameshowPro/TriggerGate.
From another computer, open http://<host>-triggergate.local:9090/, which takes you through installing the certificate once and on to the secure address.
Install the newer package the same way. The service restarts, and settings, logs and the HTTPS identity are kept.
The firmware and the web page are updated together, over the network, as one signed bundle (.tgupd). The board checks the signature before it writes anything, installs the update in its inactive slot, and returns to the previous version if the new one does not start cleanly. A new board needs a one-time flash over USB first: see Set up an ESP32 board.
An update needs the bundle, the public key it was signed for, and the uploader ota_bundle.py, which needs Python 3 with the cryptography package (python -m pip install cryptography). Neither method needs the private signing key.
Both check the signature and image hashes locally before sending anything, then wait for the board to restart into the new version and confirm it is healthy.
To open the web page, go to http://<board-host>/, which leads to the board's certificate page. See Set up an ESP32 board, and Your own certificate on the ESP32 board to use a certificate from your own CA.
The client library wraps the connection, commands and notifications for every kind of TriggerGate. Access to the package is arranged on request.
A client connects to http://<host>:9090/TriggerGate. On a Windows service that runs both X-keys and Advantech, add ?platform=XKeysWindows or ?platform=AdvantechWindows to choose one; with no query, the server chooses. To choose among several X-keys devices, add &device= and the device's index, counted from 0. The library exposes these as Settings.Platform and Settings.DeviceIndex. See .NET client library and Hub API.
Platforms and devices Triggers and faceoffs The web page Open the web page over HTTPS
Pre-release¶
TriggerGate is not yet released under a license, and its source is not public. Builds of every package above are supplied on request: get in touch.