Skip to main content

QR / Barcode Scanner

Stockaj Kiosk supports USB HID QR code and barcode readers — scanners that emulate a keyboard and send characters followed by an Enter key.

Compatible Scanners

Any USB scanner that works as a keyboard emulator (HID) is compatible. This is the default mode for the vast majority of scanners on the market.

tip

Test your scanner by opening a text editor: if the scanned code appears as typed text followed by a newline, it is compatible.

How It Works

  1. The scanner sends the code characters one by one, like keyboard strokes
  2. The kiosk detects rapid keystrokes (less than 100 ms between each character) and accumulates them
  3. When the Enter key is received (or after a timeout), the complete code is processed

This mechanism distinguishes a scan from manual keyboard input.

Stockaj QR Codes

Stockaj QR codes use the format STK:1:{type}:{uuid}, where {type} identifies what was scanned:

TypeMeaning
iItem (tool)
vVariant (serialized unit)
rRental (movement)
cRenter (volunteer)

The kiosk tolerates minor scanner quirks: alternative separators (; or |), surrounding whitespace and invisible control characters are normalized automatically. Plain item or variant barcodes (non-QR) are also supported — the kiosk matches them against the item or variant code.

Scanner on the Cockpit

The scanner is always active on the cockpit. Its behavior is smart: it automatically determines the action to perform based on what was scanned.

SituationBehavior
The scanned item is part of an active rentalSelects the volunteer and routes the item to a return
The scanned item is availableAdds the item to the rental cart
A volunteer QR code is scannedSelects that volunteer
The item is not foundDisplays an error message and plays an error sound
Network errorDisplays an error message

Scanning an item

Screens Where the Scanner Is Active

ScreenScanner ActiveBehavior
CockpitSmart detection: rents, returns or selects a volunteer based on what is scanned
What's out?Highlights the matching outstanding line and adds it to the return selection
Assisted modeActive on the item step — adds the scanned item to the rental
SetupScanner is not active

Scan Sound

The kiosk plays a short sound on each scan — a confirmation tone on success and a distinct tone on error. You can turn this off with the Scan sound option in the settings.

Timeout Configuration

The delay between keystrokes to consider input as a scan is configurable. The default value is 100 ms, which suits most scanners.

If your scanner sends characters more slowly, you can increase this value via the environment variable:

VITE_SCANNER_TIMEOUT_MS=150

Troubleshooting

ProblemSolution
Scan is not detectedVerify the scanner is in HID (keyboard) mode. Test in a text editor.
Scan is incompleteIncrease the timeout (VITE_SCANNER_TIMEOUT_MS)
Keyboard input triggers scansDecrease the timeout if you previously increased it
"Unknown code" after a scanThe item does not exist in Stockaj — verify it is registered
Scanner does not work on the setup pageThe scanner is disabled on this screen