question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Epson TM-T88III via /dev/ttyUSB0

See original GitHub issue

Last 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:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
skeritcommented, Jul 18, 2019

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 appendFile modification.

The easiest way to test if this would work is to simply echo to the device file, like:

echo "Testing!" >> /dev/ttyUSB0

Other device files could be /dev/usb/lp0 for usb printers? Don’t know where parallel ports would go…

0reactions
stale[bot]commented, Oct 26, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

usbserial pl2303 with connected epson tt88iii printer ...
this post concerns an EPSON TM-T88III printer which I am not able to print on. The connection works upon a usbserial interface using...
Read more >
TM-T88V-DT for Linux Technical Reference Guide - Epson
This manual was created to provide information on development, design, and installation of receipt issue systems and development and design of printer ...
Read more >
Printing to an ESC/POS Receipt Printer from Linux
I happen to have an EPSON TM-T88III thermal printer that uses the ESC/POS control language ... stty -F /dev/ttyUSB0 9600 cs8 -cstopb -parenb....
Read more >
Thermal Printer driver for CUPS, Linux, and Raspberry Pi: zj-58
I'm using the TTL JP-701 printer (serial:/dev/serial0?baud=9600), and while following your guide, I only get as far as the last screen of the ......
Read more >
TM-T88II/T88III Technical reference guide - IO.cz
This manual describes the TM-T88III, a current EPSON thermal printer product. ... installation, and application of the printer for designers and developers ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found