We help IT Professionals succeed at work.

lprint for dumb terminal

bluez
bluez asked
on
Hi guys
We are having trouble repairing one of our printers.  To get round this I want to use a dot matrix printer to print via a dumb terminal using the sco unix ver 5.5 lprint command.
The terminal is a WYSE 65es so I should have no problem with termcap info.  
Can you advise on setup procedures. for eg how do I redirect to /dev/tty4a - this would be the dumb terminal.
As I am aware I need to pipe the print because of the software we are running.  This is sage financial software for Unix. If we are printing direct the setting for sage is /dev/lp
if we print to a serial printer we use |lp -depson (print queue for eg 192.168.100.4=epson)
Of course a dumb terminal is not using IP so How does the job pipe through /dev/tty4a?
I hope this makes sense!
Many Thanks
Simon.
Comment
Watch Question

CERTIFIED EXPERT

Commented:
Hi bluez,

   You can use the SCO adm tool to setup your printer. If you are run on
SCO 5.x, use" scoadmin" command to bring up the Main menu, and find the printer setup manual, and then following the screen instruction to complete you configuration. If you are runing on SCO 3.x, use sysadmin command instead.

   Or you can use " mkdev lp" to fix it up.

   Cheers!

======
yuzh

Commented:
Are you using a multiport serial card, or just an add in standard two port serial board?  If you are using a multiport serial card, depending on the manufacturer, you may be able to use their software to setup the transparent printing you would like.

Author

Commented:
Yes we are using an IOPRO multiport card.  How do I use their software?
The server was not put together by myself.  I presume there will be something in scoadmin
This is what I have tried so far
1. Created a local printer
L Olidm90 ( just name of printer)
2. enabled local and remote jobs
3. print to |/dev/tty4b - I think this is where it could be going wrong.
4. I have seen before a setting for |/dev/rprint ?
If I do the following:
# ls |lp -dOlidm90 this works but prints the screen and logs me out of Unix
Thanks.

Author

Commented:
Has anyone actually done this, I mean setup printer via a dumb terminal?
I'm using Wyse 65es (extended character)

Cheers

Commented:
Yes, I do it all the time, but mostly on Wyse60s using Digi, Maxpeed, or Stallion boards.  In the Wyse65 setup screen (hit the select/setup or hold down <shift> and hit the select/setup key at the top right of the keyboard), if there is an option such as "printer attached" on one of the setup screens, make sure it is set to on.  Also check to be sure the terminal supports parallel printers.  Some will only work with serial printers.  You might try using Wyse50 emulation.  This option should be in the <F2> screen in the terminal setup.  The reason it is printing to the screen is that there are control codes the print spooler must send to tell the terminal that it is a pass through print job and not to go to the screen.  On a WY65 they are "ESC d #" to turn transparent print on and "CTRL T" to turn off.  If you add these codes to the printer interface in the correct place, it should work.  

Now that I've written all this, the answer just came to me.  Add this line to the /etc/rc.d/8/userdef file using vi.  

ditty -n tty4b term wyse65

That should work.  Sometimes if you think to hard about something, the easy answer slips right by you.  To test it you will have to reboot or you can just type that command in at a prompt as long as you are logged in as root.

I just checked and the Wy65es doesn't emulate a Wy60, just a Wy50+ or a 50.  You might try setting the terminal to Wyse50 mode and changing the ditty line from wyse65 to wyse50.

Sorry I'm being long winded.  Give that a shot.
CYA

