Dot matrix printer on OpenBSD reddit / BSD ---------------------------------------------------------------------- ttlaxia · 2023-06-21 00:01 I have an old Core 2 Duo machine with a parallel port running recent OpenBSD and I am trying to connect a much older Star Micronics Gemini-10x dot matrix printer to it. I've gotten as far as the word "root" being printed with some random-looking garbage below it -- I assume it's a burst page. But nothing else. lpd runs and when I do something like `lpr -Plp file.txt` what looks like a print job shows up in /var/spool/output/lpd but nothing prints. I have these in /dev/ : lpa0, lpa1, lpa2, lpt0, lpt1, and lpt2. I think lpa0 is the correct one, but I'm not sure how to find out for sure. If I do `cat file.txt > /dev/lpa0` I get "device busy". My /etc/printcap looks like this: lp|Local Line Printer:\ :lp=/dev/lpa0:SD=/var/spool/output/lpd:lf=/var/log/lpd-errs The permissions for that spool output directory look like rwxr-xr-x. Does anyone have any thoughts about what I may have missed? I've never tried setting something like this up and I don't know if I'm missing a driver, or the computer is sending UTF-8 or... what. The computer is not on a network so it would be a bit of a pain to get drivers onto it, really. [Edit: I've gotten it to print a couple of times now, but I haven't figured out what combination of printing as root, resetting the printer, command line switches made it work. The printer always stops being in Ready status as soon as I submit a job, whether it prints or not. Sometimes after I reset it it will print the first few characters of the previous job. Maybe the printer is just broken...] ---------------------------------------------------------------------- gumnos · 2023-06-21 02:10 Not sure why this got updated, it's an interesting problem. My first question would be whether your file has form-feeds (0x12) in it to tell the printer to eject the current page. Though that's usually more a problem for things like inkjets and laser printers rather than for dot-matrix & line-printers (where you usually get the characters printed as they're streamed to the hardware. I *would* check for strange characters such as non-ASCII characters (such as Unicode or other code-blocks of 1-byte character-sets), as well as control characters. On a reset printer, streaming the text bytes to the printer *should* print them directly. I'm not sure how the Gemini handles long lines, so you might need to [`fmt(1)`](https://man.openbsd.org/fmt.1) them first like fmt -79 /dev/lpa0 or possibly pipe it to [`lpr(1)`](https://man.openbsd.org/lpr.1) instead lpr < file.txt Maybe testing known-good text with something like printf 'hello\n\f' | lpr or try [`lptest(1)`](https://man.openbsd.org/lptest.1) Additionally, something feels strange about `/dev/lpa*` where I'm used to parallel printers showing up at `/dev/lpt*`. Having the wrong device-name could manifest with your "it queues but doesn't print" behavior. So I'd also lean strongly toward testing `/dev/lpt0` It's been more than a decade since I had to directly shovel printer control-codes down the wire, so I might be amiss, but I did write some custom printer-interface drivers/libraries (this was for thermal printers, printing from PocketPC handhelds, so a slightly different world; and before that, dot-matrix printers from Apple ][ and old 286/386/486 hardware) so I'm not totally unfamiliar. ---------------------------------------------------------------------- ttlaxia · 2023-06-21 03:31 Thank you! I think the device name was the issue, even though I thought I'd tested lpt0 already. I found some NetBSD docs that say that lpa0 is the "polled" driver, and lpd0 is the "interrupt driven" driver. And I gather lpt0 just dumps data directly to the port. (?) Anyway, when I changed it to lpt0 it started working.