The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Printing 132 characters. Tony Baratta UNIX for Dummies Questions & Answers 3 10-04-2007 11:32 AM
vi : inserting non-printing characters cstovall Shell Programming and Scripting 2 08-29-2005 05:55 PM
lpd printing and a IP based printer on SCO spglass UNIX for Dummies Questions & Answers 6 08-17-2005 12:19 PM
Printing from SCO 5.05... to XP Shared Printer LarryG SCO 2 07-19-2005 01:26 PM
printing control characters mglinsk UNIX for Dummies Questions & Answers 1 09-20-2000 05:42 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-17-2006
Friğrik Friğrik is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 4
Printing 5 raw characters to a printer

Hi there,

I want to open a cash drawer remotely. The cash drawer is commanded by a printer.

I need to connect to the cash drawer which is connected over a network (and shared) and simply send a sequence of five ASCII commands (see http://pages.prodigy.net/daleharris/popopen2.htm) to a printer, for the cash drawer to open.

This is the sequence as indicated by the drawer opening website: 27,112,48,55,121

The printer computer uses a Windows system, and it's shared as: \\KASSI1\Skuffa where KASSI1 is the computer name on the network and Skuffa is the printer name.

Please tell me if you need any more information to help me on this. I've tried the "lpr" command but it seems I didn't get it to work somehow, probably because of an error in my syntax. I haven't found any examples of UNIX-to-Windows raw network printing, and I really hope some of you wizards have some suggestions for me.

Thanks a lot in advance,
Friğrik
  #2 (permalink)  
Old 08-17-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
27,112,48,55,121 contains an 8, so I'm guesssing it's decimal. In octal that would be 033, 0160, 060, 067, 0171. That makes sense because now it is an esacpe sequence: ESC, p, 0, 7, y. You need to look at your echo command because the syntax depends on the shell and the system. But for me...this should work:

echo '\033p07y' | lpr
This sends a newline character after the escape sequence which is probaby needed.
  #3 (permalink)  
Old 08-17-2006
Friğrik Friğrik is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 4
Thanks Perderabo - that makes a lot of sense.

What does not make sense to me is how to use the "lpr" command with a network. I've tried multiple variations, such as:

echo '\033p07y' | lpr -P\\KASSI1\Skuffa

I constantly get:
lpr: error - unable to print file: client-error-not-found

So what am I doing wrong?
  #4 (permalink)  
Old 08-17-2006
Friğrik Friğrik is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 4
Update

Okay, here's a little update. I was playing around and decided to actually set the printer up using Mac's little GUI. I set it up as a Generic PostScript printer, called it Skuffa, and then ran:

echo '\033p07y' | lpr -P Skuffa

It, for the first time, worked! I was happy, until I found out that it had printed meters of some code, starting with the line "%!PS-Adobe-3.0".

Now, I don't want that to happen again. I think my problem was making the printer into a Generic PostScript printer instead of just a Generic one.

Are there any other tips you'd like me to consider about this command before I try this again?

(the register that this is connected to is actually being used at the moment, but I'd really like to finish this functionality today)
  #5 (permalink)  
Old 08-17-2006
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Location: Ashburn, Virginia
Posts: 9,119
Sorry, I don't know how to set up printers on a mac.
  #6 (permalink)  
Old 08-17-2006
Friğrik Friğrik is offline
Registered User
  
 

Join Date: Aug 2006
Posts: 4
Solved.

The problem was not anything about the printer setup. I wasn't using the -oraw parameter (which makes it a raw command). This is the solution then:

Open drawer: echo -e "\033\160\060\067\171" | lpr -P Skuffa -oraw
Receipt cutter: echo -e "\033\155" | lpr -P Skuffa -oraw

Thank you for your help.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:48 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0