Hardware Setup
The POS Terminal integrates with thermal receipt printers, cash drawers, and barcode scanners. This guide covers the configuration and testing for each device type.
Thermal Receipt Printer
The system supports ESC/POS compatible thermal printers connected via USB or network (TCP/IP). Most popular models from Epson, Star Micronics, and Bixolon are compatible.
USB Printer Setup:
- Connect the printer to the POS terminal via USB.
- On Linux, ensure the current user has permission to access USB devices. Add the user to the
lpgroup:sudo usermod -aG lp $USERand log out/in. - Identify the device path (e.g.,
/dev/usb/lp0) or uselsusbto find the vendor and product IDs. - In the store server
.envfile, set:PRINTER_TYPE=usbandPRINTER_DEVICE=/dev/usb/lp0.
Network Printer Setup:
- Connect the printer to the store's local network and assign a static IP address through the printer's configuration menu.
- Verify connectivity:
ping <printer-ip>andnc -z <printer-ip> 9100(port 9100 is the standard raw printing port). - In the store server
.envfile, set:PRINTER_TYPE=network,PRINTER_HOST=192.168.1.100, andPRINTER_PORT=9100.
Cash Drawer
Cash drawers are typically connected to the receipt printer via an RJ-11 cable (the "kick" connector on the back of the printer). When the system sends a receipt to print, it also sends the cash drawer open command. No separate driver or configuration is needed -- the drawer opens automatically when the printer receives the ESC/POS drawer kick command.
If your cash drawer connects directly to the terminal via USB, set CASH_DRAWER_TYPE=usb and CASH_DRAWER_DEVICE=/dev/usb/drawer0 in the .env file. Most configurations use the printer-connected approach.
Barcode Scanner
USB barcode scanners that operate in keyboard emulation mode (HID) work out of the box with no configuration. The scanner types characters into whatever input field has focus, just like a keyboard. The POS Terminal is designed to accept this input on the main sale screen.
For best results:
- Configure the scanner to add a newline (Enter) suffix after each scan. This triggers the product lookup automatically.
- Set the scanner to keyboard emulation mode if it is not already (consult the scanner's manual for the mode-switching barcodes).
- Avoid scanners that require proprietary drivers, as they may not work on Linux.
Testing Hardware
The store server includes a hardware test utility. Run:
cd apps/store-server
cargo run -- test-hardwareThis command tests each configured device: it sends a test page to the printer, triggers the cash drawer, and waits for a barcode scan. Follow the on-screen prompts to verify each device is functioning correctly. If any test fails, check the connection and configuration settings described above.