Ticket printer testing and configuration

From LaneWiki

Jump to: navigation, search

We assume that the software is already comfigured and working for this documentation to be valid

Contents

Epson TM-U200B

Testing

cd /opt/LanePOS/tests/
./printer-tester.t Epson::TMU200 < /etc/passwd > /dev/<serial port>

Configuring an existing installation to use the printer

The register device configuration is stored in the SysString register-initMachine-default.

http://l-ane.net/develop/docs/podded/LanePOS/Devices/GenericPrinter.pm.html#USAGE

Changing to non-standard dev nodes (pipes, fifos, etc)

I had to change the line of perlcode that opens the printer device file from open("devname") to open(">devname"). I think that what was wrong, was that the open() is a blocking call, and a fifo is never "done". ???

This bug is a know bug in the installer: It's fixed in HEAD (so the fix will be in the next release). The previous (mailing list) discussion is here and the task which fixed it is bug 67. In fact, the installer created open() will not work with any device as the default open() is opening for reading.

I have some serious evil nasty stuff (behind an FIFO) 'cause we have L-ane running on top of LTSP. See Notes on creating a nc pipe as a printer --Shrike 20:54, 18 Nov 2005 (EST)

You should be able to use one of the following to print to an ethernet printer (BBS uses one or both of these):

 use IO::Socket::INET;
 $PrinterDev = IO::Socket::INET(PeerAddr=>'printserver.you.tld:9100', Proto => 'tcp');

or (if you want a subprocess to handle everything):

...->open("|nc printserver.you.tld 9100");

Print Options

Printing Only On Demand

Although there isn’t a single option to enable printing only on demand, it is fairly easy to accomplish. First, disable the primary printer:

In SysString:register-initMachine-default, change the default printer device to /dev/null

 $PrinterDev->open(">/dev/ttyS0");

to

 $PrinterDev->open(">/dev/null");

Next, define $printer2 (again, in SysString:register-initMachine-default) to be the actual printer. Register’s reprintProcess() uses $printer2 to print its tickets. Make sure to remove the typeglob-aliasing line (*printer2 = *printer;)!

Then, add a button to your touch screen to run the reprint command:

 item = Ticket\nPrint
 foreground = black
 background = white
 command = if($#{$reg->{'sale'}{'items'}} == -1){return 0 if !$reg->{'sale'}->open($amt ? $amt : $main::lastTicketNumber); $reg->reprintProcess(, "Reprinted\n"); $reg->newTranz(); }

We have made the following work: It does not check or clear if in the middle of something.

 command = $reg->{'sale'}->open($amt ? $amt : $main::lastTicketNumber);$reg->reprintProcess()


To use the button, enter the ticket number to print, then press "Ticket Print". This button only works at the begining of a sale. To automatically print the last ticket number without entering the ticket number, add the following to your SysString:register-initMachine-default

 $useResetCode = 1;
 $resetCode = '$main::lastTicketNumber = $me->{"sale"}{"id"};';
Example register-initMachine-default
Example register-touch-functionpagesetup


Note: If your cash drawer is attached to your primary receipt printer, you will need to alias $drawer to $printer2 rather than the default $printer. Something like the following:

 *drawer = *printer2;
Personal tools