Input diagnostics¶
Input diagnostics show what each input has been doing and how healthy the event queue is: how many edges were accepted, how many quiet windows they opened, how many edges were turned away, and whether any were lost to a full queue. Use them to see whether an input is active, chattering or being held back by the quiet interval. They are available on the Windows service with an Advantech card and on the ESP32; the Uno and X-keys platforms report them as unavailable.
Opening the diagnostics in the web page¶
Choose Input diagnostics on the main page. The dialog polls the device once per second while it is open and shows one card for each input:
| Item | Meaning |
|---|---|
| Input and level | The input number and its current logical level, High or Low. |
| Current level duration | How long the input has held its level. |
| Accepted edges | Edges the device accepted and reported. |
| Last accepted edge | How long ago the last one was accepted. |
| Quiet windows opened | How many times an accepted edge started a quiet interval (see below). |
| Edges suppressed during quiet window | Edges the device turned away. Shown as "Unavailable" where the platform cannot count them. |
| Observed queue overflows | Events lost because the device's queue was full, for this input. |
Above the cards the dialog shows the counter scope and the quiet interval the device reports, and the total of observed queue overflows. If the platform does not support diagnostics, or a request fails, the dialog says the diagnostics are unavailable; it never shows zero counters instead. If a later poll fails, it keeps the last successful snapshot, labels it as stale and freezes its durations at that snapshot.
The dialog also holds the Button health check button (see Normal diagnostics and the button health check). Suppressed-edge counts are software observations: they cannot distinguish switch bounce from other transitions, and transitions hidden by hardware interrupt masking may not be counted.
.NET client API¶
The hub command is ITriggerHubCommands.GetInputDiagnostics(GetInputDiagnosticsRequest), returning Task<TriggerCommandResponse<InputDiagnosticsSnapshot>>. A .NET client can call the TriggerClient convenience overload:
TriggerCommandResponse<InputDiagnosticsSnapshot> response = await client.GetInputDiagnostics();
if (response.Success && response.Payload is { } snapshot)
{
foreach (InputDiagnostic input in snapshot.Inputs)
Console.WriteLine($"Input {input.Index}: {input.AcceptedEdgeCount} accepted edges");
}
The parameterized client method is also available: GetInputDiagnostics(new GetInputDiagnosticsRequest()). On a direct SignalR connection, invoke the hub method by its contract name and pass the request object. Check Success before reading Payload; unsupported platforms return an unsuccessful response.
Snapshot fields¶
InputDiagnosticsSnapshot contains:
| Field | Meaning |
|---|---|
ObservedAtMonotonicTicks |
Monotonic timestamp for this snapshot. |
Inputs |
One InputDiagnostic per reported logical input. |
ObservedOverflowCount |
Queue-overflow events observed by the platform. |
CounterScope |
Where counters began: since device open on Advantech, since boot on the ESP32. |
SuppressionMilliseconds |
The per-input quiet interval the platform reports. It is 200 ms on both Advantech and ESP32; read the field rather than assuming it. |
OperatingMode |
Null or Normal in ordinary operation; ButtonHealthCheck while a button health check holds the device. Null also means the server does not report the field. |
Each InputDiagnostic reports its Index, current logical IsHigh level, LevelSinceMonotonicTicks, AcceptedEdgeCount, LastAcceptedMonotonicTicks, SuppressionWindowCount, optional SuppressedEdgeCount, and optional per-input ObservedOverflowCount.
The three timestamp fields use monotonic .NET TimeSpan ticks (100 ns per tick). ObservedAtMonotonicTicks, LevelSinceMonotonicTicks and LastAcceptedMonotonicTicks share an origin within a snapshot, so subtract the latter two from the observation time to get an observed age. Null timestamps and nullable counts mean unknown or unmeasurable; they do not mean zero. Monotonic values cannot be compared with UTC or wall-clock timestamps. The snapshot describes software observations and does not establish a physical input timing or bounce measurement.
SuppressionWindowCount counts quiet windows opened by accepted edges. SuppressedEdgeCount is nullable because platforms differ in what they can observe:
- Advantech counts polled edges rejected by the press rule plus interrupt callbacks that the native shim did not pass because the input's gate was closed (after an entry, within 200 ms of a non-entry, or with no interrupt faceoff waiting for the input). A suppressed callback contributes its stamp to debounce history, but its direction is unknown and it does not alone restart a lockout.
- ESP32 masks inputs during the quiet interval and cannot count the transitions hidden by the mask, so
SuppressedEdgeCountis always null.
Queue overflows are reported separately and can make edge results incomplete.
Quiet interval and level notifications¶
The quiet interval is the 200 ms rule described in Triggers and faceoffs, which is where the timing rules live: what the window covers, how a faceoff entry closes its input until the faceoff is cleared (section 4), and why a faceoff is refused while a participant is held down (section 8). What you need to read the counters:
- Every detected change updates press-debounce history on its input. This includes releases, changes suppressed from reporting and changes while a winner is closed. A press strictly within 200 ms of the previous detected change is ignored before entry or lockout decisions. The diagnostics field
SuppressionWindowCountis narrower: it counts windows opened by accepted edges, not all changes that update debounce history. The ESP32 firmware still needs this new rule for parity. - Advantech counts two kinds of suppressed edge. Polled edges rejected by the press rule, and interrupts that the native interrupt shim turned away because the input's gate was closed. Each input has a gate, closed unless an interrupt faceoff or pre-faceoff is waiting for it. The native gate enforces the same 200 ms quiet period before queueing an interrupt: each suppressed callback moves reopening to 200 ms after its stamp, even while the service is busy. It retains the latest suppressed stamp while a winner is permanently closed, so that stamp contributes to debounce history after the next phase opens the gate. The service also checks the rule after queueing. A suppressed callback has no known direction, so it does not alone start or restart a lockout. A press in the few microseconds between the held-button check's fresh read and the opening of the gates is counted but not passed on.
- The ESP32 masks an input's interrupt during its window, so it cannot count the transitions the mask hides.
After the quiet interval, a stable-level refresh may update the displayed input level. The device sends this as ITriggerHubNotifications.InputLevels(bool[] levels). It updates input state without fabricating an edge report or writing a synthetic row to the edge log. Expiry of the quiet interval does not generate an edge by itself. Service platforms use level notifications for corrections; ESP32 firmware also sends them. A release that is detected normally reports a falling edge unless its input is closed after entry.
Normal diagnostics and the button health check¶
The counters above describe ordinary operation: edges that the service accepted, quiet windows they opened, and edges it turned away. They are not a record of everything an input did, and by design they cannot be: an input's later transitions are hidden by the quiet interval or by the closed-after-entry rule.
The button health check is a separate, timed test mode for finding an unstable contact or connection. While it runs, the device records every transition of the selected inputs and returns them afterwards; it does not report edges, run trigger actions or arm faceoffs. The snapshot says so in OperatingMode: ButtonHealthCheck while the test runs, Normal otherwise. The dialog shows a warning when the mode is not normal.
During a check, counters of accepted edges and quiet windows stay where they were, because no edge is accepted. A quiet counter in that mode does not mean the inputs are idle. Levels still follow the inputs. After a check on Advantech, the "last accepted edge" reads as unknown until the next accepted edge. A platform that cannot run the check never reports the mode. The diagnostics counters are not a substitute for the check, and the check's results are not a substitute for these counters: the check does not update them.
How to run the check, what it can and cannot show, and its API are in Button health check.
Faceoff health report¶
When a faceoff is cleared, and when a pre-faceoff ends, the device sends ITriggerHubNotifications.FaceoffHealth(FaceoffHealthReport report) to the instance's clients (TriggerClient.FaceoffHealthReported in the .NET client). The .NET service also logs one line. Phase says which kind of phase ended: 0 for a faceoff, 1 for a pre-faceoff (a report without Phase is a faceoff report). The report gives the phase's duration, edge source, how it ended, interrupts dropped because the queue was full, and one FaceoffInputHealth per participant and per other input that showed activity.
How a phase ends (EndReason):
| Value | Faceoff | Pre-faceoff |
|---|---|---|
Ended |
A client ended it and nothing replaced it. | A client cleared it (a pre-faceoff or faceoff request without inputs). |
Replaced |
A new faceoff or pre-faceoff with inputs replaced it. | A new pre-faceoff with inputs replaced it. |
FaceoffStarted |
Not used. | A faceoff with inputs was started while it ran (its lockouts carry into the faceoff). |
InputLoss |
The service cancelled it because interrupts were lost. | The same. |
A request that is refused (for example because a participant is already held down) ends nothing and sends no report; the running phase goes on, and its counts still start from its own start.
| Field | Faceoff | Pre-faceoff |
|---|---|---|
Participating |
The input is one of the faceoff's inputs. | The input is one of the pre-faceoff's inputs. |
EntryReported |
Its entry was awarded and reported (an edge with an ordinal). | A press that started or restarted its lockout was reported (an edge carrying a lockout). A press the 200 ms limit kept from being reported does not count. |
InterruptsReceived |
Every interrupt the input raised during the faceoff. | Every interrupt the input raised during the pre-faceoff. |
StrayInterrupts |
Those that did not become its entry: one less than received when the entry came from an interrupt, otherwise all of them. | The same arithmetic with the first reported lockout press in place of the entry, so repeated presses and releases count here. |
SuppressedInterrupts |
Interrupts turned away because the input's gate was closed. | The same (in a pre-faceoff a gate closes for 200 ms after each interrupt it passes). |
PolledChanges |
Level changes the polling loop saw. | The same. |
When one phase follows another in the same change (a pre-faceoff started as a faceoff, or replaced), the counters read to end the first are the ones the second starts from, so every interrupt is counted in exactly one of the two reports. A null count means the platform cannot measure it, or could not for this phase (on Advantech, when no device was open at its start or the device closed during it); it never means zero. Advantech fills every count. The Uno, X-keys and ESP32 platforms send the report with null counts; the ESP32 report carries only Participating and EntryReported, and lists only the participants.
The log line starts "Faceoff health" or "Pre-faceoff health", and lists the inputs ("entered" or "no entry"; for a pre-faceoff "pressed" or "no press") with their counts. A faceoff's line is a warning when any input has stray interrupts. A pre-faceoff's line is never a warning, because a second press or a release counts as stray there and is ordinary. Like the other counters, these are software observations, not a physical bounce measurement.
Ignored activity has no log line of its own: an interrupt or polled change that is debounced, suppressed, arrives for an input that is not armed, or is stamped before the faceoff change it would belong to is counted (in the native received and suppressed counters, the input diagnostics and these reports) but not logged. The device log holds the faceoff health lines.