Solved

No Portrait prints from Brother printer on Solaris

Posted on 2004-10-20
7
714 Views
Last Modified: 2013-12-21
Hi,

We are running Solaris 8 and are having problems printing with certain Brother printers. The prints come out fine in when sent to the landscape queue, but when sending a print to the portrait queue, the data light on the printer just flashes once, then nothing comes out.

We have checked the script for this specific queue in /etc/lp/interfaces, but everything looks fine. We used the same method for setting up the printer and queue as we do with all our printers and they all have no problems printing from both landscape and portrait.

The printers having the problems are all the same make and model (Brother HL6050).

I've tried changing the emulation settings etc but with no joy (it's currently set at auto (epson), but have tried hp and all the other options).

I've tried just abouit everything I can think of from the manual but still with no joy.

Any ideas?

Cheers.
0
Comment
Question by:Grass-hopper
  • 4
  • 3
7 Comments
 
LVL 20

Expert Comment

by:tfewster
ID: 12357315
> We used the same method for setting up the printer and queue as we do with all our printers

What method was that? Admintool/running lpadmin/editing printcap/Epson supplied tool?

And how are you generating the prints? Are they Postscript or "text"; Have you tried printing from the command line with
lp -d printername -o portrait     # Assuming the printer driver recognises the options "portrait" & "landscape"
0
 

Author Comment

by:Grass-hopper
ID: 12358155
Thanks for the reply.................

> What method was that? Admintool/running lpadmin/editing printcap/Epson supplied tool?

Using command line, i.e..................

# >/dev/remote_name
# chmod 666 /dev/remote_name# lpsystem -t bsd remote_name
# lpadmin -p remote_name -s remote_name\!lpaf
# accept remote_name
# enable remote_name

Then setup queues........

# lpadmin -p new_portrait_queue -v /dev/remote_name -m netbasic_port -D "HL6050 portrait"
# vi /etc/lp/interfaces/new_portrait_queue (add remote_name at SEND QUEUE=...........)
# enable new_portrait queue
# accept new_portrait_queue

same done for landscape apart from substituting new_portrait_queue name and also netbasic_port for netbasic_land.

Tried using admintool - setup fine but same problem. Although didnt have this epson supplied tool - what is this and is it freely available?


> And how are you generating the prints? Are they Postscript or "text"
text.

>Have you tried printing from the command line with # lp -d printername -o portrait
yes - still no joy.

Cheers.
0
 
LVL 20

Expert Comment

by:tfewster
ID: 12362694
OK, you have a straightforward setup - Using a remote system as a print server, so the formatting/encoding for the printer model is done on that printer.  Is the remote system a Unix system? i.e. Can you log into that and check that the `lp .. -o port ...`  works?  If so, there isn't a problem with the printer or driver on the print server.   If it's not a Unix box, what is it?  If it's Windows, you may need to enable Passthrough printing.

The next thing I would try is `lp -d new_landscape_queue -o portrait` to see if the script "netbasic_land" passes the options through.  If not, try creating a queue using the "netstandard" model and see if that passes the options.

You should also look at the model scripts in /etc/lp/model; I'd expect  netbasic_land and netbasic_port to be almost identical scripts, except they may have defaults hardcoded in them - i.e. Landscape & Portrait respectively. (Or look at the "copies" you've made in /etc/lp/interfaces - new_portrait_queue and new_landscape_queue)

What I meant about Epson setup tools (actually, I should have said Brother) was that some printer manufacturers (e.g. HP and Lexmark) supply their own "interface" that calls lpadmin - Which is usually an unnecessary complication, but they will also supply model scripts that take advantage of all the printer features, e.g. fonts, duplex printing.  I don't know if your netbasic_land and netbasic_port scripts were supplied by Brother - I've not seen them before

Incidentally, do those printer scripts work for _other_ Brother printer models?  I'll look for some info on the HL6050 just in case it has any funnies...

I should also have asked if the print job remains in the queue (`lpstat -t`) or disappeared...
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:Grass-hopper
ID: 12367774
It's a Network printer, used for both printing from the Unix system and users desktops (windows).

here is the new_landscape_queue script...............

#! /usr/bin/ksh
#
# This interface script was written to be used when printing to network
# printers which have predefined queues. Script allows for escape sequences
# to be sent as part of print, e.g toggle to landscape, change font, etc.
# Note, it does not do anything fancy like banners since it was primarily
# written for a system which does not request printer options.

# set up paths and variables
SEND_QUEUE=remote_name
TEMPPATH=/tmp
ORIGID=$1
COPIES=$4
BANNER=nobanner
PRE_PRINT_FILE=${TEMPPATH}/${SEND_QUEUE}_pre_esc
POST_PRINT_FILE=${TEMPPATH}/${SEND_QUEUE}_post_esc

>${PRE_PRINT_FILE}
echo "\033&l1O\033(s13H\033&a05L\c" > ${PRE_PRINT_FILE}
>${POST_PRINT_FILE}
echo "\033&l0O\033(s10H\033&a0L" > ${POST_PRINT_FILE}

