Sending raw data via usb to linux

I print some shortcuts on a Zebra TLP-2844 printer and do my job fine on windows, sending EPL instructions to a shared USB printer as follows:

type Label.prn> \ my-pc \ zebra

and it seems to work with serial ports with

type Label.prn> COM1

Now I'm trying to do the same on linux, but it gets really hard! My first guess:

cat Label.prn | / dev / bus / USB / 005/002

since my printer is on bus 005, device 002 (checked with lsusb command), but it doesn’t work at all, as I get bad

bash: / dev / bus / usb / 005/002: Permission denied

Any guesses?

+5
source share
4

,

cat Label.prn | /dev/bus/usb/005/002

/dev/bus/usb/005/002, , " ". ,

cat Label.prn > /dev/bus/usb/005/002

, , - , , Linux. , :

lpr Label.prn
+4

, - USB-, "lp", :

$ sudo usermod -aG lp USERNAME

USERNAME .

+2

, .

, TLP2844 USB, arm9 linux.

:

printf "OD\r\nN\r\nD5\r\nS2\r\nZT\r\nQ128, 24\r\nq400\r\nA15,10,0,2,1,1, N,\" TESTE \ "\r\nP1\r\nFE\r\n" > /dev/lp0

... TEST

+2
  • /dev/usb/lp 0: sudo chmod a+w /dev/usb/lp0
  • : cp test.zpl /dev/usb/lp0

Sublime Text, :

{
    "cmd": ["cp", "$file", "/dev/usb/lp0"],
    "encoding": "utf8"
}

, Ctrl + B .

zpl TCP/IP: https://github.com/kashamalasha/AutoIt_ZebraTester

AutoIt Script, AutoIt . , , , , .

+1

All Articles