LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-23-2021, 02:17 PM   #61
WayCon
Member
 
Registered: Sep 2019
Posts: 77

Original Poster
Rep: Reputation: Disabled

Here's what I got.

Quote:
$ lpstat -p
printer Canon_MG2100_series is idle. enabled since Sun 23 May 2021 02:23:23 PM EDT
printer EPSON-TM-P2.01 is idle. enabled since Fri 07 May 2021 12:08:25 PM EDT
printer EPSON-TM-P2.01-2 is idle. enabled since Mon 10 May 2021 02:31:25 PM EDT
printer EPSON-TM-P2.01-3 is idle. enabled since Fri 14 May 2021 12:25:23 PM EDT
printer Generic-Text-Only is idle. enabled since Mon 10 May 2021 02:54:34 PM EDT
printer MG2100-series is idle. enabled since Sun 23 May 2021 02:22:30 PM EDT
printer printer is idle. enabled since Sun 16 May 2021 01:58:48 PM EDT
printer queue_name is idle. enabled since Fri 21 May 2021 10:27:02 PM EDT
printer queue_name2 is idle. enabled since Fri 21 May 2021 10:39:19 PM EDT
printer queue_print is idle. enabled since Fri 21 May 2021 11:33:53 PM EDT
Doesn't this suggest that I'm making some sort of error when I type the command: "lpr -P Canon_MG2100_series d00026-001" and I receive "unknown printer" ?
 
Old 05-23-2021, 02:57 PM   #62
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,734

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
Before cups linux used the BSD LPD print system which had lpr and LP commands and cups repurposed those same utilities. It is possible that your lpr is not the cups-lpr program.

Did you install any other printing software on your system? maybe cups-bsd

Last edited by michaelk; 05-23-2021 at 03:05 PM.
 
Old 05-23-2021, 03:39 PM   #63
WayCon
Member
 
Registered: Sep 2019
Posts: 77

Original Poster
Rep: Reputation: Disabled
I don't believe so. Is there any test to see if something came in with something else? As you can saw, earlier, I haven't even installed samba on this computer, which is a 32-bit Dell, running Mint 19.3 .

When I go to "printer" and choose "help," I see "system-config-printer" "1.5.11" "A CUPS configuration tool" "Copyright 2006-20012 Red Hat, Inc."

Last edited by WayCon; 05-23-2021 at 03:45 PM.
 
Old 05-23-2021, 04:33 PM   #64
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,734

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
GUI applications access the cups server directly and are independent of the command line utilities.

The printer tool is just a wizard to simplify adding printers.

Try printing via lp instead of lpr i.e.

lpr -d printer_queue text.file

You can try reinstalling the cups-client package which will reinstall the cups version of lp and lpr.
 
Old 05-23-2021, 08:57 PM   #65
WayCon
Member
 
Registered: Sep 2019
Posts: 77

Original Poster
Rep: Reputation: Disabled
Hello, michaelk,

That worked. I entered and got:

Quote:
lp -d Canon_MG2100_series d00058-001
request id is Canon_MG2100_series-66 (1 file(s))
I also got the slow output thus:

Quote:
lp -d EPSON-TM-P2.01 plain.txt
request id is EPSON-TM-P2.01-69 (1 file(s))
although, in this case the printer symbol showed for several seconds a red triangle with and exclamation mark.

Also, the corresponding outputs appeared as files in /var/spool/cups , the Canon output being a pdf and the Epson a txt files, though the pdf file didn't have the ".pdf" suffix nor did the text file have the ".txt" suffix.
 
Old 05-23-2021, 09:30 PM   #66
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,734

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
I assumed by that worked the printers actually printed something that looked ok?

The cups error logs might have something that might correlate with the red triangle.

The cups data files are just named as the job number. Just as a FYI linux does not care about extensions. Most applications use the meme type or the file magic number to associate programs with file types.

So the lpr utility is broken some how.

Here are some options:
You can create a cups back end that will convert PDF output to text and print to the Epson that bypasses the rastertoespx as posted above. With simple text it should work ok.

