-
Notifications
You must be signed in to change notification settings - Fork 1
Scanner Setup
This guide explains how to configure physical 2D barcode scanners to transmit ANSI MH10.8.2 / ISO/IEC 15434 DataMatrix barcodes into InvenTree without data loss, how SmartParts captures keystroke wedge bursts, and how native InvenTree barcode discrimination and context-aware panel suppression operate.
When scanning component packaging from distributors (Mouser, DigiKey, LCSC, element14, TME) or semiconductor reels (Texas Instruments, STMicroelectronics, Microchip), data fields (MPN, Quantity, Batch, Supplier SKU) are delimited by an invisible ASCII control character: the Group Separator (GS), represented as \x1D (ASCII 29).
By default, most handheld 2D barcode scanners (e.g., Netum L8BL Pro, Zebra DS2208, Honeywell Xenon) operate in USB Keyboard Emulation (HID Wedge) mode. Because \x1D is an invisible non-printable control character, standard operating systems (Windows, macOS, Linux) swallow it entirely.
Without delimiters, a barcode containing:
[)>06 1PSTM32F103C8T6 Q10 1T2134 30PMSR123
Arrives at the host browser as an unbroken string:
[)>061PSTM32F103C8T6Q101T213430PMSR123
While SmartParts includes a fallback heuristic parser capable of isolating strong prefix boundaries (1P, Q, 1T, 30P), configuring hardware character replacement ensures instant, 100% deterministic parsing.
Configure your physical scanner firmware to intercept the invisible \x1D character internally and convert it into a printable character before transmitting keystrokes over USB or Bluetooth.
SmartParts natively supports the Tilde (~) as the standard replacement for the Group Separator.
- Refer to the official Netum Edit - Replace Plugin Documentation.
- Scan the setup barcode to enter Program Mode.
- Scan the barcode to enable the Character Replace feature.
- Set the replacement rule:
-
Target Character (HEX):
1D(Invisible ASCII Group Separator) -
Replacement Character (HEX):
7E(Printable ASCII Tilde~)
-
Target Character (HEX):
- Scan the Save & Exit barcode on your scanner programming card.
- Open Zebra 123Scan on your workstation.
- Create or modify a configuration profile for your scanner model.
- In Modify Data > Advanced Data Formatting (ADF), add an action:
-
Replace String:
\x1Dwith~
-
Replace String:
- Load the configuration profile onto the scanner via USB or print the generated programming barcode sheet.
- Open Honeywell EZConfig for Scanning.
- Navigate to Data Formatting > Format Editor.
- Create a replacement rule replacing ASCII character
29(0x1D) with ASCII character126(0x7E,~). - Save and transmit to the scanner.
- Open Datalogic Aladdin.
- Navigate to Data Editing > Character Replacement.
- Map character
0x1Dto0x7E. - Apply the configuration.
Verify your hardware setup directly inside SmartParts without opening an external serial terminal:
- In InvenTree, navigate to SmartParts Dashboard (
/plugin/smartparts/). - Open API Settings > Scanner Diagnostics.
- Scan a component label or distributor reel barcode.
- Confirm that tilde (
~) delimiters appear between vendor fields:[)>06~1PSTM32F103C8T6~Q10~1T2134~30PMSR123 - When verified, SmartParts' stage-1 ANSI parser extracts MPN, quantity, batch, and SKU instantaneously.
SmartParts injects a global hardware scanner wedge listener into the InvenTree web frontend (/web/...). Users can scan barcodes from any page (part details, stock views, purchase orders, dashboards, or settings) without clicking an input field or opening a modal first.
Hardware scanners transmit characters at rates far exceeding human typing speeds:
-
Inter-Key Threshold (
MAX_INTER_KEY_MS): Keystrokes occurring less than50msapart are flagged as scanner activity. -
Burst Ratio Gate: At least
80%of keystroke intervals in a sequence must be< 50ms. -
Minimum Scan Length (
MIN_SCAN_LENGTH): Minimum4characters before evaluation. -
Termination: Scans complete when the scanner emits a carriage return / enter (
Enter). -
Idle Timeout (
IDLE_RESET_MS): A pause of600msresets the internal buffer if a scan was interrupted. -
Active Input Element Protection: If the user has cursor focus in an
<input>or<textarea>when a barcode is scanned,scanner_global.jssnapshots the field's initial content and restores it once the scan is recognized. This prevents high-speed barcode characters from corrupting forms.
When internal InvenTree barcodes or QR codes are scanned, SmartParts discriminates internal database objects from distributor MPNs. Internal payloads are routed immediately to the native React UI without opening the SmartParts part creation wizard:
| Payload Format | Internal Object | Navigation Route |
|---|---|---|
{"stocklocation": <id>} or INV-SL<id>
|
Stock Location | /web/stock/location/<id>/ |
{"stockitem": <id>} or INV-SI<id>
|
Stock Item | /web/stock/item/<id>/ |
{"part": <id>} or INV-PA<id>
|
Internal Part | /web/part/<id>/ |
{"purchaseorder": <id>} or {"purchase_order": <id>}
|
Purchase Order | /web/purchasing/purchase-order/<id>/ |
{"build": <id>} or {"build_order": <id>}
|
Manufacturing Build Order | /web/manufacturing/build-order/<id>/ |
{"salesorder": <id>} or {"sales_order": <id>}
|
Sales Order | /web/sales/sales-order/<id>/ |
{"returnorder": <id>} or {"return_order": <id>}
|
Return Order | /web/sales/return-order/<id>/ |
{"supplierpart": <id>} or {"supplier_part": <id>}
|
Supplier Part | /web/purchasing/supplier-part/<id>/ |
{"manufacturerpart": <id>} or {"manufacturer_part": <id>}
|
Manufacturer Part | /web/part/manufacturer-part/<id>/ |
Important
Internal Payload Protection: Any payload formatted with internal JSON keys ({"purchaseorder": ...}, {"stocklocation": ...}) or INV- short codes is strictly classified as internal. If the referenced object has been deleted or cannot be found, an informational warning toast is displayed. Under no circumstances will SmartParts attempt to look up or create an internal JSON string as a component MPN.
When scanning distributor component packaging (Mouser, DigiKey, etc.):
-
On General InvenTree Pages: If the component exists in InvenTree, the user is navigated directly to
/web/part/<id>/. If unknown, a confirmation modal appears prompting to import the part via SmartParts. -
On SmartParts Pages & Panels (
isSmartPartsActive()): When already viewing the SmartParts Dashboard (/plugin/smartparts/) or an embedded panel (#sp-root,data-smartparts-panel,#searchForm), the global redirect/modal prompt is completely suppressed. The scanned MPN is forwarded directly to the active panel's search input (#sp-mpn) or search function (_smartparts_panel_search(mpn)), initiating lookup without intrusive popups.
-
PureScan Terminal Exclusion: On the dedicated kiosk route (
/plugin/smartparts/purescan/),scanner_global.jsyields immediately, allowing PureScan's zero-click terminal engine to take exclusive control. -
Event Deduplication: Events flagged with
e._handledBySmartParts = trueorwindow._smartparts_local_scanner_active = trueare bypassed by the global listener to prevent double-processing.
- Learn how to operate the zero-click kiosk terminal in The PureScan Terminal.
- Review parameter filtering and normalizer behaviors in Parameter Engine & Normalization.
- Review overall plugin data pipeline in Architecture Overview.
-
🚀 Getting Started
-
💻 User Guide
-
🔧 Hardware & Admin Guide
-
🛠️ Developer Documentation