How printing works ?

385 views
Skip to first unread message

manusim

unread,
Oct 3, 2011, 8:36:16 PM10/3/11
to Alt-F
Hello,
i've flashed my dns to have ext3 filesystem. 0.1B7 version.

Is it possible to use a printer connected by usb on the box via samba
shares as i used to do with the vendor's firmware? I have the printer
in samba shares but it doesn't work ('nt_network_bad_name' and 'unable
to connect cifs host'). I can connect to the other shares.

I read on this group that Alt-F base has a lpd server.
When i plug in the printer (HP-Deskjet f2200), i have a /dev/lp0 file
and also /etc/printcap created.
If i enter the command : lpr -Plp0 /etc/printcap , nothing happens;
lpr -Plp /etc/printcap give the following error : lpr: error while
sending data file. Server said:lpd: can't open 'lp': No such file or
directory

I try to print from my linux pc desktop via cups (on the pc), so do i
need to install cups also on the box ?

I'm a bit confused on how to make my printer works. Any help would be
very appreciated.

I join contents of /etc/printcap and sys/class/usb/lp0/device/
ieee1284_id files if this helps.

Thank you

/etc/printcap:
lp0|HP Deskjet F2200 series


/sys/class/usb/lp0/device/ieee1284_id :
MFG:HP;MDL:Deskjet F2200 series;CMD:LDL,MLC,PML,DYN;CLS:PRINTER;
1284.4DL:4d,4e,1;SN:CN8BJ1S30605CC;S:
0380008000020020002c1480009c2550000;Z:007,0A20000,147;#

Joao Cardoso

unread,
Oct 4, 2011, 12:30:54 PM10/4/11
to al...@googlegroups.com
On Tuesday, October 04, 2011 01:36:16 manusim wrote:
> Hello,
> i've flashed my dns to have ext3 filesystem. 0.1B7 version.
>
> Is it possible to use a printer connected by usb on the box via samba
> shares as i used to do with the vendor's firmware? I have the printer
> in samba shares but it doesn't work ('nt_network_bad_name' and 'unable
> to connect cifs host'). I can connect to the other shares.

Please check in file /etc/samba/smb.conf, the section

[Printers]
path = /var/spool/samba

if the directory in path exists and has permissions for write/execute.

On my (development) system it was missing. I just did, as user 'root'

mkdir -p /var/spool/samba
chmod a+wx /var/spool/samba

And in my linux box I was able to create and print a test page using the
"lpd" protocol and the "smb" protocol. I used two different printers.

Please let us know it this solves the problem.

I suspect that lpd will not work in MS-Windows, I will try it.
But if you install the cups package in the box it will work for MS-Windows.

manusim

unread,
Oct 4, 2011, 7:35:44 PM10/4/11
to Alt-F
Thanks for help

i already tried to change the path in smb.conf to a directory that
exists (/var/spool/lpd) but i didn't check the permissions.
i'll try this and i keep you informed.

i don't need my printer to work with Windows as i don't have it at
home. So if i don't need to install cups in the box it's better.

manusim

unread,
Oct 4, 2011, 8:06:56 PM10/4/11
to Alt-F
Ok, i've just tried what you're suggesting and i end up with an error
NT_STATUS_UNSUCCESSFUL opening remote file

And the command " lpr -Plp0 /some/file" entered directly in the box
(via ssh) does nothing. Is that normal ?

Thanks

manusim

unread,
Oct 4, 2011, 8:24:45 PM10/4/11
to Alt-F


I ran a smbclient //server/printer --debuglevel=10

you can read the resulting file here : http://dl.free.fr/cgJE5GYRd

If this can help...

Joao Cardoso

unread,
Oct 6, 2011, 10:56:58 AM10/6/11
to al...@googlegroups.com
On Wednesday, October 05, 2011 01:06:56 manusim wrote:
> Ok, i've just tried what you're suggesting and i end up with an error
> NT_STATUS_UNSUCCESSFUL opening remote file

I can do it:

jcard@silver:> smbclient -N //nas/lp0
Anonymous login successful
Domain=[HOMENET] OS=[Unix] Server=[Samba 3.3.9]
smb: \> showconnect
//nas/lp0
smb: \>

As I told before, I can create and use a cups printer, its name being:

jcard@silver:> lpstat -s
device for naslpd: lpd://192.168.1.76/lp0

(the nas has 192.168.1.76 as its IP)

Remember that 'lp0' is the queue name

> And the command " lpr -Plp0 /some/file" entered directly in the box
> (via ssh) does nothing. Is that normal ?

Depends on your printer.

Busybox 'lpd' is a very stripped-down lpd implementation (that's why I doubt
that MS-W will work with it). Basically all it does is accept the print job
and dump it to the printer. No local processing or filtering is done.

If your printer is an old one, so that it prints the letter 'A' when the
character 'A' is sent to it, then ' lpr -Plp0 some-text-file' will work fine
-- that's what happens with my old hp laserjet 5l.

Modern printers has to be sent the pixels (pixmap) of what you intent to
print, so 'lpr <text-file>' doesn't work -- that's what happens with my new
printer, a hp-c6280.

This means that print jobs sent to the printer must be pre-processed in the
sending computer, and the generated pixmap pages sent to the printer.
Cups in my linux machine does it for both my hp-5l and hp-c5280 printers, so I
can use any.

lpd by itself, even a full-featured one, don't do any page filtering or
processing, that's the role of the filter program specified in the termcap
file.
Alt-F princap only specifies the printer queue, 'lpd0', and the printer name,
as specified by the manufacturer, so users can select the proper printer
driver in the host computer.

Hope this can help.

>
> Thanks

Joao Cardoso

unread,
Oct 7, 2011, 2:58:23 PM10/7/11
to Alt-F


On Oct 6, 3:56 pm, Joao Cardoso <whoami.jc...@gmail.com> wrote:
> On Wednesday, October 05, 2011 01:06:56 manusim wrote:
> > Ok, i've just tried what you're suggesting and i end up with an error
> > NT_STATUS_UNSUCCESSFUL opening remote file
>
> I can do it:
>
> jcard@silver:> smbclient -N //nas/lp0
> Anonymous login successful
> Domain=[HOMENET] OS=[Unix] Server=[Samba 3.3.9]
> smb: \> showconnect
> //nas/lp0
> smb: \>

I should have said that you have to use 'lp0' as the printer name (in
reality it is the queue name)

...

> Busybox 'lpd'  is a very stripped-down lpd implementation (that's why I doubt
> that MS-W will work with it).

As a matter of fact I was able to print from Vista using either smb or
lpd without having cups installed on the box; for smb you should add
use client driver = yes
to the [Printers] section in smb.conf, and reload smbd, but there are
some strange interations -- on one laptop it worked without problems,
on another it was very slow to start.

Fo using lpd you have to add a new printer in the control panel, add
a network printer, The printer I want is not there, add a printer
using TCP/IP address, device type TCP/IP device, fill hostname with
the box IP, use 'lp0' as the port name, unckeck query the printer and
select the driver, wait a minute or so, in the device type, select
custom, settings Protocol LPR, queue name lp0, check LPR byte counting
enabled, select the printer driver to install locally, print a
testpage, it works!

If someone wants to make this instructions more user-friendly, please
post it and I will put them on the wiki.

Joao

manusim

unread,
Oct 7, 2011, 10:44:43 PM10/7/11
to Alt-F
Yes,
i got it worked with lpd.
I figured out with your first message to create a new printer with lpd
address (lpd://ipnas/lp0) just as you described in your last message.
And it worked well.

But i still can't make it work with smb. I'm stuck with a nt_status
error even with "use client driver = yes" in smb.conf

Thanks again for your help and the very good job you have done with
Alt-F

Emmanuel



Reply all
Reply to author
Forward
0 new messages