Commented:
If you try the above, make sure the printer is setup as a normal printer using the dumb interface in scoadmin and just direct it to the terminal's port.  lp -d will work just fine.
CERTIFIED EXPERT
Commented:
It can be done without the software come with the multiport card. (I have done it for arnet card, pc com board, Stallion boards and serial port on the PC. it works fine.

I have a old script to do this job( it actually use for setting up tty, modem, tar, printer etc). I post that part for making the printer. You need to know the major and minor number of the device, and know what termcap to use for your printer:


==========Sample Script ONLY ===========================
:
#!/bin/sh
TMP=/usr/tmp/mkdev.$$
TMP1=/usr/tmp/mkdev1.$$
TMP2=/usr/tmp/mkdev2.$$
TMP3=/usr/tmp/mkdev3.$$
TMP4=/usr/tmp/mkdev4.$$
TMP5=/usr/tmp/mkdev5.$$
TMP6=/usr/tmp/mkdev6.$$
CONF=/etc/conf/init.d
clear
......................................................
# this part for making the printer
mkdprt)
    echo "Making multi printers\r"
    MODEL=/usr/spool/lp/model/run
    INTER=/usr/spool/lp/admins/lp/interfaces
    PRNTR=/usr/spool/lp/admins/lp/printers
    TCAP=$RUNLIB/tcap
    tr <$DATAFIL | grep "^PRINTER" | \
        while read NAME DEVICE TYPE NODE REST ; do

        MAJOR=`expr $NODE : '\(.*\),.*'`
        MINOR=`expr $NODE : '.*,\(.*\)'`

        echo "Making $DEVICE type $TYPE=$MAJOR,$MINOR\r"
        su runroot -c " (
            disable $DEVICE
            rm -f /dev/$DEVICE $INTER/$DEVICE $TCAP.$DEVICE
            echo \"Old devices $DEVICE removed\"
            /etc/mknod /dev/$DEVICE c $MAJOR $MINOR
            /etc/mknod /dev/null.$DEVICE c 4 2
            cp $MODEL $INTER/$DEVICE
            cp $TCAP.$TYPE $TCAP.$DEVICE
            /bin/chmod a+rw /dev/$DEVICE $INTER/$DEVICE $TCAP.$DEVICE /dev/null
            /bin/chmod a+xrw $INTER/$DEVICE
            sed -e 's+^Device: .*+Device: /dev/null.$DEVICE+g' \
                $PRNTR/$DEVICE/configuration > $TMP1
            cp $TMP1 $PRNTR/$DEVICE/configuration
            echo \"New devices $DEVICE made and drivers installed\"
            enable $DEVICE
        ) " # 2>/dev/null"

    done
    ;;

=======================================================
..........................

    I hope that the above infor can help

Author

Commented:

Thanks
I'm going to give this a shot
Bluez

Author

Commented:
This is confusing,before I look at any scripting
I don't seem to have a ditty command
# ditty:not found
hwconfig -c
shows IOPRO as multiport card
There is no software in scoadmin for the card.
Can you advise
Many thanks.
Bluez
CERTIFIED EXPERT

Commented:
Hi bluez,

   scoadmin cann't configure the 3rd party hardware, you have to use the software come with the card to make the tty device (I mean that you need to getthe dump terminal working first). I believe that this had been done by someone who installed the box, all you need to do is to find out the major and minor number of the port you want to attached the printer to and then modify the script to make it work.

   PS: $RUNLIB/tcap is not the sco stuff, it is the place where is put the termcap things for differnt made and model of the printer. sunroot is a user have permission to change all the device file. if you login as root, you should ignore all the "su" and just use the command instaed.

   My script should be able to tell you want need to be changed to setting up printers. (I wrote this one a few years ago, and it works find with SCO Openserver Host/Enterprise 3.x and 5.x), I have use it for a few hundred sites.

  Can you browser thought you box to see if any docs for the card ( at lease it shoud have a README file).

  From my memory, there is no "ditty" command in sco.
  Can you type swconfig to see if the diver is there.
 
   

Author

Commented:
I am actually looking at this remotley.
there is a /etc/chase path for the iopro card
I have looked at a config file, which lists the following.  I need to determine how to do this, sh a script i presume.  There is a script directory under /etc/chase/scripts/config | remove
if I sh config it is looking for dd_parm?

Sample Transparant printing config:

port prn4b: card = 0, unit = 0, phys = 0, type = P preserve = y, modem = n, \ pbegin = "^[d#", pend = "\024", ack = 0x86, line_end = 0x0a

Does this make sense to you?
Bluez

Author

Commented:
The major and minor number for /dev/tty4b
is 118 and 2 respectivley
I'm going to have a go at editing your script.

Author

Commented:
yuzh

I'm having trouble with your script i have changed the major and minor numbers for the kernal on line $DEVICE c
when I sh the file I get the following
mkkprt) unexpected ')'
I have tried changing this to mknod prt
the script seems to run the line
echo "Making multi printer\r"
and then stops

Any clues?

Commented:

Commented:

Commented:

Commented:
CERTIFIED EXPERT

Commented:
Hi  bluez,

      What I posted for you is only one part of my OLD script, as I have told you before, you need to modify to make it work.( my OLD script is used for making dump termilnal, modem, tar device). The script gets input from a text file, and made the device according to the specification for the device.

     As you can see on the script, it has a WHILE loop for make multiple printers, of course you can make only one printer if you specifify one in the config file(input file). In your case, you don't need to use the input file, all you need to do is to get rid of the while loop, assign value to the VARs, and get you printer configuration done.

    When I post this script, I assume that you can read script.  It is part of the CASE statement of a Full script, you need to tidy it up to make it work for you.

    sco don't care how you name a device as long as it have a correct major and minor number and type. you can called your printer lp1, drv, or mylp, no one cares.

   Cheers!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.