You can build your own POS program that creates a text file and then prints to the Epson.
 
Old 05-24-2021, 09:28 AM   #67
WayCon
Member
 
Registered: Sep 2019
Posts: 77

Original Poster
Rep: Reputation: Disabled
Hi, michaelk,
Thank you, here. In as much as I would be using this with my POS, printing many receipts per day, let me ask if there is some sort of small spooler program that I could load when the computer boots that will print anything that appears in a specified subdirectory?
Thank you,
Wayne
 
Old 05-24-2021, 09:49 AM   #68
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,734

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
inotify tools allow you to monitor a directory for changes and incron is an easy way to use them. Basically when anything is written to the specified directory it will trigger the system to run commands which would be to print a file.

https://www.howtoforge.com/tutorial/...s-with-incron/
 
Old 05-24-2021, 11:37 AM   #69
WayCon
Member
 
Registered: Sep 2019
Posts: 77

Original Poster
Rep: Reputation: Disabled
Thank you, michaelk,
I will look into this.
Interestingly, I purchased a USB to parallel cable. After I connected the printer with it, cups detected my printer. I was able to add a printer. When I clicked on the test printer button, the printer started printing very quickly, which is good, but inserted an extra space at a regular basis, so that images and even some lines of text were broken, the tops of letter and the bottoms separated by about 1/8". Do you, by any chance, know how to close that gap? Also, is there any way, that you know, for dosemu to direct its lpt1 output to a USB printer? I recognize that this question may be beyond the scope of this site, but, well, I figure I could ask.
Sincerely,
Wayne

Last edited by WayCon; 05-24-2021 at 11:40 AM.
 
Old 05-24-2021, 11:51 AM   #70
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,734

Rep: Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920Reputation: 5920
That is interesting. I would expect the hardware port to work the same as the USB port with respect to cups. Maybe there is an interrupt problem.

I don't know what controls the gap space.

As far as I know you should be able to define the dosemu printer command as:

$_lpt1 = "lp -d USB_parallel_port_printer_queue_name"

Last edited by michaelk; 05-24-2021 at 11:59 AM.
 
Old 05-24-2021, 03:18 PM   #71
WayCon
Member
 
Registered: Sep 2019
Posts: 77

Original Poster
Rep: Reputation: Disabled
Thank you, michaelk,
I added the line you suggest to dosemu.conf and the output was exactly as I wanted it. I'm guessing that the test file had things embedded that sent line feeds, or else that the default character set of the printer and the default output of dBase match. Anyway, now, using dBase on dosemu, I can generate receipts in a timely matter on a dot matrix printer. The only thing I don't know for certain is if the initial escape code will pass to the printer and trigger the cash draw, but it probably will because I see the escape codes in the file saved in /var/spool/cups . I'm concluding and guessing that Linux Mint 19 has problems with a generic parallel card.
I still have things to tinker with, when I'm feeling like it, but it works.
I appreciate all your patience and advice, and that of the other people at LinuxQuestions.org ,
Sincerely,
Wayne
 
Old 05-30-2021, 02:46 PM   #72
WayCon
Member
 
Registered: Sep 2019
Posts: 77

Original Poster
Rep: Reputation: Disabled
As a follow-up, I tested the setup with a cash draw connected and it worked properly. Success.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Download a PDF/web page as "text" PDF (ie. not a picture)? littlebigman Linux - Software 7 01-28-2020 06:35 PM
Unsupported PDF data for Direct Print :1000 when printing a PDF document vishnu14 Linux - Server 5 10-18-2019 06:56 AM
[SOLVED] printing the text from a web page without printing the graphics newbiesforever Linux - General 15 03-21-2018 06:39 AM
[SOLVED] Variables in text file, how to get their values when printing out the text? idaham Linux - General 2 04-14-2010 03:28 AM
How to parse text file to a set text column width and output to new text file? jsstevenson Programming 12 04-23-2008 02:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:24 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration