Vending/Dispenser Controller, Serial Protocol, Cash Payout & Receipt Printing
An airport self-service retail/kiosk platform
Overview
The control service for the vending/dispenser hardware (Romanian “tonomat”) inside the kiosk. It drives the physical dispenser and cash-payout mechanism over a serial protocol and prints receipts, exposing these operations to the rest of the platform over RPC.
Why It Exists
Dispensing product and paying out cash safely requires precise, framed serial communication with electromechanical hardware, plus reliable queuing so commands are not lost or duplicated. This service encapsulates all of that behind a clean local API. It has the longest active history in the cluster (2017–2020), reflecting ongoing operation and hardening.
What We Built
A Node.js Restify service with a structured device library (lib/): a dispenser and a serial master/serial-helper layer, packet-utils with CRC framing for the wire protocol, a queue and task model for sequencing commands, plus constants, errors and a logger. Receipts print via escpos to thermal printers, serialport handles the hardware link, and Redis (redis/hiredis) backs queuing/state. A separate payoutd daemon manages cash payout, with run.js/run.sh as entry points.
Technologies & Approach
Node.js + Restify, serialport for the hardware link, crc and bufferput for binary packet framing, escpos for receipt printing, and Redis for queuing and shared state, with bluebird and lodash for control flow. A dedicated, queued service was the right model for low-level, safety-sensitive hardware that must process one command at a time.
Outcome / Impact
Powered the physical transaction layer of the kiosk, dispensing, cash payout and receipts, and was maintained over several years of real-world operation.
Capabilities Demonstrated
- Driving electromechanical hardware over a custom serial/CRC protocol
- Automating cash payout with a dedicated daemon
- Thermal (ESC/POS) receipt printing
- Redis-backed command queuing for safety-critical device control