Thermalink

ESC/POS command reference › ESC p

ESC p (1B 70): open the cash drawer from a receipt printer

The cash drawer plugs into the printer's drawer-kick (DK) port. ESC p tells the printer to send it a short pulse, which releases the drawer.

ASCIIESC p m t1 t2
Hex1B 70 m t1 t2
Decimal27 112 m t1 t2

Parameters

mwhich pin: 0 = pin 2, 1 = pin 5. Libraries send either 0x00/0x01 or ASCII "0"/"1" (0x30/0x31); the viewer reads the lowest bit.
t1pulse on time in units of 2 ms.
t2pulse off time in units of 2 ms.

What it does

Nothing prints. The printer just switches the drawer solenoid on for t1 × 2 ms. Try pin 2 first; if the drawer does not open, try pin 5.

Libraries pick different timings. Thermalink sends 1B 70 00 19 FA (50 ms on, 500 ms off). escpos-php's pulse() takes milliseconds, halves them, defaults to 120 ms on and 240 ms off (1B 70 30 3C 78). python-escpos uses 100 ms on and off (1B 70 00 32 32).

Because it goes through the printer, the drawer opens even from a web app, as long as the bytes reach the printer raw. The browser print dialog cannot send it.

Example

The viewer shows the drawer pulse as a marker on the receipt.

43 61 73 68 20 73 61 6C 65 20 31 32 2E 35 30 0A 1B 70 00 19 FA

Preview drawn in your browser by the ESC/POS viewer's engine on 80 mm paper. Letters use a similar monospace font, not the printer's own. Open this example in the viewer to edit the bytes.

How the viewer decodes these bytes
CommandWhat it doesBytes
Text"Cash sale 12.50"43 61 73 68 20 73 61 6C 65 20 31 32 2E 35 30
ESC pOpen cash drawer: pin 2, pulse 50 ms on, 500 ms off1B 70 00 19 FA

Sending it from code

JavaScript (bytes)

const openDrawer = [0x1b, 0x70, 0x00, 25, 250]; // pin 2, 50 ms on, 500 ms off

PHP with escpos-php

$printer->pulse();  // pin 2, 120/240 ms: 1B 70 30 3C 78
$printer->pulse(1); // pin 5

Python (raw bytes)

data += b"\x1b\x70\x00\x32\x32"  # pin 2, 100 ms on, 100 ms off

Common mistakes

Related commands

Sources

I wrote this page from the open-source libraries above, Thermalink's own output and tests on my BIXOLON printer. It is not copied from Epson's manual. For model-specific details see Epson's official ESC/POS reference or your printer maker's manual. Last checked 22 November 2026.

Building receipts byte by byte? Thermalink lets a web app send the receipt as JSON and prints it silently, with QR codes, logos, cut and cash drawer ($49 one-time).