Talk:Label printer



Here's a placeholder thing for my label printer shennanigans. I wanted to start documenting how to make one of these things work so others might be saved the suffering I was subjected to.

I'm only starting this after having figured it out on my local machine, basically that process went like:
 * plug in label printer to power and usb
 * plug usb into computer
 * try printing label
 * waste a label and fail
 * try again
 * fail and swear
 * try once more with slightly different settings
 * fail and swear
 * try once more with a different driver version (z something)
 * finally see ink on a label, but the wrong way 'roung. fail and swear.
 * repeat the above until the correct driver, rotation settings, autoscaling, label top position and all that is set up in JUST the right way, and print a label.

I'm about to make the IBM x-series 345 upstairs the label printer driver, lets see how it goes! The x-series is running ubuntu 12.04 and the label printer is a zebra gk420 i think. here goes
 * make sure it has cups, it does
 * try and get at the cups web i/f...
 * Get the cups web I/F up and running by ssh tunneling to the server like: (assumes you have SSH access)
 * ssh -L 6310:localhost:631 rusername@ibm-x345.readinghackspace.org
 * Right, cups web i/f is running. go administration, add printer
 * Login as me, FAIL.
 * add me to group lpadmin using gpasswd -a username lpadmin
 * select 'Zebra Printer (Zebra Technologies ZTC GK420t)' from 'discovered network printers'
 * name it, next step
 * select 'ZPL' driver, next step
 * set default options for zebra printer
 * Label top = 50 (under 'default options' 'printer settings')

Right, so on my local machine I had to do something in ubuntu's print configuration bollocks to disable autorotation. i can't find that on cups pages anywhere. More hunting to be done, for now...that's it!

Next episode, figuring out how to do that above, copying the SVG files and scripts over from my local machine, and doing a test print!

Episode 2!! Found that setting. It turns out ubuntu's system-config-print can add options to the /etc/cups/printers.conf that cups web interface doesn't know about (WTF.)

I see in my local printers.conf:  UUID urn:uuid:786510d0-91aa-3c28-7772-b45f7593ab07 Info Zebra Technologies ZTC GK420t MakeModel Zebra ZPL Label Printer DeviceURI socket://178.238.150.236 State Idle StateTime 1352237763 Type 36932 Accepting Yes Shared No JobSheets none none QuotaPeriod 0 PageLimit 0 KLimit 0 OpPolicy default ErrorPolicy retry-job Option orientation-requested 3 

That last bit, 'Option orientation-requested 3', I can't find anywhere on the CUPS interface, but it's here: http://www.cups.org/documentation.php/options.html

Cool. So, all I should need to do is add that to the end of the config on the server and do some test prints with my SVG file.

Episode 3:

Right, i've copied across the shell script that i've used to print the labels It looks like this
 * 1) !/bin/bash

TODAY=$(date +%D) USER=$(whoami)

qrencode -o test.png -s 5 http://readinghackspace.org.uk/qr/$1

cat drawing4.svg | sed s/baconmonkeys/$1/ | sed s/HACK/$2/ | sed "s|datedate|$TODAY|" | sed "s|Nameface|$USER|"| inkscape --without-gui --export-pdf=/dev/stdout /dev/stdin | lpr

I've installed the packages I need (qrencode and inkscape)

I've copied across the SVG drawing4.svg which links to the test.png image created by qrencode

Right, so after editing some file paths and making lpr print to the right printer, it works!

Go team labelprinty.