This is another question about my raw printer. The following command works perfectly:
cat temprint.txt > /dev/usb/lp0
and I've managed to get the hex characters going over to it to operate the cutter and to open the cash drawer.
The printer is set up in CUPS as raw, queue raw. Its connected using one of those usb to parallel adaptors - usb at the PC and parallel at the printer.
However, there is one remaining flaw. It only seems to work if the printer itself is powered on at startup of the pc. Why? Is there a shell command I can execute that will do whatever it is that is done at startup to get the system to know that the printer is there? And how would you test for whether this has been done?
I have in mind, when the system is started, check to see if they have the printer turned on, if not beep at them, tell them to turn it on, then when they click the button saying, OK its on now, execute whatever this shell command is....
Thanks
Peter
If you check the dmesg when you plug in the printer to see if the kernel "sees" the printer if so you can then run a script setup in either udev or some such depending on your distro.
Hope that helps, if you need a hand writing the script just say.
Regards Ian Porter
www : www.codingfriends.com
On 1 Feb 2010, at 08:16, Peter Alcibiades <palcibiades- first@yahoo.co.uk> wrote:
This is another question about my raw printer. The following command works perfectly:
cat temprint.txt > /dev/usb/lp0
and I've managed to get the hex characters going over to it to operate the cutter and to open the cash drawer.
The printer is set up in CUPS as raw, queue raw. Its connected using one of those usb to parallel adaptors - usb at the PC and parallel at the printer.
However, there is one remaining flaw. It only seems to work if the printer itself is powered on at startup of the pc. Why? Is there a shell command I can execute that will do whatever it is that is done at startup to get the system to know that the printer is there? And how would you test for whether this has been done?
I have in mind, when the system is started, check to see if they have the printer turned on, if not beep at them, tell them to turn it on, then when they click the button saying, OK its on now, execute whatever this shell command is....
Thanks
Peter
main@lists.alug.org.uk http://www.alug.org.uk/ http://lists.alug.org.uk/mailman/listinfo/main Unsubscribe? See message headers or the web site above!
Peter Alcibiades wrote:
This is another question about my raw printer. The following command works perfectly:
cat temprint.txt > /dev/usb/lp0
and I've managed to get the hex characters going over to it to operate the cutter and to open the cash drawer.
The printer is set up in CUPS as raw, queue raw. Its connected using one of those usb to parallel adaptors - usb at the PC and parallel at the printer.
Refer to my messages on the 26th of November
Your problem is that when you cat to the raw device you aren't actually using the cups spooler at all, so there is no job management. You will also run into problems if say the printer is powered but unable to accept a job because it is (for example) out of paper, as then your cat will probably just sit there blocking everything else until the printer can print.
If the printer is configured as a raw device in cups and raw support is enabled then you should be doing lp -dprintername temprint.txt
Then cups will manage the task of spooling the job until the printer is online and it should all be managed properly.
I see this is for a receipt printer because you are sending cutter and drawer kick commands, you aren't hacking receipt printing support onto phppointofsale are you ? If so I probably still have the stuff from when I did that about 4 years ago, no doubt it would need updating and it is so nasty it never got accepted as a patch to the main project :)