💰 RawBT Example 06 - Cash Drawer Control
⚠️ Important: Cash drawer must be connected to the printer's RJ11/RJ12 port. Not all printers
support cash drawer triggering.
Open Cash Drawer:
Methods:
// Method 1: Using job function
job.openDrawer();
// Method 2: With parameters
job.openDrawer(0, 50, 200); // pin, on-time, off-time
// Method 3: Raw ESC/POS command
job.raw([0x1B, 0x70, 0x00, 0x19, 0xFA]);
// ESC p m t1 t2
// 0x1B 0x70 = Command
// 0x00 = Pin 0 (or 0x01 for Pin 1)
// 0x19 = On time (25ms × 25 = 625ms)
// 0xFA = Off time (250ms × 250 = 62.5s)
ESC/POS Drawer Commands:
| Command |
Bytes |
Description |
| ESC p 0 |
1B 70 00 19 FA |
Open drawer (Pin 0) |
| ESC p 1 |
1B 70 01 19 FA |
Open drawer (Pin 1) |
Try Different Pins:
💡 Tip: If Pin 0 doesn't work, try Pin 1. Some cash drawers are connected to different pins.
Open Before/After Print: