The Brother QL-700 is a thermal label printer that supports multiple interfacing options, making it suitable for integration with low-power devices like a Raspberry Pi or an ESP32. Below are the possible ways to interface with it, along with code examples.
1. USB Printing (Recommended for Raspberry Pi & ESP32)
The QL-700 supports USB printing via ESC/P (Epson Standard Code for Printers) or Brother's own P-touch language. You can send raw print commands over USB.
Option A: Using pyusb (Python on Raspberry Pi)
Install dependencies:
sudo apt-get install python3-usb
Example code:
import usb.core
import usb.util
# Find the printer (Brother QL-700 Vendor ID: 0x04f9, Product ID: 0x2042)
dev = usb.core.find(idVendor=0x04f9, idProduct=0x2042)
if dev is None:
raise ValueError("Printer not found")
# Detach kernel driver if active
if dev.is_kernel_driver_active(0):
dev.detach_kernel_driver(0)
# Set configuration
dev.set_configuration()
# Send a test print (ESC/P commands)
# Initialize printer
dev.write(1, b'\x1B\x40') # ESC @ (Initialize)
dev.write(1, b'Hello, Brother QL-700!\n') # Print text
dev.write(1, b'\x1D\x56\x41\x00') # Cut command (GS V 0)
Option B: Using CUPS (Linux Printing System)
Install CUPS and the Brother driver:
sudo apt-get install cups
sudo lpadmin -p QL700 -E -v usb://Brother/QL-700 -m brother-ql700-cups.ppd
Print a file:
echo "Test Print" > test.txt
lpr -P QL700 test.txt
2. Network Printing (If Connected via Ethernet/WiFi)
If the printer is on a network, you can send raw print jobs via TCP/IP (port 9100).
Example (Python on Raspberry Pi or ESP32)
import socket
# Printer IP and port
printer_ip = "192.168.1.100"
port = 9100
# Create a socket connection
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((printer_ip, port))
# Send ESC/P commands
s.send(b'\x1B\x40') # Initialize
s.send(b'Hello from Network!\n')
s.send(b'\x1D\x56\x41\x00') # Cut
s.close()
3. Serial Printing (If Using an MCU like ESP32)
The QL-700 does not have a built-in serial port, but you can use a USB-to-Serial (UART) bridge (e.g., CH340, CP2102) with an ESP32.
Example (ESP32 Arduino Code)
#include <HardwareSerial.h>
HardwareSerial SerialPort(2); // Use UART2 (ESP32)
void setup() {
SerialPort.begin(9600, SERIAL_8N1, 16, 17); // RX=16, TX=17
delay(1000);
// Initialize printer (ESC/P)
SerialPort.write(0x1B); SerialPort.write('@');
// Print text
SerialPort.println("Hello from ESP32!");
// Cut paper
SerialPort.write(0x1D); SerialPort.write('V'); SerialPort.write(65); SerialPort.write(0);
}
void loop() {}
4. Using Brother’s SDK (For Advanced Features)
Brother provides an SDK for direct control (Windows/Linux).
Best Choice for Low-Power Devices
- Raspberry Pi: Use USB +
pyusb or CUPS.
- ESP32: Use USB (with USB Host Shield) or Network Printing if available.
Would you like a more specific implementation for a certain use case?