Epson TM-T88III via /dev/ttyUSB0
See original GitHub issueLast week I got a new Epson TM-T20II to work with node-thermal-printer over an ethernet connection. It really does work great.
But now I have an older device, an Epson TM-T88III with a serial-port connection. I’m ussing a serial-port-to-usb device to connect it to my computer, so I’m trying to connect to /dev/ttyUSB0 like this:
let printer = new ThermalPrinter({
type: PrinterTypes.EPSON,
interface: '/dev/ttyUSB0',
});
// This is always true, even when the printer is off. I think it only tests if the /dev/ttyUSB0 file exists?
let isConnected = await printer.isPrinterConnected();
printer.alignCenter();
printer.println("Hello world!");
printer.cut();
try {
let execute = printer.execute()
let result = await execute;
console.error("Print done!", result);
} catch (error) {
console.log("Print failed:", error);
}
The printer does absolutely nothing. This script eventually times out with this error:
Print failed: { [Error: ESPIPE: invalid seek, write] errno: -29, code: 'ESPIPE', syscall: 'write' }
I added my user to the required groups, set the correct permissions on the /dev/ttyUSB0 file and all, but still nothing happens.
I saw node-thermal-printer was tested on a TM-T88V, so I was kinda hoping it would just work with an earlier version of that. Is it too old? Or is something going wrong with the connection to the serial port somehow?
Edit: I added the debug option to the write-file-queue instance, and that gave some more info:
Attempting to write to file #0 @ 1563358688918
Callback from writeFile for file #0 @ 1563358689187
Error occurred for writeFile for file #0 @ 1563358689187
{ [Error: ESPIPE: invalid seek, write] errno: -29, code: 'ESPIPE', syscall: 'write' }
Issue Analytics
- State:
- Created 4 years ago
- Comments:6

Top Related StackOverflow Question
Well, unfortunately I only have an RS232 and an ethernet printer to test on, but if issue #58 is any indication it should all work the same way: just use it as a file, but with the
appendFilemodification.The easiest way to test if this would work is to simply echo to the device file, like:
Other device files could be
/dev/usb/lp0for usb printers? Don’t know where parallel ports would go…This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.