How to send line feed to printer? <SOLVED>

a very small Live CD shaped to look and act like Puppy Linux.


Moderator: fredx181

Post Reply
dcung
Posts: 510
Joined: Fri Sep 25, 2020 4:31 am
Has thanked: 68 times
Been thanked: 70 times

How to send line feed to printer? <SOLVED>

Post by dcung »

In Windows, I used to regularly send 'nozzle check' pattern to my printer.
I keep the file that Epson maintenance software created - i.e. I grab it from Windows spooler.
It's only a 139 bytes file, that print this.

nozzle-check-1.png
nozzle-check-1.png (54.32 KiB) Viewed 389 times

.
.
.

So that I don't waste too much papers, I just have batch file that send line feed in between the nozzle pattern - and printed many repeatedly - filling the page.

Code: Select all

copy /b "Epson-nozzlecheck.SPL"  lpt1
echo. > lpt1
echo. > lpt1
echo. > lpt1
echo. > lpt1
echo. > lpt1
echo. > lpt1
echo. > lpt1
echo. > lpt1
copy /b "Epson-nozzlecheck.SPL"  lpt1
echo. > lpt1
echo. > lpt1
echo. > lpt1
echo. > lpt1
echo. > lpt1
echo. > lpt1
echo. > lpt1
echo. > lpt1
copy /b "Epson-nozzlecheck.SPL"  lpt1
... and so on...

.
.
.
In linux, I tested that I can do equivalent of copy /b "Epson-nozzlecheck.SPL" lpt1 with this command

Code: Select all

lp Epson-nozzlecheck.SPL -d my-printer-name

I haven't figured out how to send line feed ( and I guess Form Feed afterward).
How do I do that?

Last edited by dcung on Thu Mar 13, 2025 6:59 pm, edited 1 time in total.
User avatar
rcrsn51
Posts: 1486
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 424 times

Re: How to send line feed to printer?

Post by rcrsn51 »

Using PeasyGlue, make a grid of the image and save it as a single file. Then print that file.

dcung
Posts: 510
Joined: Fri Sep 25, 2020 4:31 am
Has thanked: 68 times
Been thanked: 70 times

Re: How to send line feed to printer?

Post by dcung »

rcrsn51 wrote: Thu Mar 13, 2025 12:23 pm

Using PeasyGlue, make a grid of the image and save it as a single file. Then print that file.

I don't know the validity of this (?).
I was led to believe that using the file will force all 255 nozzles of each color to be used. Since it is the same 'command' as if I use the printer panel to do maintenance.

