Back to Blog
technicalmobile-dev

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.

CloudMyle Team
8/18/2025
1 min read
Reading time: 1 minutes

💡 What You'll Learn

A field guide to building reliable Bluetooth thermal printing for restaurants — including separate KOT and receipt flows.

Printing KOT & Receipts from React Native: BLE, ESC/POS, and Real-World Pitfalls

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-plx to scan/connect and maintain device registry.
  • Print driver: react-native-thermal-printer with an adapter that formats ESC/POS commands.
  • Manager: A PrinterManager singleton 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 deviceId by 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.

🎯 Key Takeaways

  • Expert insights on technical development
  • Practical implementation strategies
  • Best practices from industry professionals
  • Actionable steps for your next project

📚 Continue Reading

Related Article 1

Discover more insights on technical development...

Related Article 2

Discover more insights on technical development...

Related Article 3

Discover more insights on technical development...

🏷️ Topics Covered

react-nativebluetooththermal-printerescposkotreceipt

📊 Article Stats

Word Count291
Reading LevelIntermediate
Categorytechnical

🚀 Ready to Build Something Amazing?

Transform your ideas into reality with CloudMyle's expert development team. From custom software to mobile apps, we've got you covered.

💝 Found this helpful? Share it!