rcmadruga
rcmadruga

Reputation: 847

Reading Zebra printer status via USB on Ubuntu

After a lot of posts in SO and Google, I could not find an answer to my problem. Most of similar questions are Windows/VB/.Net/C#/Java centric.

I need to send an ESC command to a Zebra USB printer (TTP2130) and get the status back using C/C++ . I am able to print fine (with Zebra generic driver set as default printer) using:

$ lpr file.prn 

Used Zebra Toolbox to communicate in Windows and generate *.prn files with ESC commands.

But if I sent a file with a command that needs response from printer, nothing happens.

What would be the best approach to accomplish this? Maybe using libusb1.0 directly?

Thanks for any help!

Upvotes: 3

Views: 3111

Answers (2)

garzanti
garzanti

Reputation: 2190

Well I had a similar issue and in the end this post helped me a lot: https://blog.peter.skarpetis.com/archives/2005/04/07/getting-a-handle-on-usbprintsys/ it is Windows centric but the principle is the same also on Linux and Mac.

Upvotes: 2

rcmadruga
rcmadruga

Reputation: 847

Found a solution after searching for 'Swecoin'. This is the old manufacturer of Zebra's TTP line of printers. Swecoin on Wikipedia.

This guy made a simple and direct app to communicate with TTP printers (ttputil): http://www.rainbow-software.org/linux/

After downloading and compiling, I was able to send commands directly:

sudo ./ttputil enquiry sensor /dev/usblp0

I will modify its code to fit my needs.

Unfortunately, I haven't found a way to contact (and thank) the original developer from his website.

Upvotes: 4

Related Questions