# FBSD 7.2 APSFILTER setup ?



## fuzzynco (Oct 16, 2009)

I have a Brother HL-5250-DN monochrome laser networked priner.
It's IP is 192.168.215.29, the FBSD system is 192.168.215.30.

I tried to setup APSFILER (gotten from pkg_add) after install.
The printer is an PS printer, it's builtin print server 
understands IPP, SMB, LPR and HP port 9100 protocols.

APSFILTER doesn't offer IPP and LPR gets 'connection refused'
during 'print a test page' in setup?

All I really need is plain text and preformated PS files to 
be sent for printing. I'm really not sure what replies I should
give APSFILTER during setup. 

APSFILTER appears to want to call GS and GS doesn't have 
a 'driver' for the HL-5250-DN printer.

The SMB name for the printer is //brother/brother.

any ideas what I'm doing wrong?

Thanks


----------



## Oko (Oct 17, 2009)

fuzzynco said:
			
		

> I have a Brother HL-5250-DN monochrome laser networked priner.
> It's IP is 192.168.215.29, the FBSD system is 192.168.215.30.
> 
> I tried to setup APSFILER (gotten from pkg_add) after install.
> ...



HL-5240 doesn't need any drivers. It does speak Post Script language. If you want to use APSFILTER (text filter) just chose option generic PostScript printer. 

You can just follow this how to

http://onlamp.com/pub/a/bsd/2003/11/06/Big_Scary_Daemons.html


If you promise to yourself that you will never send anything to that printer except PostScript files the following printcap file is enough for you to print anything. Do not forget to convert 
files you want to print to PostScript first.


```
rp|remote line printer:\
       :lp=:rm=192.168.215.29:rp=lp:\
       :sd=/var/spool/output:\
       :lf=/var/log/lpd-errs:\
       :mx#0:\
```

Note that you might need to create spooling directory with as follows


```
# cd /var/spool/lp 
# mkdir output
# chown daemon:daemon output
# chmod 770 output
```

On the final notice make sure you have port 515/tcp open in your firewall. Pass out keep state is enough.


----------



## fuzzynco (Oct 17, 2009)

*hmm  not using a firewall?*

The test was again refused -- which I guess is 
either the printer isn't getting the packets or 
doesn't want them? 

screen caps of print server's settings.

I have to use screen caps as I have no way of getting 
text from the VM to the host. I tried using shared folders
but can't figure out whose password mount is asking for,
(the sharer's or root on the guest) neither seemed to work .

I posted the printcap and rc.conf as created by apsfilter
and sysinstall. perhaps what I need is an input filter 
to turn plain text into PS and pass PS scripts to the 
print server?  

Ghostscript seems to be for PS>text but apsfilter wants
it anyway.


----------



## Oko (Oct 18, 2009)

fuzzynco said:
			
		

> The test was again refused -- which I guess is either the printer isn't getting the packets or
> doesn't want them?
> 
> screen caps of print server's settings.


I noticed couple serious problems with on the pictures you posted..
Firstly, I see that IPP protocol (port 631 TCP/UDP)is enabled on your printer server. Let me break the news for you Line Printer Daemon does NOT speak IPP protocol. APSFILTER is only text filter but the real thing is done by Line Printer Daemon which uses port 515/tcp . You have to enable Line Printer Daemon Protocol (port 515/tcp) on your printer server in order to use Line Printer Daemon which comes with FreeBSD. If you want to use IPP protocol for printing you must use CUPS. Secondly, I noticed that address of your DNS server is 209.*** which is not on the local network 192.* . How do you expect printer address to be resolved? Can you even ping your printer. 




			
				fuzzynco said:
			
		

> I have to use screen caps as I have no way of getting
> text from the VM to the host. I tried using shared folders
> but can't figure out whose password mount is asking for,
> (the sharer's or root on the guest) neither seemed to work .


What is VM? Are you saying that all this is happening on the Virtual Machine and that you didn't install FreeBSD on the real hardware. You should have mentioned that immediately so that I do not have to waist my time trying to help you.





			
				fuzzynco said:
			
		

> I posted the printcap and rc.conf as created by apsfilter
> and sysinstall. perhaps what I need is an input filter
> to turn plain text into PS and pass PS scripts to the
> print server?
> ...



You have to do some reading. APSFILTER is text filter. When you send for instance .JPG file APSFILTER (which is written in PERL)  analyzes the file and it recognizes that the file is JPG. Then APSFILTER calls ImageMagic's convert utility which in turns converts JPG file to PostScript and then sends it to LPD. That is all APSFILTER does. If you did run convert utility on your JPG file by hand and converted to PostScript you will not need APSFILTER.

Ghostscript is on the another hand is a set of drivers. It converts PostScript file into Printer Command Language which is spoken by many printers which do not have built in Post Script module. You do NOT use drivers in this case as your printer DOES speak Post Script. Your printer is very good It does have built in Post Script module. That is why you paid it close to $200.


----------



## fuzzynco (Oct 18, 2009)

*Mostly fixed *

:r I'm doing a little better... I defined a printer w/o an input filter
and the data actually got there. Plain text showed up properly
but had 'job end' and 'line end' issues. I'm hoping there is a dumb
printer filter to add pcl or whatever to force a new page on a 
'end of job' and fix nl to nl/cr. The last page of the print job
doesn't print until the next form feed is sent to the printer.

I guess the printer in smarter than I am. If I send plain text
it prints out normally, if I send Postscript formated data
it interprets it and prints what is in the PS data. 

I just need to fix up plain text for the 'end of job' page eject
and 'line end' fix up for stair step effect. 

Thanks for your guidence -- I do need to learn what the printcap tags 
do.


----------

