Printing KOT & Receipts from React Native: BLE, ESC/POS, and Real-World Pitfalls
A field guide to building reliable Bluetooth thermal printing for restaurants — including separate KOT and receipt flows.
📋 Table of Contents
💡 What You'll Learn
A field guide to building reliable Bluetooth thermal printing for restaurants — including separate KOT and receipt flows.
Thermal printing looks simple until you add two printers, unreliable Bluetooth, and kitchen heat. Here’s how we built KOT (Kitchen Order Ticket) and receipt printing that just works.
Architecture
- BLE layer:
react-native-ble-plxto scan/connect and maintain device registry. - Print driver:
react-native-thermal-printerwith an adapter that formats ESC/POS commands. - Manager: A
PrinterManagersingleton keeps state for receipt and KOT printers separately. - Queue: A job queue with retries, back-off, and idempotency.
KOT vs Receipt
KOT: fast, minimal output — table, items, qty, modifiers, order notes, timestamp, and docket number.
Receipt: totals, tax, discount, payment method, QR (UPI), branding, and optional footer.
We maintain two templates and two queues. KOT prints immediately when the order is confirmed; receipts print after payment confirmation.
Reliability Tactics
- Sticky connections: Auto-reconnect when RSSI drops. Persist
deviceIdby role. - Idempotent commands: Wrap jobs with IDs and dedupe; safe to retry after partial prints.
- Gap sensors & paper: For label printers, send feed commands to align between prints.
- Watchdogs: Detect stalled transfers; reset connection and resume.
Formatting Tips
- Use a monospace layout or width-aware functions for 58mm printers.
- Map Unicode to printer code pages; pretest common glyphs (₹, ₹ with spaces, diacritics).
- Print QR for UPI and barcode for invoice lookup.
- Add cut and feed smartly; avoid cutting mid-ticket.
Testing Checklist
- [ ] Print with low battery and weak signal
- [ ] Long item names & multi-byte characters
- [ ] Burst prints at peak hours
- [ ] KOT only includes items after “Print KOT” action
- [ ] Graceful handling when a printer is offline
With a clean separation of concerns and defensive retries, BLE printing can be rock-solid even on busy nights.
Building a React Native app with hardware or printer integrations? Explore CloudMyle's mobile app development services in Hyderabad.
📚 Continue Reading
How Long Does It Take to Develop a Mobile App? (2026 Guide)
Most apps take 8–24 weeks to build. See 2026 mobile app development timelines by type, the 5 build stages, and how to la…
How Much Does Mobile App Development Cost in India in 2026?
How much does app development cost in India in 2026? From a ₹2L MVP to a ₹25L+ enterprise app — by platform, complexity,…
Implementing Subscriptions in React Native (2025): iOS & Android, Cleanly
A unified approach to monthly/yearly plans using react-native-iap, receipts validation, and upgrade/downgrade flows.
