Menu

#270 Direct printing to LPT1

v1.0_(example)
open
nobody
None
5
2015-05-11
2015-05-06
kalpha
No

I want to print directly to LPT (/dev/lp0) on a Debian Wheezy box using dosemu from their contrib repo. Should this be possible?

I have issues if I use the default dosemu.conf setting (I assume is lpr -l)

If I change this setting to $_lpt1 = "/dev/lp0"

I get "sh: 1: /dev/lp0: Permission denied" msg in the console from where I started dosemu, whether I do as normal user or test as root. Both are in the lp group which is the group code for /dev/lp0

I have multiple printers and need to have one on LPT1 and one on COM1, the latter is working fine with
$_com1 = "/dev/ttyS0"

I also know there is no issue with the actual h/w as I can boot a dos floppy to test and just do "type file.txt > LPT1:" and get as I expect.

Shouldn't serial and parallel ports be similarly available?

I wanted to test with latest dosemu code, but have hit separate issues with that .... hence this request.

Discussion

  • kalpha

    kalpha - 2015-05-11

    just a follow up.
    Probably giving up on getting the parallel port working under dosemu.
    Have two tested workarounds.
    1. Use a USB to serial adapter and in dosconf map $_COM2 = /dev/ttyUSB0
    (this is easiest as don't have to change program code)
    or
    2. change program to create a file with the text that is to be sent to printer, then create a bat file that uses the "UNIX" to then "cat file.txt > /dev/lp0"
    (this works, but means changing the code a bit and probably adding some switch so can still use on true DOS terminals or there serial printers that work fine).

    probably for older versions, but I found references that suggested I could try
    $_lpt1 = "cat - > /dev/lp0"
    in dosconf, but that gave same result as the default "lpr -l"

    Which in case there is any thoughts, the issues I was getting was when sending the text (mixture of printer commands and text) to a zebra label printer from a basic program that is along lines of
    OPEN LPT1: FOR OUTPUT AS #1
    PRINT text$
    CLOSE #1:
    where text$ contains multiple Zebra EPL commands and text lines.
    The result which under plain DOS is fine, comes out mostly okay except there is some text missing and insertion of random extra white space e.g.
    if should see "Quick brown fox" might get "Qui ck brown fox"

    While researching, this I found references suggesting using different lpr packages or removing lpr and cups, tried those but still had same issues. Also tried setting up the printer with USB and using lpr -l, that had same issue.

     
  • Hans-Christian Koch

    Hi kalpha,

    I am also printing from dosemu to Zebra printers, in my case Zebra GK 420d. This printer offers serial, parallel and USB connection.
    Serial works fine as you said, just use the correct cable and maybe set the right COM mode.
    USB does also fine but you need to set up the printer as default printer. On my Ubuntu machine I do this via CUPS, access the webpanel on 127.0.0.1:631 and add the printer (Zebra ones should be recognized by CUPS). With default dosemu LPT configuration you should be able to print to a USB connected printer through the dosemu LPT1 port. You may also use the Zebra ZPL controlsigns.
    If you want to print via real LPT this could become tricky. You may try to set up a LPT connected printer via CUPS similar to the USB method but some printers are not recognized. I also tried to print direct to LPT because I have some very old printers CUPS can't handle but I couldn't get it to work. You may also check out my thread in the new forums, Stas Seergev opened a new "dosemu2" project - I suggest you compile that version and ask there.
    https://github.com/stsp/dosemu2/issues/3

     
  • Hans-Christian Koch

    Also the debian package seems pretty outdated. You should really compile a new version from devel branch, either from this or dosemu2's git and try again.

     
  • kalpha

    kalpha - 2015-05-11

    Hi,
    thanks for responding.
    I did set up the Zebra via USB and also via LPT under CUPS but my printing issue was the same. NB I only (seemingly) get the issue with large labels and quite a bit (though not huge amount) of text. So far on the smaller labels have not noticed issue.
    As per my 2nd workaround, I can print directly via LPT under pure Linux, it's just with dosemu I encounter the issue, though it might be more a dosemu + lpr/cups issue.
    Will have a go re dosemu2, do you know which branch is recommended?

     
  • Hans-Christian Koch

    Ah okay. I usually print 100x50 mm labels, maybe not enough text to encounter your problem.
    Try devel, I guess Stas demands that if you want his help :)
    If you need help compiling I may send you my notices based on Ubuntu.

     
  • kalpha

    kalpha - 2015-05-11

    I just failed to build release pre2 from zip, so have created
    https://github.com/stsp/dosemu2/issues/31
    not sure close Ubuntu is to Debian Wheezy, but maybe if you added any notes to that.

     

Log in to post a comment.