# move to first FILE to print
shift; shift; shift; shift; shift
FILES="$*"
for NXTFILE in $FILES
do
   # echo ""
   # FILENAM=`basename $NXTFILE`
   # MSGLOG=${TEMPPATH}/${FILENAM}.`echo $ORIGID`.log
   # LPLOG=${TEMPPATH}/${FILENAM}.`echo $ORIGID`.lplog
   MSGLOG=${TEMPPATH}/`echo $ORIGID`.log
   LPLOG=${TEMPPATH}/`echo $ORIGID`.lplog
   rm $MSGLOG $LPLOG >/dev/null 2>&1
   cnt=1
   while [ $cnt -le $COPIES ]
   do
      cat ${PRE_PRINT_FILE} $NXTFILE ${POST_PRINT_FILE}  | lp -d${SEND_QUEUE} -o
 ${BANNER} >>$LPLOG 2>&1
      LPHEAD=`head -1 $LPLOG`
      DUM1=`echo $LPHEAD | cut -f1 -d" "`
      if [ "$DUM1" = "request" ]
      then
         REQID=`echo $LPHEAD | cut -f4 -d" "`
         echo "`date '+%T %D'`: $ORIGID\t$NXTFILE\t$REQID"
         cnt=`expr $cnt + 1`
      else
         cat $LPLOG >> $MSGLOG
         echo "`date '+%T %D'`: $ORIGID\t$NXTFILE"
         cnt=`expr $COPIES + 1`
      fi
   done
   if [ -s $MSGLOG ]
   then
      cat $MSGLOG
   fi
   rm $PRE_PRINT_FILE $POST_PRINT_FILE $MSGLOG $LPLOG >/dev/null 2>&1
done
exit 0


The new_portrait_queue script.............

#! /usr/bin/ksh
#
# This interface script was written to be used when printing to network
# printers which have predefined queues. Script allows for escape sequences
# to be sent as part of print, e.g toggle to landscape, change font, etc.
# Note, it does not do anything fancy like banners since it was primarily
# written for a system which does not request printer options.


# set up paths and variables
SEND_QUEUE=remote_name
TEMPPATH=/tmp
ORIGID=$1
COPIES=$4
BANNER=nobanner
PRE_PRINT_FILE=${TEMPPATH}/${SEND_QUEUE}_pre_esc
POST_PRINT_FILE=${TEMPPATH}/${SEND_QUEUE}_post_esc

>${PRE_PRINT_FILE}
echo "\033&l0O\033(s15H\033&a0L\c" > ${PRE_PRINT_FILE}
#echo "\033&l0O\c" > ${PRE_PRINT_FILE}
>${POST_PRINT_FILE}
# echo "\033(s10H" > ${POST_PRINT_FILE}

# move to first FILE to print
shift; shift; shift; shift; shift
FILES="$*"
for NXTFILE in $FILES
do
   # echo ""
   # FILENAM=`basename $NXTFILE`
   # MSGLOG=${TEMPPATH}/${FILENAM}.`echo $ORIGID`.log
   # LPLOG=${TEMPPATH}/${FILENAM}.`echo $ORIGID`.lplog
   MSGLOG=${TEMPPATH}/`echo $ORIGID`.log
   LPLOG=${TEMPPATH}/`echo $ORIGID`.lplog
   rm $MSGLOG $LPLOG >/dev/null 2>&1
   cnt=1
   while [ $cnt -le $COPIES ]
   do
      cat ${PRE_PRINT_FILE} $NXTFILE ${POST_PRINT_FILE}  | lp -d${SEND_QUEUE} -o
 ${BANNER} >>$LPLOG 2>&1
      LPHEAD=`head -1 $LPLOG`
      DUM1=`echo $LPHEAD | cut -f1 -d" "`
      if [ "$DUM1" = "request" ]
      then
         REQID=`echo $LPHEAD | cut -f4 -d" "`
         echo "`date '+%T %D'`: $ORIGID\t$NXTFILE\t$REQID"
         cnt=`expr $cnt + 1`
      else
         cat $LPLOG >> $MSGLOG
         echo "`date '+%T %D'`: $ORIGID\t$NXTFILE"
         cnt=`expr $COPIES + 1`
      fi
   done
   if [ -s $MSGLOG ]
   then
      cat $MSGLOG
   fi
   rm $PRE_PRINT_FILE $POST_PRINT_FILE $MSGLOG $LPLOG >/dev/null 2>&1
done
exit 0



These scripts work perfectly for other brother printers setup on the Solaris server. e.g we have an HL 1670N working off it fine with the same scripts.

The prints do not stay in the queue.
0
 
LVL 20

Accepted Solution

by:
tfewster earned 250 total points
ID: 12373862
My PCL5 knowledge is a bit rusty - But I suspect your problem arises from a line commented out in the "port" script:
# echo "\033(s10H" > ${POST_PRINT_FILE}
 
In the "land" script, this reads:
echo "\033&l0O\033(s10H\033&a0L" > ${POST_PRINT_FILE}

(Set paper to Portrait, set font size to 10 point & set margin);  You may as well copy this line to the "new_port_queue" script & test it - It _should_ cause the paper to be ejected.

HOWEVER, neither printer script seems to send a \033E  (end job), which is a concern - I'll look deeper into that later.
0
 
LVL 20

Expert Comment

by:tfewster
ID: 12384314
Sorry, I've had no time today to look into the details of Brother printer models or controls;  But the above suggestion should cause the page to be printed when the final POST_PRINT_FILE commands are sent - which will solve the problem.

I suspect the other model printers you have will automatically print the contents of the printer buffer when an End of Job is received, but the 6050 requires an explicit command - and possibly scraps the contents of the buffer when the next job is sent, as it hasn't been "told" to print them.
0
 

Author Comment

by:Grass-hopper
ID: 12420142
Fantastic!!

I knew that un-commenting the line would not do anything as we had already tried that, but uncommenting it out - and adding the 033E seems to have done the trick!

Points awarded and deserved.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now