Saltar al contenido principal

Which printers are actually out there

printer_discovery_event records what each location's devices detected during a scan, including printers the merchant never configured. That is the survey: it answers which printer brands and transports are in the field, which is the input for deciding the next vendor SDK to integrate.

What the data can and cannot tell you​

Identifiers are hashed per business before they are stored. Within one business a hash is stable, so distinct printers can be counted across scans. Across businesses the same physical model hashes differently, so a device cannot be followed between merchants — deliberately.

No display name, host or MAC is ever stored, so this cannot tell you a printer's make from the record alone. It tells you transport, reachability, support state and how often each was seen.

Metabase question​

-- Printers seen per transport, and how many were never configured.
SELECT
date_trunc('week', e.occurred_at) AS week,
r ->> 'transport' AS transport,
r ->> 'supportState' AS support_state,
count(*) FILTER (WHERE (r ->> 'alreadyConfigured')::boolean IS FALSE)
AS unconfigured_sightings,
count(*) AS sightings,
count(DISTINCT r ->> 'identityHash') AS distinct_printers
FROM printer_discovery_event e
CROSS JOIN LATERAL jsonb_array_elements(e.findings -> 'results') AS r
WHERE e.client_kind = 'mobile'
AND e.occurred_at >= now() - interval '90 days'
GROUP BY 1, 2, 3
ORDER BY 1 DESC, sightings DESC;

Scans that found nothing​

These are the interesting ones for support: the device looked and there was nothing there, which is a different diagnosis from never having scanned.

SELECT
e.location_id,
e.occurred_at,
m ->> 'method' AS method,
m ->> 'status' AS status,
m ->> 'detail' AS detail
FROM printer_discovery_event e
CROSS JOIN LATERAL jsonb_array_elements(e.findings -> 'methods') AS m
WHERE e.client_kind = 'mobile'
AND jsonb_array_length(e.findings -> 'results') = 0
AND e.occurred_at >= now() - interval '30 days'
ORDER BY e.occurred_at DESC;

A status other than ran means the method could not run — permission declined, radio off, metered connection — which is usually the actual answer to "why can't it find my printer".

Desktop scans​

Desktop writes the same table with client_kind = 'desktop'. findings->'client' carries installation id, role, and OS. unavailableKinds lists kinds this OS cannot compile (for example windows_spooler on macOS). No name, host, or MAC.

SELECT
client_kind,
findings->'client' AS client,
findings->'unavailableKinds' AS unavailable_kinds,
jsonb_array_length(findings->'results') AS found
FROM printer_discovery_event
WHERE client_kind = 'desktop'
AND occurred_at >= now() - interval '30 days'
ORDER BY occurred_at DESC
LIMIT 20;

Empty results with methods that ran is "looked and found nothing". A missing hardware-verification record does not suppress desktop advertisement — see Desktop printing.