Creating such image does not 'guarantee' such case. Otherwise, I would have done it.
FYI the image is something 'similar' I grab from the net. Not the actual pattern produced by my printer - ( which I could scan if I wanted to make exact pattern, but I don't).

So my preference is using the file I grabbed from (Windows) print spooler and line feed.
i.e. the exact command for this particular printer - from Epson directly.

User avatar
rcrsn51
Posts: 1486
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 424 times

Re: How to send line feed to printer?

Post by rcrsn51 »

Then how about making a text file with some blank lines and sending that to the printer? Or would that generate separate pages?

Can you open Epson-nozzlecheck.SPL in a text editor? I am surprised that CUPS would print it directly.

Regarding the linefeeds, you can try: echo -e "\n\n\n\n\n" > /dev/usb/lp0

dcung
Posts: 510
Joined: Fri Sep 25, 2020 4:31 am
Has thanked: 68 times
Been thanked: 70 times

Re: How to send line feed to printer?

Post by dcung »

I have been wanting to 'improve' the way I did the maintenance, but as always 'laziness' gets in the way. I am thinking of doing something now.

I 'over-simplified' when I described my maintenance method above.
The Epson-nozzlecheck.SPL, prints the pattern and form-feed.
So, I have batch files print few blanks lines to advance the position and print the Epson-nozzlecheck.SPL again - reusing the same page.

So, it's sort of what you suggested.

I hardly use the printer (like most people, I guess), but prefer to have one.
This is how I keep the printer heads from clogging, by ensuring all nozzles are used (regularly) with minimal paper & ink wastage.

Back in the old days, I would have used Norton utilities to remove the form-feed from Epson-nozzlecheck.SPL binary file, replacing it with line-feed and then just print the modified file few times into a file to print a page full of the pattern.

I don't know how to do so in linux (yet). And I'm to lazy to dig the old Norton-Utils in Windows.
And I have 'migrated' to linux world 'full-time' anyway...
I guess there must be a (similar) binary editor in linux. I'm still learning/looking.
What's a good binary editor in linux?

Here is the nozzlecheck.SPL (remove fake gz)

Epson-nozzlecheck.SPL.gz
(139 Bytes) Downloaded 3 times
Last edited by dcung on Thu Mar 13, 2025 5:27 pm, edited 1 time in total.
User avatar
rcrsn51
Posts: 1486
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 424 times

Re: How to send line feed to printer?

Post by rcrsn51 »

You could also try: cat Epson-nozzlecheck.SPL > /dev/usb/lp0

dcung
Posts: 510
Joined: Fri Sep 25, 2020 4:31 am
Has thanked: 68 times
Been thanked: 70 times

Re: How to send line feed to printer?

Post by dcung »

rcrsn51 wrote: Thu Mar 13, 2025 5:26 pm

You could also try: cat Epson-nozzlecheck.SPL > /dev/usb/lp0

I actually have came across and tested

Code: Select all

cat Epson-nozzlecheck.SPL > /dev/lp0
cat Epson-nozzlecheck.SPL > /dev/usb/lp0

didn't work. I thought they wouldn't.
I suppose they would work if I connect the printer to USB (or LPT1), but it's on the network (lpd://x.x.x.x:515/PASSTHRU).
What I didn't say was that, in Windows, I mapped my lpt1 to the printer network name.
Hence I could use > lpt1 in Windows.

User avatar
rcrsn51
Posts: 1486
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 424 times

Re: How to send line feed to printer?

Post by rcrsn51 »

dcung wrote: Thu Mar 13, 2025 5:43 pm

but it's on the network (lpd://x.x.x.x:515/PASSTHRU).

Try: cat Epson-nozzlecheck.SPL | busybox nc x.x.x.x 515
Or maybe: cat Epson-nozzlecheck.SPL | busybox nc x.x.x.x 9100

dcung
Posts: 510
Joined: Fri Sep 25, 2020 4:31 am
Has thanked: 68 times
Been thanked: 70 times

Re: How to send line feed to printer?

Post by dcung »

rcrsn51 wrote: Thu Mar 13, 2025 5:53 pm

Or maybe: cat Epson-nozzlecheck.SPL | busybox nc x.x.x.x 9100

This works.
So same as lp Epson-nozzlecheck.SPL -d my-printer-name
[Edit] Why 9100 works and 515 doesn't. What's the difference?

But now I can do

Code: Select all

cat Epson-nozzlecheck.SPL | busybox nc x.x.x.x 9100
echo -e "\n\n\n\n\n" | busybox nc x.x.x.x 9100

like my old 'dumb' way in Windows.

Last edited by dcung on Thu Mar 13, 2025 6:13 pm, edited 3 times in total.
User avatar
rcrsn51
Posts: 1486
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 424 times

Re: How to send line feed to printer?

Post by rcrsn51 »

Does that end with a formfeed?

dcung
Posts: 510
Joined: Fri Sep 25, 2020 4:31 am
Has thanked: 68 times
Been thanked: 70 times

Re: How to send line feed to printer?

Post by dcung »

rcrsn51 wrote: Thu Mar 13, 2025 6:02 pm

Does that end with a formfeed?

Yes

I need to figure out removing formfeed from Epson-nozzlecheck.SPL content.

User avatar
rcrsn51
Posts: 1486
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 424 times

Re: How to send line feed to printer?

Post by rcrsn51 »

Maybe: cat Epson-nozzlecheck.SPL | tr -d "\f" | busybox nc x.x.x.x 9100

dcung
Posts: 510
Joined: Fri Sep 25, 2020 4:31 am
Has thanked: 68 times
Been thanked: 70 times

Re: How to send line feed to printer?

Post by dcung »

rcrsn51 wrote: Thu Mar 13, 2025 6:33 pm

Maybe: cat Epson-nozzlecheck.SPL | tr -d "\f" | busybox nc x.x.x.x 9100

Wow..you're a God sent Bill!

I just tried this
cat Epson-nozzlecheck.SPL | tr "\f" "\n" | busybox nc x.x.x.x 9100
and...no form feed.

Code: Select all

cat Epson-nozzlecheck.SPL | tr "\f" "\n" |  busybox nc x.x.x.x 9100
echo -e "\n\n" | busybox nc x.x.x.x 9100

I think you just solved my problem...!! Thanks!

Meanwhile, I have been removing characters blindly from Epson-nozzlecheck.SPL with GHEX...to no avail!

2025-03-14-053401_922x423_scrot.png
2025-03-14-053401_922x423_scrot.png (77.44 KiB) Viewed 217 times
Last edited by dcung on Thu Mar 13, 2025 7:16 pm, edited 1 time in total.
User avatar
rcrsn51
Posts: 1486
Joined: Sun Aug 23, 2020 4:26 pm
Been thanked: 424 times

Re: How to send line feed to printer?

Post by rcrsn51 »

Excellent. So after repeating that pair of lines, you could end with:
echo -e "\f" | busybox nc x.x.x.x 9100
and get a page eject?

dcung
Posts: 510
Joined: Fri Sep 25, 2020 4:31 am
Has thanked: 68 times
Been thanked: 70 times

Re: How to send line feed to printer? <SOLVED>

Post by dcung »

rcrsn51 wrote: Thu Mar 13, 2025 6:53 pm

Excellent. So after repeating that pair of lines, you could end with:
echo -e "\f" | busybox nc x.x.x.x 9100
and get a page eject?

I ended up doing

5x
cat Epson-nozzlecheck.SPL | tr "\f" "\n" | busybox nc x.x.x.x 9100

And the page eject by itself. - ie. page full
Bonus!

So I get 5 sets of pattern per page.
Be nice if I could remove (5 sets) Serial No, etc text, but I guess that's embedded in the native printer command.
And fit more pattern per page.
No such info (text) in Epson-nozzlecheck.SPL, but this is already more than I thought possible...

Post Reply

Return to “DebianDogs”